Commit d0a5191d authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

drm/nv40/therm: reset temperature sensor on init

Current uninitialized sensor detection does not work for me on nv4b and
sensor returns crazy values (>190°C). It stabilises later, but it's too
late - therm code shutdowns the machine...

Let's just reset it on init.
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: default avatarMartin Peres <martin.peres@labri.fr>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 134fc032
...@@ -173,13 +173,23 @@ nv40_therm_ctor(struct nouveau_object *parent, ...@@ -173,13 +173,23 @@ nv40_therm_ctor(struct nouveau_object *parent,
return nouveau_therm_preinit(&priv->base.base); return nouveau_therm_preinit(&priv->base.base);
} }
static int
nv40_therm_init(struct nouveau_object *object)
{
struct nouveau_therm *therm = (void *)object;
nv40_sensor_setup(therm);
return _nouveau_therm_init(object);
}
struct nouveau_oclass struct nouveau_oclass
nv40_therm_oclass = { nv40_therm_oclass = {
.handle = NV_SUBDEV(THERM, 0x40), .handle = NV_SUBDEV(THERM, 0x40),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv40_therm_ctor, .ctor = nv40_therm_ctor,
.dtor = _nouveau_therm_dtor, .dtor = _nouveau_therm_dtor,
.init = _nouveau_therm_init, .init = nv40_therm_init,
.fini = _nouveau_therm_fini, .fini = _nouveau_therm_fini,
}, },
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment