volt: Improve min/max deteaction of range based volting
PATCH 1/1 volt: Improve min/max deteaction of range based volting
info.min and info.max doesn't always represent the actual voltage range we can use. Do the same as with the entry based volting.
Fixes "ERROR: Can't get value of subfeature in0_min: Can't read" errors in sensors.
--- drm/nouveau/nvkm/subdev/volt/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drm/nouveau/nvkm/subdev/volt/base.c +4 -2
@@ -195,14 +195,16 @@ nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) data =nvbios_volt_parse (bios, &ver, &hdr, &cnt, &len, &info);if (data && info.vidmask && info.base && info.step && info.ranged) {nvkm_debug (subdev,"found ranged based VIDs\n" ); - volt->min_uv = info.min; - volt->max_uv = info.max; + volt->min_uv =0xffffffff ; + volt->max_uv =0 ;for (i =0 ; i < info.vidmask +1 ; i++) {if (info.base >= info.min && info.base <= info.max) { volt->vid[volt->vid_nr].uv = info.base; volt->vid[volt->vid_nr].vid = i; volt->vid_nr++; + volt->min_uv =min (volt->min_uv, info.base); + volt->max_uv =max (volt->max_uv, info.base); } info.base += info.step; }
Signature · 6 lines
2.12.2 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Martin Peres
Reviewed-bydeteaction -> detection
Quoted 25 lines · Karol Herbst
info.min and info.max doesn't always represent the actual voltage range we can use. Do the same as with the entry based volting.
Fixes "ERROR: Can't get value of subfeature
in0_min: Can't read" errors in sensors.Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/nvkm/subdev/volt/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drm/nouveau/nvkm/subdev/volt/base.c +2
-2@@ -195,14 +195,16 @@ nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) data =nvbios_volt_parse (bios, &ver, &hdr, &cnt, &len, &info);if (data && info.vidmask && info.base && info.step && info.ranged) {nvkm_debug (subdev,"found ranged based VIDs\n" ); - volt->min_uv = info.min; - volt->max_uv = info.max; + volt->min_uv =0xffffffff ; + volt->max_uv =0 ;for (i =0 ; i < info.vidmask +1 ; i++) {
drm/nouveau/nvkm/subdev/volt/base.c nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) · line 210
Quoted 10 lines
drm/nouveau/nvkm/subdev/volt/base.c +2
-0if (info.base >= info.min && info.base <= info.max) { volt->vid[volt->vid_nr].uv = info.base; volt->vid[volt->vid_nr].vid = i; volt->vid_nr++; + volt->min_uv =min (volt->min_uv, info.base); + volt->max_uv =max (volt->max_uv, info.base); } info.base += info.step; }
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Response in-line:
Op 22-04-17 om 13:22 schreef Karol Herbst:
Quoted 16 lines
info.min and info.max doesn't always represent the actual voltage range we can use. Do the same as with the entry based volting.
Fixes "ERROR: Can't get value of subfeature
in0_min: Can't read" errors in sensors.Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/nvkm/subdev/volt/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drm/nouveau/nvkm/subdev/volt/base.c +0
-0
drm/nouveau/nvkm/subdev/volt/base.c nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) · line 202
Quoted 10 lines
drm/nouveau/nvkm/subdev/volt/base.c +2
-2@@ -195,14 +195,16 @@ nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) data =nvbios_volt_parse (bios, &ver, &hdr, &cnt, &len, &info);if (data && info.vidmask && info.base && info.step && info.ranged) {nvkm_debug (subdev,"found ranged based VIDs\n" ); - volt->min_uv = info.min; - volt->max_uv = info.max; + volt->min_uv =0xffffffff ; + volt->max_uv =0 ;for (i =0 ; i < info.vidmask +1 ; i++) {if (info.base >= info.min && info.base <= info.max) {
How bogus are info.min and info.max when you get that error? Is this if-statement still valid?
drm/nouveau/nvkm/subdev/volt/base.c nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) · line 210
Quoted 8 lines
drm/nouveau/nvkm/subdev/volt/base.c +2
-0volt->vid[volt->vid_nr].uv = info.base; volt->vid[volt->vid_nr].vid = i; volt->vid_nr++; + volt->min_uv =min (volt->min_uv, info.base); + volt->max_uv =max (volt->max_uv, info.base); } info.base += info.step; }
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
2017-04-22 16:46 GMT+02:00 Roy Spliet <[email protected]>:
Quoted 29 lines
Response in-line:
Op 22-04-17 om 13:22 schreef Karol Herbst:
Quoted 25 lines
info.min and info.max doesn't always represent the actual voltage range we can use. Do the same as with the entry based volting.
Fixes "ERROR: Can't get value of subfeature
in0_min: Can't read" errors in sensors.Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/nvkm/subdev/volt/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drm/nouveau/nvkm/subdev/volt/base.c +0
-2@@ -195,14 +195,16 @@ nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) data =nvbios_volt_parse (bios, &ver, &hdr, &cnt, &len, &info);if (data && info.vidmask && info.base && info.step && info.ranged) {nvkm_debug (subdev,"found ranged based VIDs\n" ); - volt->min_uv = info.min; - volt->max_uv = info.max;
Quoted 8 lines
drm/nouveau/nvkm/subdev/volt/base.c nvkm_volt_parse_bios(struct nvkm_bios *bios, struct nvkm_volt *volt) · line 202
Quoted 5 lines
drm/nouveau/nvkm/subdev/volt/base.c +2
-0+ volt->min_uv =0xffffffff ; + volt->max_uv =0 ;for (i =0 ; i < info.vidmask +1 ; i++) {if (info.base >= info.min && info.base <= info.max) {How bogus are info.min and info.max when you get that error? Is this if-statement still valid?
info.min is set to 0. and info.max to the base value. The vbios parsing is also a little incomplete, which I could fix instead as well.
Let me hack something up.
Quoted 13 lines
Quoted 11 lines
drm/nouveau/nvkm/subdev/volt/base.c +2
-0volt->vid[volt->vid_nr].uv = info.base; volt->vid[volt->vid_nr].vid = i; volt->vid_nr++; + volt->min_uv =min (volt->min_uv, info.base); + volt->max_uv = max(volt->max_uv,info.base); } info.base += info.step; }
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau