Thread (22 messages) 22 messages, 2 authors, 2014-02-27

Re: [PATCH 09/10] cpuidle: declare cpuidle_dev in cpuidle.h

From: Paul Burton <hidden>
Date: 2014-02-20 13:41:22
Also in: linux-pm

On Thu, Feb 20, 2014 at 02:35:18PM +0100, Daniel Lezcano wrote:
On 01/15/2014 02:55 PM, Paul Burton wrote:
quoted
Declaring this allows drivers which need to initialise each struct
cpuidle_device at initialisation time to make use of the structures
already defined in cpuidle.c, rather than having to wastefully define
their own.

Signed-off-by: Paul Burton <redacted>
Cc: Rafael J. Wysocki <redacted>
Cc: Daniel Lezcano <redacted>
Cc: linux-pm@vger.kernel.org
---
 include/linux/cpuidle.h | 1 +
 1 file changed, 1 insertion(+)
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 50fcbb0..bab4f33 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -84,6 +84,7 @@ struct cpuidle_device {
 };

 DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
+DECLARE_PER_CPU(struct cpuidle_device, cpuidle_dev);

Nak. When a device is registered, it is assigned to the cpuidle_devices
pointer and the backend driver should use it.
Yes, but then if the driver needs to initialise the coupled_cpus mask
then it cannot do so until after the device has been registered. During
registration the cpuidle_coupled_register_device will then see the empty
coupled_cpus mask & do nothing. The only other ways around this would be
for the driver to define its own per-cpu struct cpuidle_device (which as
I state in the commit message seems wasteful when cpuidle already
defined them), or for cpuidle_coupled_register_device to be called later
after the driver had a chance to modify devices via the cpuidle_devices
pointers.

Paul

-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help