[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aS9RKnScH2DVXW-I@black.igk.intel.com>
Date: Tue, 2 Dec 2025 21:50:50 +0100
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Ali Tariq <alitariq45892@...il.com>
Cc: broonie@...nel.org, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org, khairul.anuar.romli@...era.com,
adrianhoyin.ng@...era.com, nirav.rabara@...era.com,
matthew.gerlach@...era.com
Subject: Re: [PATCH] spi: cadence-qspi: Fix runtime PM imbalance in probe
On Sun, Nov 30, 2025 at 09:12:51AM +0000, Ali Tariq wrote:
> The probe function incorrectly calls pm_runtime_put_autosuspend()
> twice in succession at the end of successful probe, dropping two
> runtime PM references while only one was acquired earlier with
> pm_runtime_get_sync(). This causes a usage count underflow:
>
> cadence-qspi 13010000.spi: Runtime PM usage count underflow!
>
> Remove the first redundant pm_runtime_put_autosuspend() call to
> balance the reference count.
>
> Tested on StarFive VisionFive 2 v1.2A board.
...
> if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
> - pm_runtime_put_autosuspend(dev);
> pm_runtime_mark_last_busy(dev);
This one — pm_runtime_mark_last_busy() — also may be removed as it's integrated
into the _put_auutosuspend().
> pm_runtime_put_autosuspend(dev);
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists