Skip to content

Commit c6e0453

Browse files
committed
firmware: arm_ffa: Fix usage of partition info get count flag
Commit bb1be74 ("firmware: arm_ffa: Add v1.1 get_partition_info support") adds support to discovery the UUIDs of the partitions or just fetch the partition count using the PARTITION_INFO_GET_RETURN_COUNT_ONLY flag. However the commit doesn't handle the fact that the older version doesn't understand the flag and must be MBZ which results in firmware returning invalid parameter error. That results in the failure of the driver probe which is in correct. Limit the usage of the PARTITION_INFO_GET_RETURN_COUNT_ONLY flag for the versions above v1.0(i.e v1.1 and onwards) which fixes the issue. Fixes: bb1be74 ("firmware: arm_ffa: Add v1.1 get_partition_info support") Reported-by: Jens Wiklander <[email protected]> Reported-by: Marc Bonnici <[email protected]> Tested-by: Jens Wiklander <[email protected]> Reviewed-by: Jens Wiklander <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sudeep Holla <[email protected]>
1 parent b71b552 commit c6e0453

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3,
193193
int idx, count, flags = 0, sz, buf_sz;
194194
ffa_value_t partition_info;
195195

196-
if (!buffer || !num_partitions) /* Just get the count for now */
196+
if (drv_info->version > FFA_VERSION_1_0 &&
197+
(!buffer || !num_partitions)) /* Just get the count for now */
197198
flags = PARTITION_INFO_GET_RETURN_COUNT_ONLY;
198199

199200
mutex_lock(&drv_info->rx_lock);

0 commit comments

Comments
 (0)