]> git.itanic.dy.fi Git - linux-stable/commit
firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors
authorSudeep Holla <sudeep.holla@arm.com>
Wed, 3 May 2023 13:12:52 +0000 (14:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:28 +0000 (14:17 +0100)
commitb77ec23b6df41c48e88735230e11caec56163630
treee3d792ccd9f4f386e8be1ca49e7b6f557d6b590b
parentb8258c74b21ff4dc15cb5e2576063df036a3ecf1
firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors

commit 111a833dc5cbef3d05b2a796a7e23cb7f6ff2192 upstream.

The transmit buffers allocated by the driver can be used to transmit data
by any messages/commands needing the buffer. However, it is not guaranteed
to have been zero-ed before every new transmission and hence it will just
contain residual value from the previous transmission. There are several
reserved fields in the memory descriptors that must be zero(MBZ). The
receiver can reject the transmission if any such MBZ fields are non-zero.

While we can set the whole page to zero, it is not optimal as most of the
fields get initialised to the value required for the current transmission.

So, just set the reserved/MBZ fields to zero in the memory descriptors
explicitly to honour the requirement and keep the receiver happy.

Fixes: cc2195fe536c ("firmware: arm_ffa: Add support for MEM_* interfaces")
Reported-by: Marc Bonnici <marc.bonnici@arm.com>
Link: https://lore.kernel.org/r/20230503131252.12585-1-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/arm_ffa/driver.c