From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Turquette Subject: Re: [PATCH] clk: mediatek: Export CPU mux clocks for CPU frequency control Date: Tue, 10 Mar 2015 16:59:12 -0700 Message-ID: <20150310235912.14952.99786@quantum> References: <1425466152-7867-1-git-send-email-pi-cheng.chen@linaro.org> <20150304112109.GB11010@pengutronix.de> <20150305074207.GC11010@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Viresh Kumar , Sascha Hauer Cc: Pi-Cheng Chen , Stephen Boyd , Matthias Brugger , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Henry Chen , James Liao , Chen Fan , Eddie Huang , "Joe.C" , Linux Kernel Mailing List , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linaro Kernel Mailman List , linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org Quoting Viresh Kumar (2015-03-05 00:59:50) > On 5 March 2015 at 13:12, Sascha Hauer wrote: > > We have clk_set_parent for changing the parent and clk_set_rate to > > change the rate. Use the former for changing the parent and the latter > > for changing the rate. What you are interested in is changing the > > parent, so use clk_set_parent for this and not abuse a side effect > > of clk_set_rate. > > clk_set_rate() for CPUs clock is responsible to change clock rate > of the CPU. Whether it plays with PLLs or muxes, its not that relevant. Agreed. > > > My suggestion is to take another approach. Implement clk_set_rate for > > these muxes and in the set_rate hook: > > > > - switch mux to intermediate PLL parent > > - call clk_set_rate() for the real parent PLL > > - switch mux back to real parent PLL > > > > This way the things happening behind the scenes are completely transparent > > to the cpufreq driver and you can use cpufreq-dt as is without changes. > > CPUFreq wants to change to intermediate frequency by itself against > some magic change behind the scene. The major requirement for that > comes from the fact that we want to send PRE/POST freq notifiers on > which loops-per-jiffie depends. I assume you are saying that you want to update loops-per-jiffie while at an intermediate frequency. Why? This operation should not take very long. Imagine a (hypothetical?) processor that changes frequency in many small steps until it converges to the target rate. Would you want to update lpj for every step? Regards, Mike -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html