Thread (23 messages) 23 messages, 6 authors, 2015-03-16

[RFC PATCH v15 01/11] ARM: cpuidle: Register per cpuidle device

From: Andy Gross <hidden>
Date: 2015-03-09 22:04:42
Also in: linux-arm-msm, linux-devicetree, linux-pm

On Mon, Mar 09, 2015 at 03:40:06PM -0600, Lina Iyer wrote:
<snip>
quoted
quoted
	for_each_possible_cpu(cpu) {
+
		ret = arm_cpuidle_init(cpu);
+		/*
+		 * This cpu does not support any idle states
+		 */
+		if (ret == -ENOSYS)
+			continue;
+
		if (ret) {
			pr_err("CPU %d failed to init idle CPU ops\n", cpu);
			return ret;
		}
+
+		dev = kzalloc(sizeof(*dev), GFP_KERNEL);
devm_kzalloc?  Otherwise, failures could lead to lost memory.
I dont have a local device to work with for allocation. May be I can get
the cpu device node and the device therefore for allocation. Thoughts?
Ah, well the cpu device node could be used.  My only concern is that dev cannot
be referenced after the cpu is removed.
quoted
quoted
+		if (!dev)
+			return -ENOMEM;
+
+		dev->cpu = cpu;
+		ret = cpuidle_register_device(dev);
+		if (ret) {
+			pr_err("Failed to register cpuidle device for CPU %d\n",
+			       cpu);
<snip>

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help