All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: Sebastian Capella <sebastian.capella@linaro.org>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Len Brown" <len.brown@intel.com>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Jonathan Austin" <jonathan.austin@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Victor Kamensky" <victor.kamensky@linaro.org>,
	"Will Deacon" <will.deacon@arm.com>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>,
	"Sricharan R" <r.sricharan@ti.com>,
	"Santosh Shilimkar" <santosh.shilimkar@ti.com>,
	"Ben Dooks" <ben.dooks@codethink.co.uk>,
	"Russ Dill" <Russ.Dill@ti.com>, "Nicolas Pitre" <nico@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Laura Abbott" <lauraa@codeaurora.org>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Stephen Boyd" <sboyd@codeaurora.org>
Subject: Re: [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

WARNING: multiple messages have this Message-ID (diff)
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

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Holler <holler@ahsoftware.de>
To: Sebastian Capella <sebastian.capella@linaro.org>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Len Brown" <len.brown@intel.com>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Jonathan Austin" <jonathan.austin@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Victor Kamensky" <victor.kamensky@linaro.org>,
	"Will Deacon" <will.deacon@arm.com>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>,
	"Sricharan R" <r.sricharan@ti.com>,
	"Santosh Shilimkar" <santosh.shilimkar@ti.com>,
	"Ben Dooks" <ben.dooks@codethink.co.uk>,
	"Russ Dill" <Russ.Dill@ti.com>, "Nicolas Pitre" <nico@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Laura Abbott" <lauraa@codeaurora.org>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Stephen Boyd" <sboyd@codeaurora.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Jiang Liu" <liuj97@gmail.com>
Subject: Re: [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:39 UTC|newest]

Thread overview: 86+ 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 ` Sebastian Capella
2014-03-05 10:50 ` [PATCH v7 1/2] ARM: avoid tracers in soft_restart Sebastian Capella
2014-03-05 10:50   ` Sebastian Capella
2014-03-06 23:45   ` Sebastian Capella
2014-03-06 23:45     ` Sebastian Capella
2014-03-06 23:45     ` Sebastian Capella
2014-03-19 23:26     ` 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-05 10:50   ` Sebastian Capella
2014-03-07  4:21   ` Sebastian Capella
2014-03-07  4:21     ` Sebastian Capella
2014-03-07  4:21     ` Sebastian Capella
2014-03-07  4:42   ` Stephen Boyd
2014-03-07  4:42     ` Stephen Boyd
2014-03-10 18:32     ` Sebastian Capella
2014-03-10 18:32       ` Sebastian Capella
2014-03-10 18:32       ` Sebastian Capella
2014-03-16  9:46       ` Russell King - ARM Linux
2014-03-16  9:46         ` Russell King - ARM Linux
2014-03-16  9:46         ` Russell King - ARM Linux
2014-03-17 22:07         ` Sebastian Capella
2014-03-17 22:07           ` Sebastian Capella
2014-03-17 22:07           ` Sebastian Capella
2014-03-16  7:09   ` Ezequiel Garcia
2014-03-16  7:09     ` Ezequiel Garcia
2014-03-16  7:09     ` Ezequiel Garcia
2014-03-17 19:10     ` Sebastian Capella
2014-03-17 19:10       ` Sebastian Capella
2014-03-17 19:10       ` Sebastian Capella
2014-03-17 20:44       ` Ezequiel Garcia
2014-03-17 20:44         ` Ezequiel Garcia
2014-03-17 20:44         ` Ezequiel Garcia
2014-03-17 22:39         ` Sebastian Capella
2014-03-17 22:39           ` Sebastian Capella
2014-03-17 22:39           ` Sebastian Capella
2014-03-19 15:44           ` Ezequiel Garcia
2014-03-19 15:44             ` Ezequiel Garcia
2014-03-19 15:44             ` Ezequiel Garcia
2014-03-19 20:47             ` Sebastian Capella
2014-03-19 20:47               ` Sebastian Capella
2014-03-19 20:47               ` Sebastian Capella
2014-03-19 21:06               ` Sebastian Capella
2014-03-19 21:06                 ` Sebastian Capella
2014-03-19 21:06                 ` Sebastian Capella
2014-03-24 18:06                 ` Sebastian Capella
2014-03-24 18:06                   ` Sebastian Capella
2014-03-24 18:06                   ` Sebastian Capella
2014-03-25 18:38                 ` Alexander Holler [this message]
2014-03-25 18:38                   ` Alexander Holler
2014-03-25 18:38                   ` Alexander Holler
2014-03-25 18:48                   ` Sebastian Capella
2014-03-25 18:48                     ` Sebastian Capella
2014-03-25 18:48                     ` Sebastian Capella
2014-03-25 23:36                   ` Alexander Holler
2014-03-25 23:36                     ` Alexander Holler
2014-03-25 23:36                     ` Alexander Holler
2014-03-26  0:00                     ` Alexander Holler
2014-03-26  0:00                       ` Alexander Holler
2014-03-26  0:00                       ` Alexander Holler
2014-03-20  3:02             ` TonyHo
2014-03-20  3:02               ` TonyHo
2014-03-20 17:26               ` Sebastian Capella
2014-03-20 17:26                 ` Sebastian Capella
2014-03-20 17:26                 ` Sebastian Capella
2014-04-16 10:12   ` Russell King - ARM Linux
2014-04-16 10:12     ` Russell King - ARM Linux
2014-04-16 16:42     ` Sebastian Capella
2014-04-16 16:42       ` Sebastian Capella
2014-04-16 16:42       ` Sebastian Capella
2014-04-17 20:38       ` Sebastian Capella
2014-04-17 20:38         ` Sebastian Capella
2014-04-17 20:38         ` Sebastian Capella
2014-04-23  0:38         ` Sebastian Capella
2014-04-23  0:38           ` Sebastian Capella
2014-04-23  0:38           ` Sebastian Capella
2014-04-23 16:39           ` Sebastian Capella
2014-04-23 16:39             ` Sebastian Capella
2014-04-23 16:39             ` Sebastian Capella
2014-05-07 15:37             ` Pavel Machek
2014-05-07 15:37               ` Pavel Machek
2014-05-07 15:37               ` Pavel Machek
2014-05-07 22:20               ` Sebastian Capella
2014-05-07 22:20                 ` Sebastian Capella
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=Russ.Dill@ti.com \
    --cc=ben.dooks@codethink.co.uk \
    --cc=catalin.marinas@arm.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=jonathan.austin@arm.com \
    --cc=lauraa@codeaurora.org \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nico@linaro.org \
    --cc=r.sricharan@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=santosh.shilimkar@ti.com \
    --cc=sboyd@codeaurora.org \
    --cc=sebastian.capella@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=victor.kamensky@linaro.org \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.