Skip to content
Commit 379c9a24 authored by Adam Ford's avatar Adam Ford Committed by Abel Vesa
Browse files

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: 9461f7b3

 ("clk: fix CLK_SET_RATE_GATE with clock rate protection")
Suggested-by: default avatarAisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
Reviewed-by: default avatarAbel Vesa <abel.vesa@nxp.com>
Tested-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: default avatarAbel Vesa <abel.vesa@nxp.com>
parent a38fd874
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment