* [PATCH 00/10] clk: Assorted bug fixes across clock core and drivers
@ 2026-11-23 16:47 Lee Jones
2026-11-23 16:47 ` [PATCH 08/10] clk: tenstorrent: Poll atomically in atlantis_clk_pll_enable() Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Lee Jones @ 2026-11-23 16:47 UTC (permalink / raw)
To: lee, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv
Cc: linux-kernel, Uwe Kleine-König, Zhao, Linaro, Abel Vesa,
Alim Akhtar, Amit Daniel Kachhap, Anirudh Srinivasan,
Brian Masney, Chander Kashyap, Chanwoo Choi, Dong Aisheng,
Drew Fustini, Fabio Estevam, Francesco Dolcini, Frank Li,
Heiko Stuebner, imx, Jerome Brunet, Joel Stanley, Jonathan Hunter,
Jyri Sarha, Krzysztof Kozlowski, Lad Prabhakar, Liam Beguin,
Linaro Ltd, linux-arm-kernel, linux-clk, linux-samsung-soc,
linux-tegra, Lubomir Rintel, Lukasz Luba, Marian Mihailescu,
Maxime Coquelin, Mike Looijmans, Peng Fan, Pengpeng Hou,
Pengutronix Kernel Team, Peter Griffin, Prashant Gaikwad,
Rosen Penev, Sascha Hauer, Sergej Sawazki, Shawn Guo,
Stephen Boyd, Sylwester Nawrocki, Thierry Reding, Thomas Abraham,
Tomasz Figa
These issues were reported by Sashiko.
None of these changes have been tested on physical hardware.
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: "Zhao, Linaro" <richard.zhao@linaro.org>
Cc: Abel Vesa <abelvesa@kernel.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Cc: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
Cc: Brian Masney <bmasney+clk@redhat.com>
Cc: Chander Kashyap <k.chander@samsung.com>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Cc: Drew Fustini <fustini@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: imx@lists.linux.dev
Cc: Jerome Brunet <jbrunet+clk@baylibre.com>
Cc: Joel Stanley <jms@oss.tenstorrent.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Liam Beguin <lvb@xiphos.com>
Cc: Linaro Ltd <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-clk@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Lukasz Luba <lukasz.luba@arm.com>
Cc: Marian Mihailescu <mihailescu2m@gmail.com>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Peter Griffin <peter.griffin@linaro.org>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Rosen Penev <rosenp@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Sergej Sawazki <ce3a@gmx.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Thierry Reding <thierry.reding@kernel.org>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Lee Jones (10):
clk: imx: imx8qxp-lpcg: Prevent stack overflow when parsing clocks
clk: lmk04832: Validate child reg index in lmk04832_probe()
clk: tegra: bpmp: Bound num_parents by MRQ_CLK_MAX_PARENTS
clk: composite: Initialise sub-hw pointers in determine_rate()
clk: divider: Avoid division by zero in _div_round_closest()
clk: gpio: Reject gate clocks with multiple parents
clk: samsung: exynos5420: Terminate PLL rate tables with sentinels
clk: tenstorrent: Poll atomically in atlantis_clk_pll_enable()
clk: cdce925: Use devm_of_clk_add_hw_provider() to avoid UAF on unbind
clk: mmp: audio: Use devm_of_clk_add_hw_provider() to prevent UAF
drivers/clk/clk-cdce925.c | 4 ++--
drivers/clk/clk-composite.c | 2 ++
drivers/clk/clk-divider.c | 3 +++
drivers/clk/clk-gpio.c | 3 +++
drivers/clk/clk-lmk04832.c | 10 ++++++++--
drivers/clk/imx/clk-imx8qxp-lpcg.c | 4 ++++
drivers/clk/mmp/clk-audio.c | 4 ++--
drivers/clk/samsung/clk-exynos5420.c | 4 ++++
drivers/clk/tegra/clk-bpmp.c | 14 +++++++-------
drivers/clk/tenstorrent/atlantis-prcm.c | 9 +++++----
10 files changed, 40 insertions(+), 17 deletions(-)
--
2.56.1.750.gf70dc682cf-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 08/10] clk: tenstorrent: Poll atomically in atlantis_clk_pll_enable()
2026-11-23 16:47 [PATCH 00/10] clk: Assorted bug fixes across clock core and drivers Lee Jones
@ 2026-11-23 16:47 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2026-11-23 16:47 UTC (permalink / raw)
To: lee, Drew Fustini, Joel Stanley, Anirudh Srinivasan, Stephen Boyd,
Brian Masney, Jerome Brunet, linux-riscv, linux-clk, linux-kernel
Cc: stable
The Common Clock Framework invokes .enable callbacks in atomic context
with interrupts disabled and enable_lock held. In atlantis_clk_pll_ops,
atlantis_clk_pll_enable() is registered as the .enable callback yet
waits for PLL lock using regmap_read_poll_timeout() with a 500 us sleep
interval, triggering a sleep-in-atomic bug via usleep_range().
Since the PRCM regmap is backed by MMIO, use
regmap_read_poll_timeout_atomic() instead.
Fixes: 23c8ebc95284 ("clk: tenstorrent: Add Atlantis clock controller driver")
Closes: https://sashiko.dev/#/bug/linux-980395a6-f282-478a-bf18-b5695a725735
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/clk/tenstorrent/atlantis-prcm.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/tenstorrent/atlantis-prcm.c b/drivers/clk/tenstorrent/atlantis-prcm.c
index eccc8015da23..d9155f133713 100644
--- a/drivers/clk/tenstorrent/atlantis-prcm.c
+++ b/drivers/clk/tenstorrent/atlantis-prcm.c
@@ -313,10 +313,11 @@ static int atlantis_clk_pll_enable(struct clk_hw *hw)
PLL_CFG_EN_BIT, PLL_CFG_EN_BIT);
/* Step 3: Wait for PLL lock */
- ret = regmap_read_poll_timeout(pll->common.regmap,
- pll->config.reg_offset, val,
- val & PLL_CFG_LOCK_BIT,
- PLL_BYPASS_WAIT_US, PLL_LOCK_TIMEOUT_US);
+ ret = regmap_read_poll_timeout_atomic(pll->common.regmap,
+ pll->config.reg_offset, val,
+ val & PLL_CFG_LOCK_BIT,
+ PLL_BYPASS_WAIT_US,
+ PLL_LOCK_TIMEOUT_US);
if (ret) {
pr_err("PLL failed to lock within timeout\n");
return ret;
--
2.56.1.750.gf70dc682cf-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-23 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 16:47 [PATCH 00/10] clk: Assorted bug fixes across clock core and drivers Lee Jones
2026-11-23 16:47 ` [PATCH 08/10] clk: tenstorrent: Poll atomically in atlantis_clk_pll_enable() Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox