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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 09, 2015 at 03:40:06PM -0600, Lina Iyer wrote:
<snip>

> >> 	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.

> >>+		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

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux