public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: shuahkhan@gmail.com
Cc: linux-kernel@vger.kernel.org, Richard Purdie <rpurdie@rpsys.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] leds: heartbeat: stop on shutdown
Date: Tue, 24 Apr 2012 19:34:20 +0200	[thread overview]
Message-ID: <4F96E41C.6030309@ahsoftware.de> (raw)
In-Reply-To: <1335288711.2347.20.camel@lorien2>

Am 24.04.2012 19:31, schrieb Shuah Khan:
> On Tue, 2012-04-24 at 19:27 +0200, Alexander Holler wrote:
>> Am 24.04.2012 19:00, schrieb Shuah Khan:
>>> On Tue, 2012-04-24 at 18:32 +0200, Alexander Holler wrote:
>>>> Am 24.04.2012 17:24, schrieb Shuah Khan:
>>>>> On Tue, 2012-04-24 at 17:07 +0200, Alexander Holler wrote:
>>>>>> A halted kernel should not show a heartbeat.
>>>>>>
>>>>>> Signed-off-by: Alexander Holler <holler@ahsoftware.de>
>>>>>> ---
>>>>>>  drivers/leds/ledtrig-heartbeat.c |   18 +++++++++++++++++-
>>>>>>  1 files changed, 17 insertions(+), 1 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
>>>>>> index 759c0bb..1c05bd9 100644
>>>>>> --- a/drivers/leds/ledtrig-heartbeat.c
>>>>>> +++ b/drivers/leds/ledtrig-heartbeat.c
>>>>>> @@ -18,6 +18,7 @@
>>>>>>  #include <linux/timer.h>
>>>>>>  #include <linux/sched.h>
>>>>>>  #include <linux/leds.h>
>>>>>> +#include <linux/reboot.h>
>>>>>>  #include "leds.h"
>>>>>>  
>>>>>>  struct heartbeat_trig_data {
>>>>>> @@ -101,13 +102,28 @@ static struct led_trigger heartbeat_led_trigger = {
>>>>>>  	.deactivate = heartbeat_trig_deactivate,
>>>>>>  };
>>>>>>  
>>>>>> +static int heartbeat_reboot_notifier(struct notifier_block *nb,
>>>>>> +				     unsigned long code, void *unused)
>>>>>> +{
>>>>>> +	led_trigger_unregister(&heartbeat_led_trigger);
>>>>>> +	return NOTIFY_DONE;
>>>>>> +}
>>> I am sorry I didn't catch this the last time. Do you need to call
>>> unregister here? Looks like trigger is going away with a registered
>>> reboot notifier. Might be fine, since reboot is going to happen.
>>
>> That unregister is the whole reason of the patch because it disables all
>> running heartbeats on reboot/shutdown. ;)
> 
> Sorry I should have been clear about which unregister. I meant
> unregister_reboot_notifier()

That is needed in case the module will be unloaded.

Regards,

Alexander

  reply	other threads:[~2012-04-24 17:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 13:43 [PATCH] leds: heartbeat: stop on shutdown Alexander Holler
2012-04-24 15:07 ` [PATCH v2] " Alexander Holler
2012-04-24 15:24   ` Shuah Khan
2012-04-24 16:32     ` Alexander Holler
2012-04-24 17:00       ` Shuah Khan
2012-04-24 17:27         ` Alexander Holler
2012-04-24 17:31           ` Shuah Khan
2012-04-24 17:34             ` Alexander Holler [this message]
2012-04-24 22:30   ` [PATCH v3] leds: heartbeat: stop on shutdown, reboot or panic Alexander Holler
2012-04-24 22:38     ` [PATCH v4] " Alexander Holler

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=4F96E41C.6030309@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=shuahkhan@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox