linux-ti335x-psp 3.2: add patch to disable heartbeat LED trigger on shutdown
authorKoen Kooi <koen@dominion.thruhere.net>
Mon, 7 May 2012 11:39:56 +0000 (13:39 +0200)
committerDenys Dmytriyenko <denys@ti.com>
Thu, 10 May 2012 19:34:25 +0000 (15:34 -0400)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp_3.2.bb

diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch
new file mode 100644 (file)
index 0000000..009f8fa
--- /dev/null
@@ -0,0 +1,67 @@
+From fa1fff60e0f18032378fa97a6951c6f79e24507d 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 file changed, 26 insertions(+), 1 deletion(-)
+
+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.9.5
+
index 2e75cc2819943443aa2aa6bcfb488bc3d816d421..de3129d0e1640b0f0301b0dcde081600b511fe2b 100644 (file)
@@ -12,7 +12,7 @@ MULTI_CONFIG_BASE_SUFFIX = ""
 
 BRANCH = "v3.2-staging"
 SRCREV = "31944a82681a0e7ab6cc3e069c30eddc5042e3e8"
-MACHINE_KERNEL_PR_append = "d+gitr${SRCREV}"
+MACHINE_KERNEL_PR_append = "e+gitr${SRCREV}"
 
 COMPATIBLE_MACHINE = "(ti33x)"
 
@@ -924,6 +924,7 @@ PATCHES_OVER_PSP = " \
        file://3.2.16/0067-drm-radeon-disable-MSI-on-RV515.patch \
        file://3.2.16/0068-drm-radeon-fix-load-detect-on-rn50-with-hardcoded-ED.patch \
        file://3.2.16/0069-Linux-3.2.16.patch \
+       file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \
        file://beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch \
        file://beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch \
        file://beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch \