drivers/spi/spi-nxp-fspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
pm_runtime_get_sync() increments the runtime PM usage counter even when
it fails. If it returns an error, nxp_fspi_probe() returns without
dropping that reference, so the counter stays unbalanced.
Balance the counter with pm_runtime_put_noidle() before returning, as
nxp_fspi_remove() already does.
Fixes: 97be4b919a60 ("spi: spi-nxp-fspi: enable runtime pm for fspi")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/spi/spi-nxp-fspi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 1e36ae084dd8..9883e5149dc4 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1351,8 +1351,10 @@ static int nxp_fspi_probe(struct platform_device *pdev)
/* enable clock */
ret = pm_runtime_get_sync(f->dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_noidle(f->dev);
return dev_err_probe(dev, ret, "Failed to enable clock");
+ }
/* Clear potential interrupts */
reg = fspi_readl(f, f->iobase + FSPI_INTR);
--
2.34.1
On Thu, Sep 17, 2026 at 03:37:13PM +0000, Wentao Liang wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even when
> it fails. If it returns an error, nxp_fspi_probe() returns without
> dropping that reference, so the counter stays unbalanced.
>
> Balance the counter with pm_runtime_put_noidle() before returning, as
> nxp_fspi_remove() already does.
>
> Fixes: 97be4b919a60 ("spi: spi-nxp-fspi: enable runtime pm for fspi")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/spi/spi-nxp-fspi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> index 1e36ae084dd8..9883e5149dc4 100644
> --- a/drivers/spi/spi-nxp-fspi.c
> +++ b/drivers/spi/spi-nxp-fspi.c
> @@ -1351,8 +1351,10 @@ static int nxp_fspi_probe(struct platform_device *pdev)
>
> /* enable clock */
> ret = pm_runtime_get_sync(f->dev);
> - if (ret < 0)
> + if (ret < 0) {
> + pm_runtime_put_noidle(f->dev);
> return dev_err_probe(dev, ret, "Failed to enable clock");
> + }
use pm_runtime_resume_and_get()
Frank
>
> /* Clear potential interrupts */
> reg = fspi_readl(f, f->iobase + FSPI_INTR);
> --
> 2.34.1
>
>
On Thu, Sep 17, 2026 at 01:39:06PM -0500, Frank Li wrote: > On Thu, Sep 17, 2026 at 03:37:13PM +0000, Wentao Liang wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even when > > it fails. If it returns an error, nxp_fspi_probe() returns without > > dropping that reference, so the counter stays unbalanced. > use pm_runtime_resume_and_get() This also doesn't apply against current code, please check that when you resend. Please delete unneeded context from mails when replying. Doing this makes it much easier to find your reply in the message, helping ensure it won't be missed by people scrolling through the irrelevant quoted material.
© 2016 - 2026 Red Hat, Inc.