From 4a86c2f3ccbb861cc50778cc4b67af153e99bf24 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Fri, 10 Feb 2017 14:58:30 -0700 Subject: drivers: thermal: Exit sysfs notify kthread when sensor unregisters When a thermal zone unregisters, it initiates a blocking call kthread_stop for the sysfs notify kthread to exit. But the sysfs notify kthread is blocked on a completion event, which may not be triggered after the sensor driver initiates a thermal zone unregister call. So, the kthread_stop will be blocked forever. As a part of thermal zone unregister, set a thermal zone unregister flag and send a completion event before calling kthread_stop. Make the sysfs notify kthread to be aware of thermal zone unregister flag and exit after the completion event is triggered. Change-Id: Icf045e0ad6e28135cd3a54c15d9923f095a286ff Signed-off-by: Ram Chandrasekar --- include/linux/thermal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/thermal.h b/include/linux/thermal.h index b90f8f5c663d..4d2cf47aba27 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -178,6 +178,7 @@ struct sensor_info { struct work_struct work; struct task_struct *sysfs_notify_thread; struct completion sysfs_notify_complete; + bool deregister_active; }; /** -- cgit v1.2.3