From d74d826a4bfb633bbd0bbf276c9f75509ff308dc Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Wed, 22 Apr 2020 14:34:38 +0800 Subject: [PATCH] soc/rockchip: fix WARNING on system monitor to cancel work ------------[ cut here ]------------ WARNING: CPU: 7 PID: 1 at kernel/workqueue.c:2944 __flush_work+0x274/0x294 Modules linked in: CPU: 7 PID: 1 Comm: init Not tainted 4.19.111 #542 Hardware name: Rockchip rk3368 808 evb board (DT) pstate: 60400005 (nZCv daif +PAN -UAO) pc : __flush_work+0x274/0x294 lr : __flush_work+0x270/0x294 ... Call trace: __flush_work+0x274/0x294 __cancel_work_timer+0x110/0x1a0 cancel_delayed_work_sync+0x10/0x1c rockchip_monitor_reboot_notifier+0x78/0x84 blocking_notifier_call_chain+0x54/0x98 kernel_power_off+0x20/0xf8 Change-Id: Ia666a2901a1ce1d66b231e6615205e6e83f3093c Signed-off-by: Jianqun Xu --- drivers/soc/rockchip/rockchip_system_monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soc/rockchip/rockchip_system_monitor.c b/drivers/soc/rockchip/rockchip_system_monitor.c index 2ebfa2d4aed0..a09a858e8d95 100644 --- a/drivers/soc/rockchip/rockchip_system_monitor.c +++ b/drivers/soc/rockchip/rockchip_system_monitor.c @@ -1393,7 +1393,8 @@ static int rockchip_monitor_reboot_notifier(struct notifier_block *nb, unsigned long action, void *ptr) { rockchip_set_system_status(SYS_STATUS_REBOOT); - cancel_delayed_work_sync(&system_monitor->thermal_work); + if (system_monitor->tz) + cancel_delayed_work_sync(&system_monitor->thermal_work); return NOTIFY_OK; }