linux-mainline 3.2: shut down heartbeat LED on halt/reboot/panic
authorKoen Kooi <koen@dominion.thruhere.net>
Thu, 10 May 2012 08:53:45 +0000 (10:53 +0200)
committerDenys Dmytriyenko <denys@ti.com>
Thu, 10 May 2012 19:30:43 +0000 (15:30 -0400)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
recipes-kernel/linux/linux-mainline-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch [new file with mode: 0644]
recipes-kernel/linux/linux-mainline_3.2.bb

diff --git a/recipes-kernel/linux/linux-mainline-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch b/recipes-kernel/linux/linux-mainline-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch
new file mode 100644 (file)
index 0000000..241907e
--- /dev/null
@@ -0,0 +1,67 @@
+From d4369481800faa1ab93ab10c23626a5ce5fad5b5 Mon Sep 17 00:00:00 2001
+From: Alexander Holler <hol...@ahsoftware.de>
+Date: Wed, 25 Apr 2012 00:50:03 +0200
+Subject: [PATCH] leds: heartbeat: stop on shutdown, reboot or panic
+
+A halted kernel should not show a heartbeat.
+
+Signed-off-by: Alexander Holler <hol...@ahsoftware.de>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ drivers/leds/ledtrig-heartbeat.c |   27 ++++++++++++++++++++++++++-
+ 1 files changed, 26 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
+index 759c0bb..31c234c 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,37 @@ 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;
++}
++
++static struct notifier_block heartbeat_reboot_nb = {
++      .notifier_call = heartbeat_reboot_notifier,
++};
++
++static struct notifier_block heartbeat_panic_nb = {
++      .notifier_call = heartbeat_reboot_notifier,
++};
++
+ static int __init heartbeat_trig_init(void)
+ {
+-      return led_trigger_register(&heartbeat_led_trigger);
++      int rc = led_trigger_register(&heartbeat_led_trigger);
++      if (!rc) {
++              atomic_notifier_chain_register(&panic_notifier_list,
++                                             &heartbeat_panic_nb);
++              register_reboot_notifier(&heartbeat_reboot_nb);
++      }
++      return rc;
+ }
+ static void __exit heartbeat_trig_exit(void)
+ {
++      unregister_reboot_notifier(&heartbeat_reboot_nb);
++      atomic_notifier_chain_unregister(&panic_notifier_list,
++                                       &heartbeat_panic_nb);
+       led_trigger_unregister(&heartbeat_led_trigger);
+ }
+-- 
+1.7.7.4
+
index 72a06e323b0de908e6a50917fb3ae884189c2bbe..3dda4f881c3c5f013986fd9d24a31c84fa3a6487 100644 (file)
@@ -10,7 +10,7 @@ PV = "3.2.16"
 SRCREV_pn-${PN} = "b1be7dd1ec231ae751d0ce3acd0d2e5760704a6f"
 
 # The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
-MACHINE_KERNEL_PR_append = "c"
+MACHINE_KERNEL_PR_append = "d"
 
 FILESPATH =. "${FILE_DIRNAME}/linux-mainline-3.2:${FILE_DIRNAME}/linux-mainline-3.2/${MACHINE}:"
 
@@ -73,6 +73,7 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gi
             file://omap_fixes/0005-ARM-OMAP3-hwmod-data-disable-multiblock-reads-on-MMC.patch \
             file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \
             file://sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch \
+            file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \
             \
             file://defconfig"