Re: [PATCH 7/8] kernel/power/main.c: Not suspend/resume if CPU0 isofflined

From: Srivatsa S. Bhat
Date: Wed Oct 05 2011 - 14:37:39 EST


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@xxxxxxxxxxxxxxxxxx>
Linux Technology Center,
IBM India Systems and Technology Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/