Messages in this thread |  | | | Date | Thu, 06 Oct 2011 00:07:30 +0530 | | From | "Srivatsa S. Bhat" <> | | Subject | Re: [PATCH 7/8] kernel/power/main.c: Not suspend/resume if CPU0 is offlined |
| |
Hi,
On 10/05/2011 10:09 PM, Fenghua Yu wrote: > > @@ -178,6 +179,14 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, > int len; > int error = -EINVAL; > > +#ifdef CONFIG_HOTPLUG_CPU > + if (bsp_hotpluggable && cpumask_first(cpu_online_mask) != 0) { > + printk(KERN_WARNING "Because CPU0 is offlined, system can't suspend/resume.\n"); > + > + return -ENODEV; > + } > +#endif
There is a possible race condition here. What if CPU0 gets offlined AFTER this point(due to a CPU hotplug operation)? We will probably have to prevent CPU0 from being taken offline from this point onwards, and remove that restriction later on.
> + > p = memchr(buf, '\n', n); > len = p ? p - buf : n; >
-- Regards, Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Linux Technology Center, IBM India Systems and Technology Lab
|  |