Manivannan Sadhasivam
c3ae6afec3
watchdog: qcom: Avoid context switch in restart handler
...
[ Upstream commit 7948fab26bcc468aa2a76462f441291b5fb0d5c7 ]
The use of msleep() in the restart handler will cause scheduler to
induce a context switch which is not desirable. This generates below
warning on SDX55 when WDT is the only available restart source:
[ 39.800188] reboot: Restarting system
[ 39.804115] ------------[ cut here ]------------
[ 39.807855] WARNING: CPU: 0 PID: 678 at kernel/rcu/tree_plugin.h:297 rcu_note_context_switch+0x190/0x764
[ 39.812538] Modules linked in:
[ 39.821954] CPU: 0 PID: 678 Comm: reboot Not tainted 5.10.0-rc1-00063-g33a9990d1d66-dirty #47
[ 39.824854] Hardware name: Generic DT based system
[ 39.833470] [<c0310fbc>] (unwind_backtrace) from [<c030c544>] (show_stack+0x10/0x14)
[ 39.838154] [<c030c544>] (show_stack) from [<c0c218f0>] (dump_stack+0x8c/0xa0)
[ 39.846049] [<c0c218f0>] (dump_stack) from [<c0322f80>] (__warn+0xd8/0xf0)
[ 39.853058] [<c0322f80>] (__warn) from [<c0c1dc08>] (warn_slowpath_fmt+0x64/0xc8)
[ 39.859925] [<c0c1dc08>] (warn_slowpath_fmt) from [<c038b6f4>] (rcu_note_context_switch+0x190/0x764)
[ 39.867503] [<c038b6f4>] (rcu_note_context_switch) from [<c0c2aa3c>] (__schedule+0x84/0x640)
[ 39.876685] [<c0c2aa3c>] (__schedule) from [<c0c2b050>] (schedule+0x58/0x10c)
[ 39.885095] [<c0c2b050>] (schedule) from [<c0c2eed0>] (schedule_timeout+0x1e8/0x3d4)
[ 39.892135] [<c0c2eed0>] (schedule_timeout) from [<c039ad40>] (msleep+0x2c/0x38)
[ 39.899947] [<c039ad40>] (msleep) from [<c0a59d0c>] (qcom_wdt_restart+0xc4/0xcc)
[ 39.907319] [<c0a59d0c>] (qcom_wdt_restart) from [<c0a58290>] (watchdog_restart_notifier+0x18/0x28)
[ 39.914715] [<c0a58290>] (watchdog_restart_notifier) from [<c03468e0>] (atomic_notifier_call_chain+0x60/0x84)
[ 39.923487] [<c03468e0>] (atomic_notifier_call_chain) from [<c030ae64>] (machine_restart+0x78/0x7c)
[ 39.933551] [<c030ae64>] (machine_restart) from [<c0348048>] (__do_sys_reboot+0xdc/0x1e0)
[ 39.942397] [<c0348048>] (__do_sys_reboot) from [<c0300060>] (ret_fast_syscall+0x0/0x54)
[ 39.950721] Exception stack(0xc3e0bfa8 to 0xc3e0bff0)
[ 39.958855] bfa0: 0001221c bed2fe24 fee1dead 28121969 01234567 00000000
[ 39.963832] bfc0: 0001221c bed2fe24 00000003 00000058 000225e0 00000000 00000000 00000000
[ 39.971985] bfe0: b6e62560 bed2fc84 00010fd8 b6e62580
[ 39.980124] ---[ end trace 3f578288bad866e4 ]---
Hence, replace msleep() with mdelay() to fix this issue.
Fixes: 05e487d905ab ("watchdog: qcom: register a restart notifier")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20201207060005.21293-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-29 13:45:01 +01:00
..
2016-09-23 22:35:45 +02:00
2016-07-17 20:59:10 +02:00
2015-09-11 15:12:59 -07:00
2015-09-09 21:38:52 +02:00
2015-09-09 21:38:29 +02:00
2016-10-05 18:36:18 -04:00
2016-03-16 21:09:08 +01:00
2016-03-01 15:36:35 +01:00
2019-09-06 10:19:43 +02:00
2016-09-24 08:50:10 +02:00
2017-07-05 14:40:28 +02:00
2015-09-09 21:34:34 +02:00
2016-09-24 08:50:10 +02:00
2015-09-09 21:39:22 +02:00
2016-05-14 18:25:49 +02:00
2015-12-29 20:36:03 +01:00
2015-12-29 20:36:04 +01:00
2020-06-30 15:38:26 -04:00
2016-07-17 21:02:42 +02:00
2015-09-09 21:39:22 +02:00
2015-12-29 20:36:02 +01:00
2016-03-01 15:36:35 +01:00
2016-09-23 08:40:55 +02:00
2016-05-02 09:32:04 -07:00
2015-09-09 21:39:22 +02:00
2020-08-21 11:02:09 +02:00
2015-09-28 10:56:01 +02:00
2016-07-27 10:47:43 +02:00
2018-03-18 11:18:53 +01:00
2015-09-09 21:39:22 +02:00
2016-03-01 15:36:35 +01:00
2019-10-17 13:42:07 -07:00
2015-10-28 22:58:32 +01:00
2015-02-17 21:32:08 +01:00
2016-09-24 08:49:51 +02:00
2016-05-14 16:24:43 +02:00
2019-06-22 08:17:14 +02:00
2017-10-21 17:21:33 +02:00
2015-08-05 10:35:49 -07:00
2016-03-01 15:36:35 +01:00
2016-10-13 16:44:20 -07:00
2016-01-31 16:51:56 +01:00
2016-07-17 21:01:07 +02:00
2017-01-06 10:40:16 +01:00
2015-12-28 23:04:06 +01:00
2015-09-09 21:39:22 +02:00
2019-12-05 15:34:10 +01:00
2016-03-01 15:36:35 +01:00
2016-03-01 15:36:35 +01:00
2015-09-09 21:37:51 +02:00
2016-09-24 08:59:31 +02:00
2016-03-01 15:36:35 +01:00
2016-03-01 16:25:39 +01:00
2016-07-17 21:04:13 +02:00
2016-05-14 09:22:21 +02:00
2016-09-23 22:04:09 +02:00
2015-12-27 21:09:40 +01:00
2015-06-22 15:54:35 +02:00
2015-09-09 21:39:22 +02:00
2017-05-25 15:44:30 +02:00
2016-07-17 20:59:23 +02:00
2016-07-25 12:02:32 +02:00
2016-07-25 12:02:43 +02:00
2016-03-16 21:09:42 +01:00
2016-10-08 10:27:13 +02:00
2016-10-08 10:27:17 +02:00
2020-12-29 13:45:01 +01:00
2016-03-01 15:29:42 +01:00
2020-11-10 10:23:54 +01:00
2016-05-14 18:15:40 +02:00
2015-09-09 21:39:22 +02:00
2020-02-05 13:05:40 +00:00
2016-09-24 08:59:23 +02:00
2017-04-12 12:41:22 +02:00
2015-09-09 21:38:29 +02:00
2018-05-30 07:50:34 +02:00
2016-05-14 18:25:56 +02:00
2016-07-17 21:00:44 +02:00
2016-10-08 10:27:27 +02:00
2016-01-31 16:52:08 +01:00
2016-05-14 16:16:04 +02:00
2018-05-30 07:50:20 +02:00
2016-09-24 08:59:49 +02:00
2016-01-11 21:51:28 +01:00
2016-01-31 11:06:24 -08:00
2016-03-01 15:36:35 +01:00
2016-07-18 12:10:21 +02:00
2016-09-24 08:50:03 +02:00
2015-08-05 10:35:49 -07:00
2015-12-28 22:29:35 +01:00
2015-09-09 21:39:22 +02:00
2016-09-23 22:36:32 +02:00
2015-09-09 21:39:22 +02:00
2015-09-09 21:39:22 +02:00
2016-09-24 08:50:10 +02:00
2015-11-23 08:59:30 +01:00
2016-09-23 08:37:14 +02:00
2015-12-29 20:36:01 +01:00
2020-05-27 16:41:53 +02:00
2016-10-08 10:27:24 +02:00
2016-10-08 10:27:24 +02:00
2020-03-11 07:53:06 +01:00
2015-09-09 21:39:22 +02:00
2015-09-09 21:39:22 +02:00
2016-09-23 22:34:24 +02:00