]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
clk: lpc18xx-cgu: fix potential system hang when disabling unused clocks
authorJoachim Eastwood <manabian@gmail.com>
Sat, 24 Oct 2015 16:55:24 +0000 (18:55 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Mon, 26 Oct 2015 19:36:58 +0000 (12:36 -0700)
commitc23a5847695dbda865fdb032a25b7f95a1438042
treefc5370c5fb1d4b89fe178addfcfc89fad5edc3ed
parent2a9a06f98f26654d3b07482319ea0be276689f0b
clk: lpc18xx-cgu: fix potential system hang when disabling unused clocks

The clock consumer (CCU) of the CGU must be able to check if a CGU
base clock is really running since access to the CCU registers
requires a running base clock. Access with a disabled base clock will
cause the system to hang. Fix this issue by adding code that check if
the parent clock is running in the is_enabled clk_ops callback. Since
certain clocks can be cascaded this must be added to all clock gates.

The hang would occur if the boot ROM or boot loader didn't setup and
enable the USB0 clock. Then when the clk framework tried to access
the CCU register it would hang the system.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/nxp/clk-lpc18xx-cgu.c