thermal: core: Fix race between zone registration and system suspend
[ Upstream commit cdf771ab ] If the registration of a thermal zone takes place at the time when system suspend is started, thermal_pm_notify() can run before the new thermal zone is added to thermal_tz_list and its "suspended" flag will not be set. Consequently, if __thermal_zone_device_update() is called for that thermal zone, it will not return early as expected which may cause some destructive interference with the system suspend or resume flow to occur. To avoid that, make thermal_zone_init_complete() introduced previously set the "suspended" flag for new thermal zones if it runs during system suspend or resume. Fixes: 4e814173 ("thermal: core: Fix thermal zone suspend-resume synchronization") Signed-off-by:Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/8490245.NyiUUSuA9g@rjwysocki.net Reviewed-by:
Lukasz Luba <lukasz.luba@arm.com> Signed-off-by:
Sasha Levin <sashal@kernel.org>
Loading
Please sign in to comment