linux/drivers/leds
Alexander Holler fb31fbeb64 leds: heartbeat: fix bug on panic
With commit 49dca5aebf I introduced
a bug (visible if CONFIG_PROVE_RCU is enabled) which occures when a panic
has happened:

[ 1526.520230] ===============================
[ 1526.520230] [ INFO: suspicious RCU usage. ]
[ 1526.520230] 3.5.0-rc1+ #12 Not tainted
[ 1526.520230] -------------------------------
[ 1526.520230] /c/kernel-tests/mm/include/linux/rcupdate.h:436 Illegal context switch in RCU read-side critical section!
[ 1526.520230]
[ 1526.520230] other info that might help us debug this:
[ 1526.520230]
[ 1526.520230]
[ 1526.520230] rcu_scheduler_active = 1, debug_locks = 0
[ 1526.520230] 3 locks held by net.agent/3279:
[ 1526.520230]  #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff82f85962>] do_page_fault+0x193/0x390
[ 1526.520230]  #1:  (panic_lock){+.+...}, at: [<ffffffff82ed2830>] panic+0x37/0x1d3
[ 1526.520230]  #2:  (rcu_read_lock){.+.+..}, at: [<ffffffff810b9b28>] rcu_lock_acquire+0x0/0x29
[ 1526.520230]
[ 1526.520230] stack backtrace:
[ 1526.520230] Pid: 3279, comm: net.agent Not tainted 3.5.0-rc1+ #12
[ 1526.520230] Call Trace:
[ 1526.520230]  [<ffffffff810e1570>] lockdep_rcu_suspicious+0x109/0x112
[ 1526.520230]  [<ffffffff810bfe3a>] rcu_preempt_sleep_check+0x45/0x47
[ 1526.520230]  [<ffffffff810bfe5a>] __might_sleep+0x1e/0x19a
[ 1526.520230]  [<ffffffff82f8010e>] down_write+0x26/0x81
[ 1526.520230]  [<ffffffff8276a966>] led_trigger_unregister+0x1f/0x9c
[ 1526.520230]  [<ffffffff8276def5>] heartbeat_reboot_notifier+0x15/0x19
[ 1526.520230]  [<ffffffff82f85bf5>] notifier_call_chain+0x96/0xcd
[ 1526.520230]  [<ffffffff82f85cba>] __atomic_notifier_call_chain+0x8e/0xff
[ 1526.520230]  [<ffffffff81094b7c>] ? kmsg_dump+0x37/0x1eb
[ 1526.520230]  [<ffffffff82f85d3f>] atomic_notifier_call_chain+0x14/0x16
[ 1526.520230]  [<ffffffff82ed28e1>] panic+0xe8/0x1d3
[ 1526.520230]  [<ffffffff811473e2>] out_of_memory+0x15d/0x1d3

So in case of a panic, now just turn of the LED. Other approaches like
scheduling a work to unregister the trigger aren't working because there
isn't much which still runs after a panic occured (except timers).

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-04 15:55:19 +08:00
..
dell-led.c
Kconfig leds: Make LEDS_ASIC3 and LEDS_RENESAS_TPU depend on LEDS_CLASS=y 2012-06-12 10:56:25 +08:00
led-class.c leds: fixed a coding style issue. 2012-06-12 10:56:24 +08:00
led-core.c leds: don't disable blinking when writing the same value to delay_on or delay_off 2012-06-12 10:56:24 +08:00
led-triggers.c
leds-88pm860x.c
leds-adp5520.c
leds-asic3.c
leds-atmel-pwm.c
leds-bd2802.c
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-da903x.c
leds-da9052.c
leds-dac124s085.c
leds-fsg.c
leds-gpio-register.c
leds-gpio.c
leds-hp6xx.c
leds-lm3530.c drivers/leds/leds-lm3530.c: simplify als configuration on initialization 2012-05-29 16:22:32 -07:00
leds-lm3533.c leds: add LM3533 LED driver 2012-05-29 16:22:32 -07:00
leds-locomo.c
leds-lp3944.c
leds-lp5521.c
leds-lp5523.c
leds-lt3593.c
leds-max8997.c
leds-mc13783.c leds: Use kcalloc instead of kzalloc to allocate array 2012-05-29 16:22:31 -07:00
leds-net48xx.c
leds-netxbig.c
leds-ns2.c
leds-ot200.c
leds-pca955x.c drivers/leds/leds-pca955x.c: fix race condition while setting brightness on several LEDs 2012-05-29 16:22:32 -07:00
leds-pca9532.c
leds-pca9633.c
leds-pwm.c
leds-rb532.c
leds-regulator.c
leds-renesas-tpu.c
leds-s3c24xx.c
leds-ss4200.c
leds-sunfire.c
leds-tca6507.c
leds-wm831x-status.c
leds-wm8350.c
leds-wrap.c
leds.h
ledtrig-backlight.c leds: change existing triggers to use activated flag 2012-05-29 16:22:31 -07:00
ledtrig-default-on.c
ledtrig-gpio.c leds: change existing triggers to use activated flag 2012-05-29 16:22:31 -07:00
ledtrig-heartbeat.c leds: heartbeat: fix bug on panic 2012-07-04 15:55:19 +08:00
ledtrig-ide-disk.c
ledtrig-timer.c leds: change ledtrig-timer to use activated flag 2012-05-29 16:22:31 -07:00
ledtrig-transient.c leds: add new transient trigger for one shot timer activation 2012-05-29 16:22:32 -07:00
Makefile leds: add LM3533 LED driver 2012-05-29 16:22:32 -07:00