drm/nouveau/bios/iccsense: rails for power sensors have a mask of 0xf8 for version...
authorKarol Herbst <karolherbst@gmail.com>
Sun, 23 Apr 2017 18:06:37 +0000 (20:06 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 16 Jun 2017 04:04:19 +0000 (14:04 +1000)
I only saw those values inside the vbios: 0xff, 0xfd, 0xfc, 0xfa for valid
rails.

No idea what the lower value does, but at least we get power readings on
a lot of Fermi GPUs with that.

v2: add missing parentheses

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c

index 3953d11844ea008ee4137e6e2441c7f12b808e91..23caef8df17fbd13638a7f778bd8ffeca41321d2 100644 (file)
@@ -87,7 +87,10 @@ nvbios_iccsense_parse(struct nvkm_bios *bios, struct nvbios_iccsense *iccsense)
 
                switch(ver) {
                case 0x10:
-                       rail->mode = nvbios_rd08(bios, entry + 0x1);
+                       if ((nvbios_rd08(bios, entry + 0x1) & 0xf8) == 0xf8)
+                               rail->mode = 1;
+                       else
+                               rail->mode = 0;
                        rail->extdev_id = nvbios_rd08(bios, entry + 0x2);
                        res_start = 0x3;
                        break;