[PATCH v2 1/2] ARM: topology: Use a clock if possible to get the CPU frequency
From: Maxime Ripard <hidden>
Date: 2014-06-30 14:01:46
Also in:
linux-devicetree
On Mon, Jun 30, 2014 at 03:27:21PM +0200, Vincent Guittot wrote:
quoted
quoted
quoted
quoted
- rate = of_get_property(cn, "clock-frequency", &len); - if (!rate || len != 4) { - pr_err("%s missing clock-frequency property\n", - cn->full_name); + clk = of_clk_get(cn, 0); + if (!IS_ERR(clk)) + rate = clk_get_rate(clk);We need the max frequency as it will be used to weight the different CPUs capacity. How do you ensure that the current clock rate is the max one ?Hmm, the clock-frequency attribute in the ePAPR is defined at the current CPU frequency, not the max one.What means current frequency in device tree when DVFS is involved ?
The ePAPR states that clock-frequency is supposed to be "the current clock speed of the CPU in Hertz". It's exactly what my patch add. Now, you're right, DVFS would be an issue here with clock-frequency, but this patch actually makes it easier to deal with, since you only get a reference to a clock, and you can get its rate at any given time. Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140630/3955e656/attachment.sig>