public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_ffa: fix ffa_notification_info_get()
@ 2024-03-07  9:21 Jens Wiklander
  2024-03-08  9:09 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Wiklander @ 2024-03-07  9:21 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, Sudeep Holla
  Cc: Marc Bonnici, Olivier Deprez, Lorenzo Pieralisi, Jens Wiklander

FFA_NOTIFICATION_INFO_GET retries information about pending
notifications. Notifications can be either global or per VCPU. Global
notifications are represented by the VM ID only, or 0 in the absence of
a hypervisor. ffa_notification_info_get() incorrectly expect no ID at all
for global notifications. Fix this by checking for 1 ID instead of 0.

Fixes: 3522be48d82b ("firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 drivers/firmware/arm_ffa/driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index c183c7d39c0f..ff1f37a4b28c 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -790,7 +790,7 @@ static void ffa_notification_info_get(void)
 
 			part_id = packed_id_list[ids_processed++];
 
-			if (!ids_count[list]) { /* Global Notification */
+			if (ids_count[list] == 1) { /* Global Notification */
 				__do_sched_recv_cb(part_id, 0, false);
 				continue;
 			}
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: arm_ffa: fix ffa_notification_info_get()
  2024-03-07  9:21 [PATCH] firmware: arm_ffa: fix ffa_notification_info_get() Jens Wiklander
@ 2024-03-08  9:09 ` Lorenzo Pieralisi
  2024-03-11 11:00   ` Jens Wiklander
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Pieralisi @ 2024-03-08  9:09 UTC (permalink / raw)
  To: Jens Wiklander
  Cc: linux-kernel, linux-arm-kernel, Sudeep Holla, Marc Bonnici,
	Olivier Deprez

On Thu, Mar 07, 2024 at 10:21:04AM +0100, Jens Wiklander wrote:
> FFA_NOTIFICATION_INFO_GET retries information about pending

s/retries/retrieves/

> notifications. Notifications can be either global or per VCPU. Global
> notifications are represented by the VM ID only, or 0 in the absence of
> a hypervisor.

I would just say "Global notifications are reported with the partition
ID only in the list of endpoints with pending notifications".

> ffa_notification_info_get() incorrectly expect no ID at all
> for global notifications. Fix this by checking for 1 ID instead of 0.
> 
> Fixes: 3522be48d82b ("firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface")
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
>  drivers/firmware/arm_ffa/driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>

> diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
> index c183c7d39c0f..ff1f37a4b28c 100644
> --- a/drivers/firmware/arm_ffa/driver.c
> +++ b/drivers/firmware/arm_ffa/driver.c
> @@ -790,7 +790,7 @@ static void ffa_notification_info_get(void)
>  
>  			part_id = packed_id_list[ids_processed++];
>  
> -			if (!ids_count[list]) { /* Global Notification */
> +			if (ids_count[list] == 1) { /* Global Notification */
>  				__do_sched_recv_cb(part_id, 0, false);
>  				continue;
>  			}
> -- 
> 2.34.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: arm_ffa: fix ffa_notification_info_get()
  2024-03-08  9:09 ` Lorenzo Pieralisi
@ 2024-03-11 11:00   ` Jens Wiklander
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Wiklander @ 2024-03-11 11:00 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: linux-kernel, linux-arm-kernel, Sudeep Holla, Marc Bonnici,
	Olivier Deprez

On Fri, Mar 8, 2024 at 10:09 AM Lorenzo Pieralisi <lpieralisi@kernel.org> wrote:
>
> On Thu, Mar 07, 2024 at 10:21:04AM +0100, Jens Wiklander wrote:
> > FFA_NOTIFICATION_INFO_GET retries information about pending
>
> s/retries/retrieves/
>
> > notifications. Notifications can be either global or per VCPU. Global
> > notifications are represented by the VM ID only, or 0 in the absence of
> > a hypervisor.
>
> I would just say "Global notifications are reported with the partition
> ID only in the list of endpoints with pending notifications".
>
> > ffa_notification_info_get() incorrectly expect no ID at all
> > for global notifications. Fix this by checking for 1 ID instead of 0.
> >
> > Fixes: 3522be48d82b ("firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface")
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> >  drivers/firmware/arm_ffa/driver.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>

Thanks, I'll update the commit message accordingly.

Cheers,
Jens

>
> > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
> > index c183c7d39c0f..ff1f37a4b28c 100644
> > --- a/drivers/firmware/arm_ffa/driver.c
> > +++ b/drivers/firmware/arm_ffa/driver.c
> > @@ -790,7 +790,7 @@ static void ffa_notification_info_get(void)
> >
> >                       part_id = packed_id_list[ids_processed++];
> >
> > -                     if (!ids_count[list]) { /* Global Notification */
> > +                     if (ids_count[list] == 1) { /* Global Notification */
> >                               __do_sched_recv_cb(part_id, 0, false);
> >                               continue;
> >                       }
> > --
> > 2.34.1
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-11 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07  9:21 [PATCH] firmware: arm_ffa: fix ffa_notification_info_get() Jens Wiklander
2024-03-08  9:09 ` Lorenzo Pieralisi
2024-03-11 11:00   ` Jens Wiklander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox