* [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well
@ 2025-01-22 5:23 Viresh Kumar
2025-01-22 5:23 ` [PATCH 2/2] firmware: arm_ffa: Allow multiple UUIDs per partition Viresh Kumar
2025-01-22 11:39 ` [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well Sudeep Holla
0 siblings, 2 replies; 4+ messages in thread
From: Viresh Kumar @ 2025-01-22 5:23 UTC (permalink / raw)
To: Sudeep Holla
Cc: Viresh Kumar, Vincent Guittot, Alex Bennée, Bill Mills,
linux-arm-kernel, linux-kernel
Partition info may return self partition as well (specially with newer
versions of FFA spec), skip adding it twice.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Rebased over: 9967e35eb1cbdb8d0c0bae3f54401d806700e6b6.1732255888.git.viresh.kumar@linaro.org
drivers/firmware/arm_ffa/driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index 34d9a54b6a77..b824c7c024fd 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -1424,6 +1424,9 @@ static int ffa_setup_partitions(void)
xa_init(&drv_info->partition_info);
for (idx = 0, tpbuf = pbuf; idx < count; idx++, tpbuf++) {
+ if (drv_info->vm_id == tpbuf->id)
+ continue;
+
/* Note that if the UUID will be uuid_null, that will require
* ffa_bus_notifier() to find the UUID of this partition id
* with help of ffa_device_match_uuid(). FF-A v1.1 and above
--
2.31.1.272.g89b43f80a514
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] firmware: arm_ffa: Allow multiple UUIDs per partition
2025-01-22 5:23 [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well Viresh Kumar
@ 2025-01-22 5:23 ` Viresh Kumar
2025-01-22 11:44 ` Sudeep Holla
2025-01-22 11:39 ` [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well Sudeep Holla
1 sibling, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2025-01-22 5:23 UTC (permalink / raw)
To: Sudeep Holla
Cc: Viresh Kumar, Vincent Guittot, Alex Bennée, Bill Mills,
linux-arm-kernel, linux-kernel
A partition can implement multiple UUIDs and adding the same partition
twice will fail. Don't try to add a partition again, if it is already
added earlier.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/firmware/arm_ffa/driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index b824c7c024fd..6de941821319 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -1389,6 +1389,10 @@ static int ffa_add_partition_info(int vm_id)
struct ffa_dev_part_info *info;
int ret;
+ /* Already added ? */
+ if (xa_load(&drv_info->partition_info, vm_id))
+ return 0;
+
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
--
2.31.1.272.g89b43f80a514
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well
2025-01-22 5:23 [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well Viresh Kumar
2025-01-22 5:23 ` [PATCH 2/2] firmware: arm_ffa: Allow multiple UUIDs per partition Viresh Kumar
@ 2025-01-22 11:39 ` Sudeep Holla
1 sibling, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2025-01-22 11:39 UTC (permalink / raw)
To: Viresh Kumar
Cc: Vincent Guittot, Sudeep Holla, Alex Bennée, Bill Mills,
linux-arm-kernel, linux-kernel
On Wed, Jan 22, 2025 at 10:53:42AM +0530, Viresh Kumar wrote:
> Partition info may return self partition as well (specially with newer
> versions of FFA spec), skip adding it twice.
>
I have a patch[1] in my branch that I was planning to post after the merge
window. It does this in little different way so that the host partition
gets registered and appears in the sysfs though there might be no driver
bound to it.
--
Regards,
Sudeep
[1] https://git.kernel.org/sudeep.holla/c/27cce7b926f8d8b8020a089fcc55b5061093a9f2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] firmware: arm_ffa: Allow multiple UUIDs per partition
2025-01-22 5:23 ` [PATCH 2/2] firmware: arm_ffa: Allow multiple UUIDs per partition Viresh Kumar
@ 2025-01-22 11:44 ` Sudeep Holla
0 siblings, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2025-01-22 11:44 UTC (permalink / raw)
To: Viresh Kumar
Cc: Vincent Guittot, Alex Bennée, Sudeep Holla, Bill Mills,
linux-arm-kernel, linux-kernel
On Wed, Jan 22, 2025 at 10:53:43AM +0530, Viresh Kumar wrote:
> A partition can implement multiple UUIDs and adding the same partition
> twice will fail. Don't try to add a partition again, if it is already
> added earlier.
>
Bertrand shared similar patch and that raised question if we need to support
sched_callback from different drivers or not. I need to think if we can drop
the whole support of allowing FF-A drivers to register sched_callback or
do this properly. Let me think. But this can be a temporary fix though.
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-22 11:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-22 5:23 [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well Viresh Kumar
2025-01-22 5:23 ` [PATCH 2/2] firmware: arm_ffa: Allow multiple UUIDs per partition Viresh Kumar
2025-01-22 11:44 ` Sudeep Holla
2025-01-22 11:39 ` [PATCH 1/2] firmware: arm_ffa: Partition info can returns self as well Sudeep Holla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).