thermal: core: Send trip crossing notifications at init time if needed
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 2 Apr 2024 19:02:10 +0000 (21:02 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 8 Apr 2024 14:01:20 +0000 (16:01 +0200)
commit9ad18043fb35feb1d82c1e594575346f16d47dc7
treea9a981f744c20048cc2fd0c6723e0598d423b84c
parentf99c1b87a902fcc81df569f2ff939d47880cd741
thermal: core: Send trip crossing notifications at init time if needed

If a trip point is already exceeded by the zone temperature at the
initialization time, no trip crossing notification is send regarding
this even though mitigation should be started then.

Address this by rearranging the code in handle_thermal_trip() to
send a trip crossing notification for trip points already exceeded
by the zone temperature initially which also allows to reduce its
size by using the observation that the initialization and regular
trip crossing on the way up become the same case then.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
drivers/thermal/thermal_core.c