]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
thermal: core: Avoid calling .trip_crossed() for critical and hot trips
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 May 2024 16:54:11 +0000 (18:54 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Jun 2024 19:06:44 +0000 (21:06 +0200)
Invoking the governor .trip_crossed() callback for critical and hot
trips is pointless because they are handled directly by the core,
so make thermal_governor_trip_crossed() avoid doing that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_core.c

index 57f20326aa9193cbb3fad92e735edb21c87f232c..8bb63a364cba47739ede8f916846c11fe81d7161 100644 (file)
@@ -463,6 +463,9 @@ static void thermal_governor_trip_crossed(struct thermal_governor *governor,
                                          const struct thermal_trip *trip,
                                          bool crossed_up)
 {
+       if (trip->type == THERMAL_TRIP_HOT || trip->type == THERMAL_TRIP_CRITICAL)
+               return;
+
        if (governor->trip_crossed)
                governor->trip_crossed(tz, trip, crossed_up);
 }