From: Lorenzo Bianconi <lorenzo@kernel.org>
To: John Crispin <john@phrozen.org>
Cc: Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Christian Marangi <ansuelsmth@gmail.com>,
lei.dong@airoha.com, Linqi.zhang@airoha.com,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
Rajeev.kumar@airoha.com, upstream@airoha.com,
Weifeng.xu@airoha.com, zhengping.zhang@airoha.com,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH v2] clk: en7523: do not sleep in the EN7581 PCIe clock disable
Date: Fri, 13 Nov 2026 09:44:43 +0100 [thread overview]
Message-ID: <avbN-3nL6JNHozzz@lore-desk> (raw)
In-Reply-To: <20261112185329.1314427-1-john@phrozen.org>
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
> en7581_pci_disable() is the .disable callback of the PCIe clock gate.
> The clock core calls .disable with the enable spinlock held and
> interrupts off, but the callback sleeps with usleep_range(). Every boot
> where no consumer holds the clock reports "BUG: scheduling while atomic"
> from clk_disable_unused(), and so does the unwind of a PCIe probe that
> finds no link.
>
> Drop the sleep. Commit 90d4e466c9ea ("PCI: mediatek-gen3: Move reset
> delay in mtk_pcie_en7581_power_up()") already moved the wait of the
> enable side into the PCIe driver, and nothing depends on a wait after
> the disable.
>
> Fixes: 66bc47326ce2 ("clk: en7523: Add EN7581 support")
> Signed-off-by: John Crispin <john@phrozen.org>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Changes in v2:
> - Drop "clk: en7523: add a reset operation". i2c-mt7621 now asserts
> and deasserts the reset line instead (Philipp).
> - Link to v1: https://lore.kernel.org/r/20261111085650.632025-1-john@phrozen.org
>
> drivers/clk/clk-en7523.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
> index 24fdec2e6198..8f63482cbb7b 100644
> --- a/drivers/clk/clk-en7523.c
> +++ b/drivers/clk/clk-en7523.c
> @@ -689,7 +689,6 @@ static void en7581_pci_disable(struct clk_hw *hw)
> mask = REG_PCI_CONTROL_REFCLK_EN0 | REG_PCI_CONTROL_REFCLK_EN1;
> val = readl(np_base + REG_PCI_CONTROL);
> writel(val & ~mask, np_base + REG_PCI_CONTROL);
> - usleep_range(1000, 2000);
> }
>
> static void en7523_register_clocks(struct device *dev, struct clk_hw_onecell_data *clk_data,
>
> base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2026-11-13 8:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 18:53 [PATCH v2] clk: en7523: do not sleep in the EN7581 PCIe clock disable John Crispin
2026-11-13 8:44 ` Lorenzo Bianconi [this message]
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=avbN-3nL6JNHozzz@lore-desk \
--to=lorenzo@kernel.org \
--cc=Linqi.zhang@airoha.com \
--cc=Rajeev.kumar@airoha.com \
--cc=Weifeng.xu@airoha.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=ansuelsmth@gmail.com \
--cc=bmasney+clk@redhat.com \
--cc=jbrunet+clk@baylibre.com \
--cc=john@phrozen.org \
--cc=lei.dong@airoha.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=upstream@airoha.com \
--cc=zhengping.zhang@airoha.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox