• Joachim Eastwood's avatar
    clk: lpc18xx-cgu: fix potential system hang when disabling unused clocks · c23a5847
    Joachim Eastwood authored
    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: default avatarJoachim Eastwood <manabian@gmail.com>
    Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
    c23a5847
clk-lpc18xx-cgu.c 18.6 KB