Alexander Holler
fb31fbeb64
leds: heartbeat: fix bug on panic
With commit 49dca5aebfdeadd4bf27b6cb4c60392147dc35a4 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
..
2012-06-30 11:11:58 -07:00
2012-05-26 12:22:27 -07:00
2012-06-20 14:39:36 -07:00
2012-05-24 16:22:53 -04:00
2012-06-24 23:31:09 +02:00
2012-06-08 13:47:07 -04:00
2012-07-03 15:51:22 -07:00
2012-06-19 00:19:11 -03:00
2012-06-18 12:20:36 -07:00
2012-07-03 12:05:14 -07:00
2012-06-11 17:10:16 +09:00
2012-05-26 12:42:29 -07:00
2012-05-23 14:07:06 -07:00
2012-06-20 22:12:52 -07:00
2012-06-11 12:43:16 -03:00
2012-06-18 16:30:42 -07:00
2012-05-24 12:57:47 -07:00
2012-06-03 21:21:01 -07:00
2012-07-03 11:18:48 +01:00
2012-06-26 11:23:41 -07:00
2012-05-22 16:02:13 -07:00
2012-06-29 10:29:54 -07:00
2012-06-04 16:49:43 +02:00
2012-06-12 15:51:41 -07:00
2012-06-14 17:28:46 -07:00
2012-06-24 04:59:59 -07:00
2012-05-30 10:55:34 +02:00
2012-06-04 12:47:44 +02:00
2012-05-24 11:54:29 -07:00
2012-07-04 15:55:19 +08:00
2012-07-03 18:05:35 -07:00
2012-06-25 14:53:09 -07:00
2012-05-31 18:10:18 -07:00
2012-06-20 14:39:36 -07:00
2012-06-13 15:34:31 -07:00
2012-06-26 16:10:30 -04:00
2012-06-28 11:41:43 -07:00
2012-07-01 00:25:32 -07:00
2012-05-25 11:16:16 -04:00
2012-05-29 18:27:19 -07:00
2012-06-21 16:15:11 +02:00
2012-05-22 19:22:50 -07:00
2012-05-22 16:02:13 -07:00
2012-06-13 13:11:39 -07:00
2012-06-20 14:41:57 -07:00
2012-06-07 14:43:55 -07:00
2012-05-31 12:10:15 -07:00
2012-05-22 19:22:50 -07:00
2012-05-31 17:49:31 -07:00
2012-06-23 11:37:28 +01:00
2012-06-17 10:31:03 +03:00
2012-06-04 00:48:41 -04:00
2012-05-31 10:51:10 -07:00
2012-06-22 22:05:31 -07:00
2012-05-22 19:07:55 +09:00
2012-06-18 11:27:04 +01:00
2012-06-25 14:53:09 -07:00
2012-06-12 20:12:25 -07:00
2012-06-20 15:13:13 -07:00
2012-06-26 16:14:34 -07:00
2012-06-26 21:10:56 -07:00
2012-06-16 16:59:05 -07:00
2012-05-22 12:16:15 +09:30
2012-05-26 12:42:29 -07:00
2012-06-28 20:40:56 +02:00
2012-06-15 17:17:15 -07:00
2012-05-22 16:34:21 -07:00
2012-05-26 12:22:27 -07:00