1919#define MLXSW_THERMAL_ASIC_TEMP_NORM 75000 /* 75C */
2020#define MLXSW_THERMAL_ASIC_TEMP_HIGH 85000 /* 85C */
2121#define MLXSW_THERMAL_ASIC_TEMP_HOT 105000 /* 105C */
22- #define MLXSW_THERMAL_ASIC_TEMP_CRIT 140000 /* 140C */
2322#define MLXSW_THERMAL_HYSTERESIS_TEMP 5000 /* 5C */
2423#define MLXSW_THERMAL_MODULE_TEMP_SHIFT (MLXSW_THERMAL_HYSTERESIS_TEMP * 2)
2524#define MLXSW_THERMAL_ZONE_MAX_NAME 16
@@ -45,7 +44,6 @@ enum mlxsw_thermal_trips {
4544 MLXSW_THERMAL_TEMP_TRIP_NORM ,
4645 MLXSW_THERMAL_TEMP_TRIP_HIGH ,
4746 MLXSW_THERMAL_TEMP_TRIP_HOT ,
48- MLXSW_THERMAL_TEMP_TRIP_CRIT ,
4947};
5048
5149struct mlxsw_thermal_trip {
@@ -75,16 +73,9 @@ static const struct mlxsw_thermal_trip default_thermal_trips[] = {
7573 { /* Warning */
7674 .type = THERMAL_TRIP_HOT ,
7775 .temp = MLXSW_THERMAL_ASIC_TEMP_HOT ,
78- .hyst = MLXSW_THERMAL_HYSTERESIS_TEMP ,
7976 .min_state = MLXSW_THERMAL_MAX_STATE ,
8077 .max_state = MLXSW_THERMAL_MAX_STATE ,
8178 },
82- { /* Critical - soft poweroff */
83- .type = THERMAL_TRIP_CRITICAL ,
84- .temp = MLXSW_THERMAL_ASIC_TEMP_CRIT ,
85- .min_state = MLXSW_THERMAL_MAX_STATE ,
86- .max_state = MLXSW_THERMAL_MAX_STATE ,
87- }
8879};
8980
9081#define MLXSW_THERMAL_NUM_TRIPS ARRAY_SIZE(default_thermal_trips)
@@ -154,7 +145,6 @@ mlxsw_thermal_module_trips_reset(struct mlxsw_thermal_module *tz)
154145 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_NORM ].temp = 0 ;
155146 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_HIGH ].temp = 0 ;
156147 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_HOT ].temp = 0 ;
157- tz -> trips [MLXSW_THERMAL_TEMP_TRIP_CRIT ].temp = 0 ;
158148}
159149
160150static int
@@ -183,11 +173,10 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core,
183173 }
184174
185175 /* According to the system thermal requirements, the thermal zones are
186- * defined with four trip points. The critical and emergency
176+ * defined with three trip points. The critical and emergency
187177 * temperature thresholds, provided by QSFP module are set as "active"
188- * and "hot" trip points, "normal" and "critical" trip points are
189- * derived from "active" and "hot" by subtracting or adding double
190- * hysteresis value.
178+ * and "hot" trip points, "normal" trip point is derived from "active"
179+ * by subtracting double hysteresis value.
191180 */
192181 if (crit_temp >= MLXSW_THERMAL_MODULE_TEMP_SHIFT )
193182 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_NORM ].temp = crit_temp -
@@ -196,8 +185,6 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core,
196185 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_NORM ].temp = crit_temp ;
197186 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_HIGH ].temp = crit_temp ;
198187 tz -> trips [MLXSW_THERMAL_TEMP_TRIP_HOT ].temp = emerg_temp ;
199- tz -> trips [MLXSW_THERMAL_TEMP_TRIP_CRIT ].temp = emerg_temp +
200- MLXSW_THERMAL_MODULE_TEMP_SHIFT ;
201188
202189 return 0 ;
203190}
@@ -210,7 +197,7 @@ static void mlxsw_thermal_tz_score_update(struct mlxsw_thermal *thermal,
210197 struct mlxsw_thermal_trip * trip = trips ;
211198 unsigned int score , delta , i , shift = 1 ;
212199
213- /* Calculate thermal zone score, if temperature is above the critical
200+ /* Calculate thermal zone score, if temperature is above the hot
214201 * threshold score is set to MLXSW_THERMAL_TEMP_SCORE_MAX.
215202 */
216203 score = MLXSW_THERMAL_TEMP_SCORE_MAX ;
@@ -333,8 +320,7 @@ static int mlxsw_thermal_set_trip_temp(struct thermal_zone_device *tzdev,
333320{
334321 struct mlxsw_thermal * thermal = tzdev -> devdata ;
335322
336- if (trip < 0 || trip >= MLXSW_THERMAL_NUM_TRIPS ||
337- temp > MLXSW_THERMAL_ASIC_TEMP_CRIT )
323+ if (trip < 0 || trip >= MLXSW_THERMAL_NUM_TRIPS )
338324 return - EINVAL ;
339325
340326 thermal -> trips [trip ].temp = temp ;
@@ -502,8 +488,7 @@ mlxsw_thermal_module_trip_temp_set(struct thermal_zone_device *tzdev,
502488{
503489 struct mlxsw_thermal_module * tz = tzdev -> devdata ;
504490
505- if (trip < 0 || trip >= MLXSW_THERMAL_NUM_TRIPS ||
506- temp > tz -> trips [MLXSW_THERMAL_TEMP_TRIP_CRIT ].temp )
491+ if (trip < 0 || trip >= MLXSW_THERMAL_NUM_TRIPS )
507492 return - EINVAL ;
508493
509494 tz -> trips [trip ].temp = temp ;
0 commit comments