提交 72c976fc 编写于 作者: R Rafael J. Wysocki

thermal: gov_user_space: Do not lock thermal zone mutex

Commit 670a5e35 ("thermal/core: Move the thermal zone lock out of
the governors") moved thermal zone locking away from governors, but it
forgot about the user space one which deadlocks now.

Fix this by removing the thermal zone locking from the user space
governor.

Fixes: 670a5e35 ("thermal/core: Move the thermal zone lock out of the governors")
Tested-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 02af1db0
...@@ -34,7 +34,8 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip) ...@@ -34,7 +34,8 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip)
char *thermal_prop[5]; char *thermal_prop[5];
int i; int i;
mutex_lock(&tz->lock); lockdep_assert_held(&tz->lock);
thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type);
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature);
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=%d", trip); thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=%d", trip);
...@@ -43,7 +44,7 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip) ...@@ -43,7 +44,7 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip)
kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop);
for (i = 0; i < 4; ++i) for (i = 0; i < 4; ++i)
kfree(thermal_prop[i]); kfree(thermal_prop[i]);
mutex_unlock(&tz->lock);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册