All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
@ 2025-12-11 11:49 Amitai Gottlieb
  2025-12-11 12:17 ` Cristian Marussi
  0 siblings, 1 reply; 7+ messages in thread
From: Amitai Gottlieb @ 2025-12-11 11:49 UTC (permalink / raw)
  To: arm-scmi; +Cc: Amitai Gottlieb

In function `scmi_devm_notifier_unregister` the notifier-block parameter
was unused and therefore never passed to `devres_release`. This causes
the function to always return -ENOENT and fail to unregister the
notifier.

In drivers that rely on this function for cleanup this causes
unexpected failures including kernel-panic.

Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres
notification ops")
Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
---

This is not needed upstream becaues the bug was fixed
in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
6.6 kernels.

 drivers/firmware/arm_scmi/notify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 0efd20cd9d69..4782b115e6ec 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1539,6 +1539,7 @@ static int scmi_devm_notifier_unregister(struct scmi_device *sdev,
 	dres.handle = sdev->handle;
 	dres.proto_id = proto_id;
 	dres.evt_id = evt_id;
+	dres.nb = nb;
 	if (src_id) {
 		dres.__src_id = *src_id;
 		dres.src_id = &dres.__src_id;
-- 
2.34.1


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

* Re: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
  2025-12-11 11:49 [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister Amitai Gottlieb
@ 2025-12-11 12:17 ` Cristian Marussi
  2025-12-11 12:53   ` Dan Carpenter
  0 siblings, 1 reply; 7+ messages in thread
From: Cristian Marussi @ 2025-12-11 12:17 UTC (permalink / raw)
  To: Amitai Gottlieb; +Cc: arm-scmi, cristian.marussi, sudeep.holla

On Thu, Dec 11, 2025 at 01:49:27PM +0200, Amitai Gottlieb wrote:
> In function `scmi_devm_notifier_unregister` the notifier-block parameter
> was unused and therefore never passed to `devres_release`. This causes
> the function to always return -ENOENT and fail to unregister the
> notifier.

[ CC-ing also Sudeep ]

Hi,

thanks for this.

LGTM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>

> 
> In drivers that rely on this function for cleanup this causes
> unexpected failures including kernel-panic.
> 
> Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres
> notification ops")
> Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
> ---
> 
> This is not needed upstream becaues the bug was fixed
> in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
> 6.6 kernels.

I think there is some sort of syntax to refer to the applicable Kernel
versions in the tag line....not sure it can be easily followed here...so
maybe the above comment is enough...

More details here...

https://docs.kernel.org/process/stable-kernel-rules.html

Thanks,
Cristian

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

* Re: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
  2025-12-11 12:17 ` Cristian Marussi
@ 2025-12-11 12:53   ` Dan Carpenter
       [not found]     ` <DB9P194MB13560B1BBAD2A8A8E6260719C1ADA@DB9P194MB1356.EURP194.PROD.OUTLOOK.COM>
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2025-12-11 12:53 UTC (permalink / raw)
  To: Cristian Marussi; +Cc: Amitai Gottlieb, arm-scmi, sudeep.holla

On Thu, Dec 11, 2025 at 12:17:01PM +0000, Cristian Marussi wrote:
> On Thu, Dec 11, 2025 at 01:49:27PM +0200, Amitai Gottlieb wrote:
> > In function `scmi_devm_notifier_unregister` the notifier-block parameter
> > was unused and therefore never passed to `devres_release`. This causes
> > the function to always return -ENOENT and fail to unregister the
> > notifier.
> 
> [ CC-ing also Sudeep ]
> 
> Hi,
> 
> thanks for this.
> 
> LGTM.
> 
> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
> 
> > 
> > In drivers that rely on this function for cleanup this causes
> > unexpected failures including kernel-panic.
> > 
> > Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres
> > notification ops")

This Fixes tag needs to be all on one line.
Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres notification ops")

> > Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
> > ---
> > 
> > This is not needed upstream becaues the bug was fixed
> > in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> > scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
> > 6.6 kernels.
> 
> I think there is some sort of syntax to refer to the applicable Kernel
> versions in the tag line....not sure it can be easily followed here...so
> maybe the above comment is enough...
> 
> More details here...
> 
> https://docs.kernel.org/process/stable-kernel-rules.html

I'm pretty sure those little comments aren't parsed automatically...
It feels duplicative.  I don't love those little notes because it feels
like the Fixes tag should normally be sufficient otherwise I want a full
explanation.  There was an embarrassing bug where the notes were wrong
and the patch was missing a Fixes tag so it wasn't backported far enough
in distro kernels.

It can't hurt to add them to the tag section, I suppose.

Cc: <stable@vger.kernel.org> # 5.15.x, 6.1.x, and 6.6.x

Leaving them out is also fine, really.

We definitely still need the note.  I said before that note about
"This is not needed upstream becaues the bug was fixed
in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
scmi_devm_notifier_unregister")" should go under the --- cut off line,
but actually I think now that it should go into the actual commit
message itself.  Otherwise people who work on distro kernels, for
example, will wonder why the commit doesn't have an upstream hash.

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>

Wait until Sudeep has responded, and then resend the patch to
stable@vger.kernel.org with all the Reviewed-by tags.

regards,
dan carpenter


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

* Re: Fw: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
       [not found]     ` <DB9P194MB13560B1BBAD2A8A8E6260719C1ADA@DB9P194MB1356.EURP194.PROD.OUTLOOK.COM>
@ 2025-12-15 12:19       ` amitaigottlieb
  2025-12-15 15:13         ` Sudeep Holla
  0 siblings, 1 reply; 7+ messages in thread
From: amitaigottlieb @ 2025-12-15 12:19 UTC (permalink / raw)
  To: arm-scmi; +Cc: amitaig

On 25/12/15 11:27AM, Amitai Gottlieb wrote:
> 
> ________________________________
> From: Dan Carpenter <dan.carpenter@linaro.org>
> Sent: Thursday, December 11, 2025 14:53
> To: Cristian Marussi <cristian.marussi@arm.com>
> Cc: Amitai Gottlieb <amitaig@hailo.ai>; arm-scmi@vger.kernel.org <arm-scmi@vger.kernel.org>; sudeep.holla@arm.com <sudeep.holla@arm.com>
> Subject: Re: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
> 
> On Thu, Dec 11, 2025 at 12:17:01PM +0000, Cristian Marussi wrote:
> > On Thu, Dec 11, 2025 at 01:49:27PM +0200, Amitai Gottlieb wrote:
> > > In function `scmi_devm_notifier_unregister` the notifier-block parameter
> > > was unused and therefore never passed to `devres_release`. This causes
> > > the function to always return -ENOENT and fail to unregister the
> > > notifier.
> >
> > [ CC-ing also Sudeep ]
> >
> > Hi,
> >
> > thanks for this.
> >
> > LGTM.
> >
> > Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
> >
> > >
> > > In drivers that rely on this function for cleanup this causes
> > > unexpected failures including kernel-panic.
> > >
> > > Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres
> > > notification ops")
> 
> This Fixes tag needs to be all on one line.
> Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres notification ops")
> 
> > > Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
> > > ---
> > >
> > > This is not needed upstream becaues the bug was fixed
> > > in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> > > scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
> > > 6.6 kernels.
> >
> > I think there is some sort of syntax to refer to the applicable Kernel
> > versions in the tag line....not sure it can be easily followed here...so
> > maybe the above comment is enough...
> >
> > More details here...
> >
> > https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.kernel.org%2Fprocess%2Fstable-kernel-rules.html&data=05%7C02%7Camitaig%40hailo.ai%7C6aec4657c2364f78663408de38b45031%7C6ae4a5f7546741898f6af2928ed536de%7C0%7C0%7C639010544284877259%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Kxmnl4F4KpZgBjzGakndjp9EK9A2GfrXFj04F5%2FPIxE%3D&reserved=0<https://docs.kernel.org/process/stable-kernel-rules.html>
> 
> I'm pretty sure those little comments aren't parsed automatically...
> It feels duplicative.  I don't love those little notes because it feels
> like the Fixes tag should normally be sufficient otherwise I want a full
> explanation.  There was an embarrassing bug where the notes were wrong
> and the patch was missing a Fixes tag so it wasn't backported far enough
> in distro kernels.
> 
> It can't hurt to add them to the tag section, I suppose.
> 
> Cc: <stable@vger.kernel.org> # 5.15.x, 6.1.x, and 6.6.x
> 
> Leaving them out is also fine, really.
> 
> We definitely still need the note.  I said before that note about
> "This is not needed upstream becaues the bug was fixed
> in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> scmi_devm_notifier_unregister")" should go under the --- cut off line,
> but actually I think now that it should go into the actual commit
> message itself.  Otherwise people who work on distro kernels, for
> example, will wonder why the commit doesn't have an upstream hash.
> 
> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> Wait until Sudeep has responded, and then resend the patch to
> stable@vger.kernel.org with all the Reviewed-by tags.
> 
> regards,
> dan carpenter

I switched to my personal mail as my work was making my life difficult
while using an external mail client.

I've waited a few days and Sudeep hasn't responded, is it fine with you
if I send it off as is?

thanks,
Amitai
> 

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

* Re: Fw: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
  2025-12-15 12:19       ` Fw: " amitaigottlieb
@ 2025-12-15 15:13         ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2025-12-15 15:13 UTC (permalink / raw)
  To: amitaigottlieb@gmail.com; +Cc: arm-scmi, amitaig, Sudeep Holla

On Mon, Dec 15, 2025 at 02:19:29PM +0200, amitaigottlieb@gmail.com wrote:
> On 25/12/15 11:27AM, Amitai Gottlieb wrote:
> > 
> > ________________________________
> > From: Dan Carpenter <dan.carpenter@linaro.org>
> > Sent: Thursday, December 11, 2025 14:53
> > To: Cristian Marussi <cristian.marussi@arm.com>
> > Cc: Amitai Gottlieb <amitaig@hailo.ai>; arm-scmi@vger.kernel.org <arm-scmi@vger.kernel.org>; sudeep.holla@arm.com <sudeep.holla@arm.com>
> > Subject: Re: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
> > 
> > On Thu, Dec 11, 2025 at 12:17:01PM +0000, Cristian Marussi wrote:
> > > On Thu, Dec 11, 2025 at 01:49:27PM +0200, Amitai Gottlieb wrote:
> > > > In function `scmi_devm_notifier_unregister` the notifier-block parameter
> > > > was unused and therefore never passed to `devres_release`. This causes
> > > > the function to always return -ENOENT and fail to unregister the
> > > > notifier.
> > >
> > > [ CC-ing also Sudeep ]
> > >
> > > Hi,
> > >
> > > thanks for this.
> > >
> > > LGTM.
> > >
> > > Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
> > >
> > > >
> > > > In drivers that rely on this function for cleanup this causes
> > > > unexpected failures including kernel-panic.
> > > >
> > > > Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres
> > > > notification ops")
> > 
> > This Fixes tag needs to be all on one line.
> > Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres notification ops")
> > 
> > > > Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
> > > > ---
> > > >
> > > > This is not needed upstream becaues the bug was fixed
> > > > in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> > > > scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
> > > > 6.6 kernels.
> > >
> > > I think there is some sort of syntax to refer to the applicable Kernel
> > > versions in the tag line....not sure it can be easily followed here...so
> > > maybe the above comment is enough...
> > >
> > > More details here...
> > >
> > > https://docs.kernel.org/process/stable-kernel-rules.html<https://docs.kernel.org/process/stable-kernel-rules.html>
> > 
> > I'm pretty sure those little comments aren't parsed automatically...
> > It feels duplicative.  I don't love those little notes because it feels
> > like the Fixes tag should normally be sufficient otherwise I want a full
> > explanation.  There was an embarrassing bug where the notes were wrong
> > and the patch was missing a Fixes tag so it wasn't backported far enough
> > in distro kernels.
> > 
> > It can't hurt to add them to the tag section, I suppose.
> > 
> > Cc: <stable@vger.kernel.org> # 5.15.x, 6.1.x, and 6.6.x
> > 
> > Leaving them out is also fine, really.
> > 
> > We definitely still need the note.  I said before that note about
> > "This is not needed upstream becaues the bug was fixed
> > in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> > scmi_devm_notifier_unregister")" should go under the --- cut off line,
> > but actually I think now that it should go into the actual commit
> > message itself.  Otherwise people who work on distro kernels, for
> > example, will wonder why the commit doesn't have an upstream hash.
> > 
> > Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
> > 
> > Wait until Sudeep has responded, and then resend the patch to
> > stable@vger.kernel.org with all the Reviewed-by tags.
> > 
> > regards,
> > dan carpenter
> 
> I switched to my personal mail as my work was making my life difficult
> while using an external mail client.
> 
> I've waited a few days and Sudeep hasn't responded, is it fine with you
> if I send it off as is?
> 

Sorry, I am fine with the change and was thinking of acking it when you
posted version for stable kernel following the rules. Or did I miss that ?
Please point me with a link to the posting if already done.

-- 
Regards,
Sudeep

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

* [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
@ 2025-12-15 16:37 Amitai Gottlieb
  2025-12-15 17:13 ` Sudeep Holla
  0 siblings, 1 reply; 7+ messages in thread
From: Amitai Gottlieb @ 2025-12-15 16:37 UTC (permalink / raw)
  To: stable
  Cc: sudeep.holla, amitaigottlieb, Amitai Gottlieb, Dan Carpenter,
	Cristian Marussi

In function `scmi_devm_notifier_unregister` the notifier-block parameter
was unused and therefore never passed to `devres_release`. This causes
the function to always return -ENOENT and fail to unregister the
notifier.

In drivers that rely on this function for cleanup this causes
unexpected failures including kernel-panic.

This is not needed upstream becaues the bug was fixed
in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
6.6 kernels.

Cc: <stable@vger.kernel.org> # 5.15.x, 6.1.x, and 6.6.x
Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres notification ops")
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
---

 drivers/firmware/arm_scmi/notify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 0efd20cd9d69..4782b115e6ec 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1539,6 +1539,7 @@ static int scmi_devm_notifier_unregister(struct scmi_device *sdev,
 	dres.handle = sdev->handle;
 	dres.proto_id = proto_id;
 	dres.evt_id = evt_id;
+	dres.nb = nb;
 	if (src_id) {
 		dres.__src_id = *src_id;
 		dres.src_id = &dres.__src_id;
-- 
2.34.1


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

* Re: [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
  2025-12-15 16:37 Amitai Gottlieb
@ 2025-12-15 17:13 ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2025-12-15 17:13 UTC (permalink / raw)
  To: Amitai Gottlieb; +Cc: stable, amitaigottlieb, Dan Carpenter, Cristian Marussi

Add [STABLE ONLY] in the subject please along with [PATCH] and repost
it.

Also add Greg Kroah-Hartman <gregkh@linuxfoundation.org> to cc as well.

On Mon, Dec 15, 2025 at 06:37:32PM +0200, Amitai Gottlieb wrote:
> In function `scmi_devm_notifier_unregister` the notifier-block parameter
> was unused and therefore never passed to `devres_release`. This causes
> the function to always return -ENOENT and fail to unregister the
> notifier.
> 
> In drivers that rely on this function for cleanup this causes
> unexpected failures including kernel-panic.
> 
> This is not needed upstream becaues the bug was fixed
> in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
> scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
> 6.6 kernels.
> 

I would slightly reword the commit message like below.

 | In scmi_devm_notifier_unregister(), the notifier-block argument was ignored
 | and never passed to devres_release(). As a result, the function always
 | returned -ENOENT and failed to unregister the notifier.
 |
 | Drivers that depend on this helper for teardown could therefore hit
 | unexpected failures, including kernel panics.
 |
 | Commit 264a2c520628 ("firmware: arm_scmi: Simplify scmi_devm_notifier_unregister")
 | removed the faulty code path during refactoring and hence this fix is not
 | required upstream.

(add a panic log if you have seen one, that would help)

With that you can add,

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

> Cc: <stable@vger.kernel.org> # 5.15.x, 6.1.x, and 6.6.x
> Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres notification ops")
> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
> Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
> ---
> 
>  drivers/firmware/arm_scmi/notify.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
> index 0efd20cd9d69..4782b115e6ec 100644
> --- a/drivers/firmware/arm_scmi/notify.c
> +++ b/drivers/firmware/arm_scmi/notify.c
> @@ -1539,6 +1539,7 @@ static int scmi_devm_notifier_unregister(struct scmi_device *sdev,
>  	dres.handle = sdev->handle;
>  	dres.proto_id = proto_id;
>  	dres.evt_id = evt_id;
> +	dres.nb = nb;
>  	if (src_id) {
>  		dres.__src_id = *src_id;
>  		dres.src_id = &dres.__src_id;
> -- 
> 2.34.1
> 

-- 
Regards,
Sudeep

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

end of thread, other threads:[~2025-12-15 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11 11:49 [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister Amitai Gottlieb
2025-12-11 12:17 ` Cristian Marussi
2025-12-11 12:53   ` Dan Carpenter
     [not found]     ` <DB9P194MB13560B1BBAD2A8A8E6260719C1ADA@DB9P194MB1356.EURP194.PROD.OUTLOOK.COM>
2025-12-15 12:19       ` Fw: " amitaigottlieb
2025-12-15 15:13         ` Sudeep Holla
  -- strict thread matches above, loose matches on Subject: below --
2025-12-15 16:37 Amitai Gottlieb
2025-12-15 17:13 ` Sudeep Holla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.