Re: [PATCH] clk: clk_register: Correctly initialize enable_count

From: Rhyland Klein
Date: Thu Feb 11 2016 - 16:58:23 EST


On 2/11/2016 4:32 PM, Michael Turquette wrote:
> Quoting Rhyland Klein (2016-02-10 10:34:16)
>> On 2/9/2016 9:56 PM, Emilio LÃpez wrote:
>>> Hi,
>>>
>>> El 09/02/16 a las 19:48, Rhyland Klein escribiÃ:
>>>> When clocks are registered, they could be enabled already in
>>>> hardware. As of now, the enable count will start at 0. When this
>>>> happens, it means a clock is enabled and the framework doesn't know
>>>> that, so it will always report it as disabled.
...
>
> clk_disable_unused() handles the case where spurious clocks were left
> enabled by the bootloader and need to be gated. This sounds like the
> only thing you were after.
>
> We also have a case where clocks are gated by clk_disable_unused()
> because no driver has claimed them yet, but we really want those clocks
> to be left enabled. For example, clocks supplying DDR & CPU shouldn't be
> cut, ever. Alternatively, your bootloader put something on the display
> but your display controller module hasn't loaded yet. Cutting the clock
> isn't fatal but causes unnecessary screen flicker because the module has
> not loaded up.
>
> To solve those sets of problems there is the critical clocks and handoff
> clocks thread[0].
>
> [0] http://lkml.kernel.org/r/<1455225554-13267-1-git-send-email-mturquette@xxxxxxxxxxxx>
>
> Best regards,
> Mike
>

Thanks. I agree the clk_disable_unused should clear up the situation I
was in. And the critical clocks and handoff logic should be useful. I am
sure we can make use of it once its in for Tegra support.

-rhyland

--
nvpublic