FROMGIT: firmware: arm_ffa: Skip Rx buffer ownership release if not acquired

Completion of the FFA_PARTITION_INFO_GET ABI transfers the ownership of
the caller’s Rx buffer from the producer(typically partition mnager) to
the consumer(this driver/OS). FFA_RX_RELEASE transfers the ownership
from the consumer back to the producer.

However, when we set the flag to just return the count of partitions
deployed in the system corresponding to the specified UUID while
invoking FFA_PARTITION_INFO_GET, the Rx buffer ownership shouldn't be
transferred to this driver. We must be able to skip transferring back
the ownership to the partition manager when we request just to get the
count of the partitions as the buffers are not acquired in this case.

Firmware may return FFA_RET_DENIED or other error for the ffa_rx_release()
in such cases.

Bug: 269285339
Bug: 278749606
(cherry picked from commit 4567bdaaaaa1744da3d7da07d9aca2f941f5b4e5
 https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git)
Fixes: bb1be74985 ("firmware: arm_ffa: Add v1.1 get_partition_info support")
Change-Id: Ida7f07ee3b38466797d7f14014b986ded80c76f7
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sebastian Ene <sebastianene@google.com>
This commit is contained in:
Sudeep Holla
2025-03-21 11:57:00 +00:00
committed by Sebastian Ene
parent b2fde9f68b
commit 920ff2048a
+2 -1
View File
@@ -254,7 +254,8 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3,
memcpy(buffer + idx, drv_info->rx_buffer + idx * sz,
buf_sz);
ffa_rx_release();
if (!(flags & PARTITION_INFO_GET_RETURN_COUNT_ONLY))
ffa_rx_release();
mutex_unlock(&drv_info->rx_lock);