Skip to content

Commit 9502108

Browse files
committed
thermal: core: Drop trips_disabled bitmask
After recent changes, thermal_zone_get_trip() cannot fail, as invoked from thermal_zone_device_register_with_trips(), so the only role of the trips_disabled bitmask is struct thermal_zone_device is to make handle_thermal_trip() skip trip points whose temperature was initially zero. However, since the unit of temperature in the thermal core is millicelsius, zero may very well be a valid temperature value at least in some usage scenarios and the trip temperature may as well change later. Thus there is no reason to permanently disable trip points with initial temperature equal to zero. Accordingly, drop the trips_disabled bitmask along with the code related to it. Signed-off-by: Rafael J. Wysocki <[email protected]> Tested-by: Ido Schimmel <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
1 parent 6465e26 commit 9502108

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

drivers/thermal/thermal_core.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip_id)
347347
{
348348
struct thermal_trip trip;
349349

350-
/* Ignore disabled trip points */
351-
if (test_bit(trip_id, &tz->trips_disabled))
352-
return;
353-
354350
__thermal_zone_get_trip(tz, trip_id, &trip);
355351

356352
if (trip.temperature == THERMAL_TEMP_INVALID)
@@ -1231,7 +1227,6 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
12311227
struct thermal_zone_device *tz;
12321228
int id;
12331229
int result;
1234-
int count;
12351230
struct thermal_governor *governor;
12361231

12371232
if (!type || strlen(type) == 0) {
@@ -1328,14 +1323,6 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
13281323
if (result)
13291324
goto release_device;
13301325

1331-
for (count = 0; count < num_trips; count++) {
1332-
struct thermal_trip trip;
1333-
1334-
result = thermal_zone_get_trip(tz, count, &trip);
1335-
if (result || !trip.temperature)
1336-
set_bit(count, &tz->trips_disabled);
1337-
}
1338-
13391326
/* Update 'this' zone's governor information */
13401327
mutex_lock(&thermal_governor_lock);
13411328

include/linux/thermal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ struct thermal_cooling_device {
122122
* @devdata: private pointer for device private data
123123
* @trips: an array of struct thermal_trip
124124
* @num_trips: number of trip points the thermal zone supports
125-
* @trips_disabled; bitmap for disabled trips
126125
* @passive_delay_jiffies: number of jiffies to wait between polls when
127126
* performing passive cooling.
128127
* @polling_delay_jiffies: number of jiffies to wait between polls when
@@ -163,7 +162,6 @@ struct thermal_zone_device {
163162
void *devdata;
164163
struct thermal_trip *trips;
165164
int num_trips;
166-
unsigned long trips_disabled; /* bitmap for disabled trips */
167165
unsigned long passive_delay_jiffies;
168166
unsigned long polling_delay_jiffies;
169167
int temperature;

0 commit comments

Comments
 (0)