linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: holler@ahsoftware.de (Alexander Holler)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 2/2] ARM hibernation / suspend-to-disk
Date: Tue, 25 Mar 2014 19:38:59 +0100	[thread overview]
Message-ID: <5331CD43.1010601@ahsoftware.de> (raw)
In-Reply-To: <CADHgK6vkwjXyJxRcOXjJpJJaR0-YR869NpPZ+CBBS8kEdE0qCQ@mail.gmail.com>

Am 19.03.2014 22:06, schrieb Sebastian Capella:
> On 19 March 2014 13:47, Sebastian Capella <sebastian.capella@linaro.org> wrote:
>> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
>> index a5f702a..d96b910 100644
>> --- a/kernel/power/hibernate.c
>> +++ b/kernel/power/hibernate.c
>> @@ -594,7 +594,8 @@ static void power_down(void)
>>          case HIBERNATION_PLATFORM:
>>                  hibernation_platform_enter();
>>          case HIBERNATION_SHUTDOWN:
>> -               kernel_power_off();
>> +               if (pm_power_off)
>> +                       kernel_power_off();
>>                  break;
>>   #ifdef CONFIG_SUSPEND
>>          case HIBERNATION_SUSPEND:
>>
>>
>> This follows the behavior in the reboot syscall which does it this way
>> also.  I'm testing this now, and it seems work fine.  If this looks
>> good, I can add it as an additional patch.
>
> BTW, one thing I would point out is that kernel_power_off and
> kernel_halt call the same notifier but with different parameters
> (SYS_POWER_OFF and SYS_HALT).
>
> If pm_power_down is null, I dont see why we'd want to notify
> SYS_POWER_OFF before SYS_HALT.  With the previous change I'm assuming
> there's no benefit, so please chime in if you know a reason.

Both states, power off and sys halt, do sound pretty final and I would 
assume something is broken, if power off is called before sys halt or 
vice versa. At least I would never expect that the 
reboot/poweroff/syshalt notifier may be called twice (and thats why the 
heartbeat-trigger may crash).

But just in case, changing that behaviour in ledtrig-heartbeat.c would 
be pretty easy, just remove the heartbeat_reboot_notifier (which plays 
nice and deregisters the trigger on reboot) and use the panic_notifier 
(which doesn't unregister the trigger but just turns off the led) for 
reboot too. Another solution would be to unregister the reboot_notifier 
in the reboot_nofifier itself. I've just seen one watchdog driver 
(drivers/rtc/rtc-m41t80.c) which does that. But I still think such 
shouldn't be necessary (and I haven't had a look at other 
reboot_notifier users).


Regards,

Alexander Holler

  parent reply	other threads:[~2014-03-25 18:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 10:50 [PATCH v7 0/2] hibernation support on ARM Sebastian Capella
2014-03-05 10:50 ` [PATCH v7 1/2] ARM: avoid tracers in soft_restart Sebastian Capella
2014-03-06 23:45   ` Sebastian Capella
2014-03-19 23:26     ` Sebastian Capella
2014-03-05 10:50 ` [PATCH v7 2/2] ARM hibernation / suspend-to-disk Sebastian Capella
2014-03-07  4:21   ` Sebastian Capella
2014-03-07  4:42   ` Stephen Boyd
2014-03-10 18:32     ` Sebastian Capella
2014-03-16  9:46       ` Russell King - ARM Linux
2014-03-17 22:07         ` Sebastian Capella
2014-03-16  7:09   ` Ezequiel Garcia
2014-03-17 19:10     ` Sebastian Capella
2014-03-17 20:44       ` Ezequiel Garcia
2014-03-17 22:39         ` Sebastian Capella
2014-03-19 15:44           ` Ezequiel Garcia
2014-03-19 20:47             ` Sebastian Capella
2014-03-19 21:06               ` Sebastian Capella
2014-03-24 18:06                 ` Sebastian Capella
2014-03-25 18:38                 ` Alexander Holler [this message]
2014-03-25 18:48                   ` Sebastian Capella
2014-03-25 23:36                   ` Alexander Holler
2014-03-26  0:00                     ` Alexander Holler
2014-03-20  3:02             ` TonyHo
2014-03-20 17:26               ` Sebastian Capella
2014-04-16 10:12   ` Russell King - ARM Linux
2014-04-16 16:42     ` Sebastian Capella
2014-04-17 20:38       ` Sebastian Capella
2014-04-23  0:38         ` Sebastian Capella
2014-04-23 16:39           ` Sebastian Capella
2014-05-07 15:37             ` Pavel Machek
2014-05-07 22:20               ` Sebastian Capella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5331CD43.1010601@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).