]> asedeno.scripts.mit.edu Git - linux.git/commit
clk: rockchip: Set "ignore unused" for PMU M0 clocks on rk3399
authorDouglas Anderson <dianders@chromium.org>
Tue, 14 Feb 2017 21:01:14 +0000 (13:01 -0800)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 6 Mar 2017 03:45:45 +0000 (04:45 +0100)
commit60aadea57ed98e734a7e9edb3076b5a72eff0b0d
treed230e2ac9c02ca0af8de685fd64ad08b1c97f151
parentc1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201
clk: rockchip: Set "ignore unused" for PMU M0 clocks on rk3399

The PMU Cortex M0 on rk3399 is intended to be used for things like
DDRFreq transitions, suspend/resume, and other things that are the
purview of ARM Trusted Firmware and not the kernel.  As such, the
kernel shouldn't be messing with the clocks.  Add CLK_IGNORE_UNUSED to
these clocks.

Without this change, the following was observed on a Chromebook with a
rk3399 (using not-yet-upstream ARM Trusted Firmware code and
not-yet-upstream kernel code based on kernel-4.4):

1. We init the clock framework.

2. We start up "DDRFreq", which causes ATF to occasionally fire up the
   M0 for transitions.  Each time ATF fires up the M0 it will turn on
   these clocks and each time it is done it will turn them off.

3. We finally get to the the part of the kernel that calls
   clk_disable_unused() and we disables the clocks.

You can see the race above.  Basically everything is fine as long as
ARM Trusted Firmware isn't starting up the M0 at exactly the same time
that the kernel is disabling unused clocks.  ...but if the race
happens then we go boom.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/clk/rockchip/clk-rk3399.c