From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Ali Tariq <alitariq45892@gmail.com>
Cc: broonie@kernel.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, khairul.anuar.romli@altera.com,
adrianhoyin.ng@altera.com, nirav.rabara@altera.com,
matthew.gerlach@altera.com
Subject: Re: [PATCH] spi: cadence-qspi: Fix runtime PM imbalance in probe
Date: Tue, 2 Dec 2025 21:50:50 +0100 [thread overview]
Message-ID: <aS9RKnScH2DVXW-I@black.igk.intel.com> (raw)
In-Reply-To: <20251130091251.12120-1-alitariq45892@gmail.com>
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
next prev parent reply other threads:[~2025-12-02 20:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-30 9:12 [PATCH] spi: cadence-qspi: Fix runtime PM imbalance in probe Ali Tariq
2025-12-02 20:35 ` Mark Brown
2025-12-02 20:50 ` Andy Shevchenko [this message]
2025-12-04 11:21 ` Ali Tariq
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aS9RKnScH2DVXW-I@black.igk.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=adrianhoyin.ng@altera.com \
--cc=alitariq45892@gmail.com \
--cc=broonie@kernel.org \
--cc=khairul.anuar.romli@altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=matthew.gerlach@altera.com \
--cc=nirav.rabara@altera.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.