drm/nv40/therm: increase the sensor's settling delay to 20ms
authorMartin Peres <martin.peres@labri.fr>
Tue, 5 Mar 2013 09:35:20 +0000 (10:35 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 18 Mar 2013 01:15:26 +0000 (11:15 +1000)
Based on my experience, 10ms wasn't always enough. Let's bump that
to a little more.

If this turns out to be insufficient-enough again, then an approach
based on letting the sensor settle for several seconds before starting
polling on the temperature would be better suited. This way, boot time
wouldn't be impacted by those waits too much.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c

index d8f43252c0482be5430c9cbef4b4ef3d289f2fa1..0575af5328ec92d826a92befd003c80d1d73efe2 100644 (file)
@@ -66,10 +66,11 @@ nv40_sensor_setup(struct nouveau_therm *therm)
        if (style == NEW_STYLE) {
                nv_mask(therm, 0x15b8, 0x80000000, 0);
                nv_wr32(therm, 0x15b0, 0x80003fff);
-               mdelay(10); /* wait for the temperature to stabilize */
+               mdelay(20); /* wait for the temperature to stabilize */
                return nv_rd32(therm, 0x15b4) & 0x3fff;
        } else if (style == OLD_STYLE) {
                nv_wr32(therm, 0x15b0, 0xff);
+               mdelay(20); /* wait for the temperature to stabilize */
                return nv_rd32(therm, 0x15b4) & 0xff;
        } else
                return -ENODEV;