diff options
| author | Koen Kooi <koen@dominion.thruhere.net> | 2012-05-10 10:53:45 +0200 |
|---|---|---|
| committer | Denys Dmytriyenko <denys@ti.com> | 2012-05-10 15:30:43 -0400 |
| commit | 0be62d6c0d20618706707a3a0e8827b782ca2bef (patch) | |
| tree | 83f505b5d2c3688b58aa1b43db1bd498e436f21f | |
| parent | 0b2c5e6de9be82d6f8362d61c52a76d504fea9d3 (diff) | |
| download | meta-ti-0be62d6c0d20618706707a3a0e8827b782ca2bef.tar.gz | |
linux-mainline 3.2: shut down heartbeat LED on halt/reboot/panic
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
| -rw-r--r-- | recipes-kernel/linux/linux-mainline-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch | 67 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-mainline_3.2.bb | 3 |
2 files changed, 69 insertions, 1 deletions
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 index 00000000..241907ef --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | From d4369481800faa1ab93ab10c23626a5ce5fad5b5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Holler <hol...@ahsoftware.de> | ||
| 3 | Date: Wed, 25 Apr 2012 00:50:03 +0200 | ||
| 4 | Subject: [PATCH] leds: heartbeat: stop on shutdown, reboot or panic | ||
| 5 | |||
| 6 | A halted kernel should not show a heartbeat. | ||
| 7 | |||
| 8 | Signed-off-by: Alexander Holler <hol...@ahsoftware.de> | ||
| 9 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
| 10 | --- | ||
| 11 | drivers/leds/ledtrig-heartbeat.c | 27 ++++++++++++++++++++++++++- | ||
| 12 | 1 files changed, 26 insertions(+), 1 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c | ||
| 15 | index 759c0bb..31c234c 100644 | ||
| 16 | --- a/drivers/leds/ledtrig-heartbeat.c | ||
| 17 | +++ b/drivers/leds/ledtrig-heartbeat.c | ||
| 18 | @@ -18,6 +18,7 @@ | ||
| 19 | #include <linux/timer.h> | ||
| 20 | #include <linux/sched.h> | ||
| 21 | #include <linux/leds.h> | ||
| 22 | +#include <linux/reboot.h> | ||
| 23 | #include "leds.h" | ||
| 24 | |||
| 25 | struct heartbeat_trig_data { | ||
| 26 | @@ -101,13 +102,37 @@ static struct led_trigger heartbeat_led_trigger = { | ||
| 27 | .deactivate = heartbeat_trig_deactivate, | ||
| 28 | }; | ||
| 29 | |||
| 30 | +static int heartbeat_reboot_notifier(struct notifier_block *nb, | ||
| 31 | + unsigned long code, void *unused) | ||
| 32 | +{ | ||
| 33 | + led_trigger_unregister(&heartbeat_led_trigger); | ||
| 34 | + return NOTIFY_DONE; | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +static struct notifier_block heartbeat_reboot_nb = { | ||
| 38 | + .notifier_call = heartbeat_reboot_notifier, | ||
| 39 | +}; | ||
| 40 | + | ||
| 41 | +static struct notifier_block heartbeat_panic_nb = { | ||
| 42 | + .notifier_call = heartbeat_reboot_notifier, | ||
| 43 | +}; | ||
| 44 | + | ||
| 45 | static int __init heartbeat_trig_init(void) | ||
| 46 | { | ||
| 47 | - return led_trigger_register(&heartbeat_led_trigger); | ||
| 48 | + int rc = led_trigger_register(&heartbeat_led_trigger); | ||
| 49 | + if (!rc) { | ||
| 50 | + atomic_notifier_chain_register(&panic_notifier_list, | ||
| 51 | + &heartbeat_panic_nb); | ||
| 52 | + register_reboot_notifier(&heartbeat_reboot_nb); | ||
| 53 | + } | ||
| 54 | + return rc; | ||
| 55 | } | ||
| 56 | |||
| 57 | static void __exit heartbeat_trig_exit(void) | ||
| 58 | { | ||
| 59 | + unregister_reboot_notifier(&heartbeat_reboot_nb); | ||
| 60 | + atomic_notifier_chain_unregister(&panic_notifier_list, | ||
| 61 | + &heartbeat_panic_nb); | ||
| 62 | led_trigger_unregister(&heartbeat_led_trigger); | ||
| 63 | } | ||
| 64 | |||
| 65 | -- | ||
| 66 | 1.7.7.4 | ||
| 67 | |||
diff --git a/recipes-kernel/linux/linux-mainline_3.2.bb b/recipes-kernel/linux/linux-mainline_3.2.bb index 72a06e32..3dda4f88 100644 --- a/recipes-kernel/linux/linux-mainline_3.2.bb +++ b/recipes-kernel/linux/linux-mainline_3.2.bb | |||
| @@ -10,7 +10,7 @@ PV = "3.2.16" | |||
| 10 | SRCREV_pn-${PN} = "b1be7dd1ec231ae751d0ce3acd0d2e5760704a6f" | 10 | SRCREV_pn-${PN} = "b1be7dd1ec231ae751d0ce3acd0d2e5760704a6f" |
| 11 | 11 | ||
| 12 | # The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc | 12 | # The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc |
| 13 | MACHINE_KERNEL_PR_append = "c" | 13 | MACHINE_KERNEL_PR_append = "d" |
| 14 | 14 | ||
| 15 | FILESPATH =. "${FILE_DIRNAME}/linux-mainline-3.2:${FILE_DIRNAME}/linux-mainline-3.2/${MACHINE}:" | 15 | FILESPATH =. "${FILE_DIRNAME}/linux-mainline-3.2:${FILE_DIRNAME}/linux-mainline-3.2/${MACHINE}:" |
| 16 | 16 | ||
| @@ -73,6 +73,7 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gi | |||
| 73 | file://omap_fixes/0005-ARM-OMAP3-hwmod-data-disable-multiblock-reads-on-MMC.patch \ | 73 | file://omap_fixes/0005-ARM-OMAP3-hwmod-data-disable-multiblock-reads-on-MMC.patch \ |
| 74 | file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \ | 74 | file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \ |
| 75 | file://sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch \ | 75 | file://sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch \ |
| 76 | file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \ | ||
| 76 | \ | 77 | \ |
| 77 | file://defconfig" | 78 | file://defconfig" |
| 78 | 79 | ||
