Re: [PATCH RFC] PM / Hibernate: no kernel_power_off when pm_power_off NULL

From: Sebastian Capella
Date: Wed Mar 26 2014 - 13:23:55 EST


> On 20 March 2014 14:35, One Thousand Gnomes <gnomes@xxxxxxxxxxxxxxxxxxx> wrote:
>>> if (pm_power_off)
>>> pm_power_off();
>>> ## It really should do while (1) here.
>> while(1)
>> cpu_relax();
>> or similar at minimum.

Hi Alan, Pavel,

I prepared the changes suggested for ARM, but Russell disagrees that
this code must block, and points to the kernel/reboot.c function from
which I'd taken the original change.

> On Mar 26, Russell King - ARM Linux wrote:
>> I don't see why we should make this change. kernel/reboot.c handles
>> this function returning, so other places should do too.
>> Even on x86, this function can return:
>>
>> Therefore, I'd say... it's a bug in the hibernation code - or we probably
>> have many buggy architectures. I'd suggest fixing the hibernation code
>> rather than stuffing some workaround like an endless loop into every
>> architecture.

In this case, the hibernation code would need to changed prevent
calling both sets of notifiers.

The discussions are very short, but the details are here:

https://lkml.org/lkml/2014/3/25/554 -- linux-arm discussion
https://lkml.org/lkml/2014/3/20/649 -- linux-pm discussion

It doesn't appear definitive that the machine_power_off should block,
since the reboot call is working around the possibility.

If we go the route Russell proposes, the change would basically be
this patch. Are you ok with me trying to adjust the hibernation
handling here? Do you have any further thoughts on this?

Thanks!

Sebastian
--
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/