From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756866Ab2DXRby (ORCPT ); Tue, 24 Apr 2012 13:31:54 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:37084 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755811Ab2DXRbx (ORCPT ); Tue, 24 Apr 2012 13:31:53 -0400 Message-ID: <1335288711.2347.20.camel@lorien2> Subject: Re: [PATCH v2] leds: heartbeat: stop on shutdown From: Shuah Khan Reply-To: shuahkhan@gmail.com To: Alexander Holler Cc: shuahkhan@gmail.com, linux-kernel@vger.kernel.org, Richard Purdie , Andrew Morton Date: Tue, 24 Apr 2012 11:31:51 -0600 In-Reply-To: <4F96E26C.3060302@ahsoftware.de> References: <1335275034-22135-1-git-send-email-holler@ahsoftware.de> <1335280022-16308-1-git-send-email-holler@ahsoftware.de> <1335281074.2347.4.camel@lorien2> <4F96D58A.3070008@ahsoftware.de> <1335286810.2347.18.camel@lorien2> <4F96E26C.3060302@ahsoftware.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >>>> --- > >>>> 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 > >>>> #include > >>>> #include > >>>> +#include > >>>> #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() > > I still wonder why the timers are running after a kernel halted (so the > heardbeat was still alive), but there might be a good reason not just to > disable all running timers unconditionally on shutdown. > > Regards, > > Alexander > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >