diff options
author | Martin Peres <martin.peres@labri.fr> | 2012-12-08 17:00:38 +0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 10:00:30 +0400 |
commit | 3600ad5e1b343f2c259901f736c717f5bc4deb50 (patch) | |
tree | 09d491e27b43fecc16f4cd7bf66420717565a46f /drivers/gpu | |
parent | f1aa4a1de5e13b794a7e31efc0b3ddcda6926c56 (diff) | |
download | linux-3600ad5e1b343f2c259901f736c717f5bc4deb50.tar.xz |
drm/nouveau/therm: force a minimum hysteresis on temperature alarm thresholds
This should avoid the situation where a user gets its kernel logs flooded when
temperature oscillates around a threshold with 0°C hysteresis.
This patch is just meant to fix broken vbios (as reported on a nv4e on
sysfs hwmon interface.
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/therm/temp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c index 820e09706578..bf9b3cefb514 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c @@ -58,11 +58,18 @@ static void nouveau_therm_temp_safety_checks(struct nouveau_therm *therm) { struct nouveau_therm_priv *priv = (void *)therm; + struct nvbios_therm_sensor *s = &priv->bios_sensor; if (!priv->bios_sensor.slope_div) priv->bios_sensor.slope_div = 1; if (!priv->bios_sensor.offset_den) priv->bios_sensor.offset_den = 1; + + /* enforce a minimum hysteresis on thresholds */ + s->thrs_fan_boost.hysteresis = max_t(u8, s->thrs_fan_boost.hysteresis, 2); + s->thrs_down_clock.hysteresis = max_t(u8, s->thrs_down_clock.hysteresis, 2); + s->thrs_critical.hysteresis = max_t(u8, s->thrs_critical.hysteresis, 2); + s->thrs_shutdown.hysteresis = max_t(u8, s->thrs_shutdown.hysteresis, 2); } /* must be called with alarm_program_lock taken ! */ |