diff options
author | Adam Ford <aford173@gmail.com> | 2021-03-13 13:28:17 +0100 |
---|---|---|
committer | Abel Vesa <abel.vesa@nxp.com> | 2021-04-04 21:39:04 +0200 |
commit | 379c9a24cc239000b1dec53db02fe17a86947423 (patch) | |
tree | 7333df87f9a15cda785293506eef7a8f5067d763 /drivers/clk/imx/clk.h | |
parent | Linux 5.12-rc2 (diff) | |
download | linux-379c9a24cc239000b1dec53db02fe17a86947423.tar.xz linux-379c9a24cc239000b1dec53db02fe17a86947423.zip |
clk: imx: Fix reparenting of UARTs not associated with stdout
Most if not all i.MX SoC's call a function which enables all UARTS.
This is a problem for users who need to re-parent the clock source,
because any attempt to change the parent results in an busy error
due to the fact that the clocks have been enabled already.
clk: failed to reparent uart1 to sys_pll1_80m: -16
Instead of pre-initializing all UARTS, scan the device tree to see
which UART clocks are associated to stdout, and only enable those
UART clocks if it's needed early. This will move initialization of
the remaining clocks until after the parenting of the clocks.
When the clocks are shutdown, this mechanism will also disable any
clocks that were pre-initialized.
Fixes: 9461f7b33d11c ("clk: fix CLK_SET_RATE_GATE with clock rate protection")
Suggested-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Diffstat (limited to 'drivers/clk/imx/clk.h')
-rw-r--r-- | drivers/clk/imx/clk.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 4f04c8287286..7571603bee23 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -11,9 +11,9 @@ extern spinlock_t imx_ccm_lock; void imx_check_clocks(struct clk *clks[], unsigned int count); void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count); #ifndef MODULE -void imx_register_uart_clocks(struct clk ** const clks[]); +void imx_register_uart_clocks(unsigned int clk_count); #else -static inline void imx_register_uart_clocks(struct clk ** const clks[]) +static inline void imx_register_uart_clocks(unsigned int clk_count) { } #endif |