From: Sasha Levin <sashal@kernel.org>
To: Mark Brown <broonie@kernel.org>,
Matthew Gerlach <matthew.gerlach@altera.com>,
Khairul Anuar Romli <khairul.anuar.romli@altera.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dan Carpenter <dan.carpenter@linaro.org>
Cc: Sasha Levin <sashal@kernel.org>,
miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
Pascal EBERHARD <pascal.eberhard@se.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
"Diogo Ivo (Schneider Electric)" <diogo.ivo@bootlin.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 6.12.y 1/2] spi: cadence-quadspi: fix runtime pm cleanup on probe failure/unbind
Date: Fri, 7 Aug 2026 15:06:00 -0400 [thread overview]
Message-ID: <20260807182230.stable-0002-sashal@kernel.org> (raw)
In-Reply-To: <20260807-cqspi-pm_runtime-v1-1-5973a0a208c4@bootlin.com>
On Fri, Aug 07, 2026 at 01:49:20PM +0200, Diogo Ivo (Schneider Electric) wrote:
> +disable_rpm:
> + pm_runtime_put_noidle(dev);
> + pm_runtime_dont_use_autosuspend(dev);
> + pm_runtime_disable(dev);
> probe_setup_failed:
> cqspi_controller_enable(cqspi, 0);
> - pm_runtime_disable(dev);
This teardown order is inverted relative to upstream, and it reinstates
a bug upstream deliberately closed.
pm_runtime_dont_use_autosuspend() runs update_autosuspend(), and with
the usage count already dropped to 0 by the preceding put_noidle() and
the device still RPM_ACTIVE, that can queue a runtime suspend, i.e.
cqspi_runtime_suspend() -> clk_disable_unprepare(). The following
pm_runtime_disable() does barrier it, but control then falls through to
probe_setup_failed, which does cqspi_controller_enable(cqspi, 0) - a
register write against a potentially gated clock. That is exactly the
unclocked access 233db2cb14db ("spi: cadence-quadspi: fix unclocked
access on unbind") went out of its way to prevent.
Please mirror the upstream ordering from 5e8bb0cc72f1 ("spi:
cadence-quadspi: fix runtime pm and clock imbalance on unbind"):
pm_runtime_disable(dev);
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
pm_runtime_dont_use_autosuspend(dev);
pm_runtime_set_suspended() is missing here as well.
> pm_runtime_put_sync(&pdev->dev);
> + pm_runtime_dont_use_autosuspend(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
Same ordering problem in cqspi_remove()...
> As the history of this driver in mainline is convoluted with several
> rounds of fixes it includes the fixes from two commits, namely
> commit 5ff4d5d1af0c ("spi: cadence-quadspi: fix runtime pm disable
> imbalance on probe failure") and commit 5e8bb0cc72f1 ("spi:
> cadence-quadspi: fix runtime pm and clock imbalance on unbind").
Please split this so each patch maps to exactly one upstream commit.
> Fixes: 74b0b4cf13fc ("spi: spi-cadence-quadspi: Fix pm runtime unbalance")
> Cc: stable@vger.kernel.org
Both Fixes: tags in this series point at stable-tree commits rather than
mainline ones.
--
Thanks,
Sasha
next prev parent reply other threads:[~2026-08-07 19:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 11:49 [PATCH 6.12.y 0/2] spi: cadence-quadspi: fix probe error path and remove Diogo Ivo (Schneider Electric)
2026-08-07 11:49 ` [PATCH 6.12.y 1/2] spi: cadence-quadspi: fix runtime pm cleanup on probe failure/unbind Diogo Ivo (Schneider Electric)
2026-08-07 19:06 ` Sasha Levin [this message]
2026-08-07 11:49 ` [PATCH 6.12.y 2/2] spi: cadence-quadspi: release DMA channel on probe failure Diogo Ivo (Schneider Electric)
2026-08-07 13:46 ` [PATCH 6.12.y 0/2] spi: cadence-quadspi: fix probe error path and remove Greg Kroah-Hartman
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=20260807182230.stable-0002-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=diogo.ivo@bootlin.com \
--cc=gregkh@linuxfoundation.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=miquel.raynal@bootlin.com \
--cc=pascal.eberhard@se.com \
--cc=stable@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.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.