Quoting Karicheri, Muralidharan (2012-09-14 09:25:40) > Hi Mike, > > > > During my common clock migration work for DaVinci, I got a problem in davinci > mdio driver that calls the clk_enable() through run time power management API > and got following WARNING in drivers/clk/clk.c. Could you help me understand > how clk_prepare() gets called in this scenario and what I need to take are to > have this work for common clock framework? >
<snip> > WARNING: at drivers/clk/clk.c:512 __clk_enable+0x98/0xa4() > Hi Murali, That warning is tripped because clk->prepare_count is 0 and you're calling clk_enable, which is bad. clk_prepare must be called (and complete) before calling clk_enable. For most platforms clk_prepare is a no-op, but for correctness sake your driver (or PM runtime callbacks) must call clk_prepare first. This is why the new clk_prepare_enable call has become popular. Note that clk_prepare may sleep, so don't call it from interrupt context. See the kerneldoc in include/linux/clk.h and also Documentation/clk.txt for more details and let me know if you need further explanation. Regards, Mike _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
