clk: en7523: do not sleep in the EN7581 PCIe clock disable
Subsystems (2)
PATCH v2 1/1 clk: en7523: do not sleep in the EN7581 PCIe clock disable
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.
---
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/[email protected]
drivers/clk/clk-en7523.c | 1 - 1 file changed, 1 deletion(-)
drivers/clk/clk-en7523.c +0 -1
@@ -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
Signature · 1 line
2.34.1
Quoted 7 lines
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 withusleep_range(). Every boot where no consumer holds the clock reports "BUG: scheduling while atomic" fromclk_disable_unused(), and so does the unwind of a PCIe probe that finds no link.
Quoted 7 lines
Drop the sleep. Commit
90d4e466c9ea("PCI: mediatek-gen3: Move reset delay inmtk_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 <[email protected]>
Quoted 26 lines
---
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/[email protected]drivers/clk/clk-en7523.c | 1 - 1 file changed, 1 deletion(-)drivers/clk/clk-en7523.c +0
-1@@ -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:
ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426bSignature · 1 line
2.34.1
Brian Masney
AppliedQuoted 1 line · John Crispin
clk: en7523: do not sleep in the EN7581 PCIe clock disable
Applied, thanks!
[1/1] clk: en7523: do not sleep in the EN7581 PCIe clock disable
https://git.kernel.org/clk/linux/c/1346c1f94294
Best regards,
Signature · 1 line
Brian Masney <[email protected]>