mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: zynq: fix runtime PM leak on remove
@ 2026-06-09  7:33 Ruoyu Wang
  2026-06-09 11:19 ` Bartosz Golaszewski
  2026-06-09 13:00 ` Pandey, Radhey Shyam
  0 siblings, 2 replies; 3+ messages in thread
From: Ruoyu Wang @ 2026-06-09  7:33 UTC (permalink / raw)
  To: Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Linus Walleij,
	Bartosz Golaszewski
  Cc: Harini Katakam, Soren Brinkmann, linux-gpio, linux-arm-kernel,
	linux-kernel, Ruoyu Wang

pm_runtime_get_sync() increments the runtime PM usage counter even when it
returns an error. zynq_gpio_remove() uses it to keep the controller active
while removing the GPIO chip, but never drops the usage counter again.

Balance the get with pm_runtime_put_noidle() after disabling runtime PM.

Fixes: 3242ba117e9b ("gpio: Add driver for Zynq GPIO controller")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
---
 drivers/gpio/gpio-zynq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 571e366624d2a..fafca91128b2e 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -1014,6 +1014,7 @@ static void zynq_gpio_remove(struct platform_device *pdev)
 	gpiochip_remove(&gpio->chip);
 	device_set_wakeup_capable(&pdev->dev, 0);
 	pm_runtime_disable(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
 }
 
 static struct platform_driver zynq_gpio_driver = {
-- 
2.51.0


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

* Re: [PATCH] gpio: zynq: fix runtime PM leak on remove
  2026-06-09  7:33 [PATCH] gpio: zynq: fix runtime PM leak on remove Ruoyu Wang
@ 2026-06-09 11:19 ` Bartosz Golaszewski
  2026-06-09 13:00 ` Pandey, Radhey Shyam
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2026-06-09 11:19 UTC (permalink / raw)
  To: Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Linus Walleij,
	Bartosz Golaszewski, Ruoyu Wang
  Cc: Bartosz Golaszewski, Harini Katakam, Soren Brinkmann, linux-gpio,
	linux-arm-kernel, linux-kernel


On Tue, 09 Jun 2026 15:33:13 +0800, Ruoyu Wang wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even when it
> returns an error. zynq_gpio_remove() uses it to keep the controller active
> while removing the GPIO chip, but never drops the usage counter again.
> 
> Balance the get with pm_runtime_put_noidle() after disabling runtime PM.
> 
> 
> [...]

Applied, thanks!

[1/1] gpio: zynq: fix runtime PM leak on remove
      https://git.kernel.org/brgl/c/6edb934de9bda3b7abcec856eaee6fc8b4278dd1

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

* Re: [PATCH] gpio: zynq: fix runtime PM leak on remove
  2026-06-09  7:33 [PATCH] gpio: zynq: fix runtime PM leak on remove Ruoyu Wang
  2026-06-09 11:19 ` Bartosz Golaszewski
@ 2026-06-09 13:00 ` Pandey, Radhey Shyam
  1 sibling, 0 replies; 3+ messages in thread
From: Pandey, Radhey Shyam @ 2026-06-09 13:00 UTC (permalink / raw)
  To: Ruoyu Wang, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
	Linus Walleij, Bartosz Golaszewski
  Cc: Harini Katakam, Soren Brinkmann, linux-gpio, linux-arm-kernel,
	linux-kernel

> pm_runtime_get_sync() increments the runtime PM usage counter even when it
> returns an error. zynq_gpio_remove() uses it to keep the controller active
> while removing the GPIO chip, but never drops the usage counter again.
> 
> Balance the get with pm_runtime_put_noidle() after disabling runtime PM.
> 
> Fixes: 3242ba117e9b ("gpio: Add driver for Zynq GPIO controller")
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Thanks!

> ---
>   drivers/gpio/gpio-zynq.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
> index 571e366624d2a..fafca91128b2e 100644
> --- a/drivers/gpio/gpio-zynq.c
> +++ b/drivers/gpio/gpio-zynq.c
> @@ -1014,6 +1014,7 @@ static void zynq_gpio_remove(struct platform_device *pdev)
>   	gpiochip_remove(&gpio->chip);
>   	device_set_wakeup_capable(&pdev->dev, 0);
>   	pm_runtime_disable(&pdev->dev);
> +	pm_runtime_put_noidle(&pdev->dev);
>   }
>   
>   static struct platform_driver zynq_gpio_driver = {


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

end of thread, other threads:[~2026-06-09 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-09  7:33 [PATCH] gpio: zynq: fix runtime PM leak on remove Ruoyu Wang
2026-06-09 11:19 ` Bartosz Golaszewski
2026-06-09 13:00 ` Pandey, Radhey Shyam

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

all inboxes | Powered by JetHome®