Linux Kernel - Clock Framework - What is clk_prepare / unprepare?

I am reading the following article about the new clock structure present in the Linux kernel.

http://lwn.net/Articles/489668/

  • What I don’t understand is the use of the new clk_prepare / unprepare API , which complements the clk_enable / disable API.
  • It is also mentioned that although the clk_enable / disable API can be called from an atomic context, this does not apply to clk_prepare / unprepare (which can sleep). Why is there such a separation of functionality and behavior?
  • I really want to understand what is it about the watches that we need to prepare / not prepare them?

Thanks,

~ Vj

+4
source share
1 answer

For the clock, it may be necessary to set and lock the PLL, set the voltage of the OPP, or other preliminary steps before clk_enable. For example: drivers / clk / clk-highbank.c clk_pll_prepare ()

This procedure has wait loops that rotate until the hardware PLL locks. Cannot do this from the atomic context. Another LWN article talks a bit about the separation of prepare () vs enable ().

PLL and watch details relate to the processor / SoC in question. The block diagrams show the synchronization tree of SoC input pins leading to different PLLs, and then different clock pulses output from each PLL (can also have power domains that can be turned on / off), and the clock individually turns on after the "preparation" is completed. A long story, but I hope this can be useful.

+5
source

Source: https://habr.com/ru/post/1487729/


All Articles