volt: Fix for some cards having 0 maximum voltage

Submitted by Mark Menzynski on Aug. 2, 2019, 9:21 a.m.

Details

Message ID 20190802092100.5897-1-mmenzyns@redhat.com
State New
Headers show
Series "volt: Fix for some cards having 0 maximum voltage" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Mark Menzynski Aug. 2, 2019, 9:21 a.m.
Some, mostly Fermi, vbioses appear to have zero max voltage. That causes Nouveau to not parse voltage entries, thus users not being able to set higher clocks.

When changing this value Nvidia driver still appeared to ignore it, and I wasn't able to find out why, thus the code is ignoring the value if it is zero.

CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Mark Menzynski <mmenzyns@redhat.com>
---
 drm/nouveau/nvkm/subdev/bios/volt.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/nvkm/subdev/bios/volt.c b/drm/nouveau/nvkm/subdev/bios/volt.c
index 7143ea46..33a9fb5a 100644
--- a/drm/nouveau/nvkm/subdev/bios/volt.c
+++ b/drm/nouveau/nvkm/subdev/bios/volt.c
@@ -96,6 +96,8 @@  nvbios_volt_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
 		info->min     = min(info->base,
 				    info->base + info->step * info->vidmask);
 		info->max     = nvbios_rd32(bios, volt + 0x0e);
+		if (!info->max)
+			info->max = max(info->base, info->base + info->step * info->vidmask);
 		break;
 	case 0x50:
 		info->min     = nvbios_rd32(bios, volt + 0x0a);

Comments

although I'd like to have a deeper understanding of this table, I
think it's fine as it is right now and this actually does fix
something without causing any issues (as far as we know of)

Reviewed-by: Karol Herbst <kherbst@redhat.com>

On Fri, Aug 2, 2019 at 11:21 AM Mark Menzynski <mmenzyns@redhat.com> wrote:
>
> Some, mostly Fermi, vbioses appear to have zero max voltage. That causes Nouveau to not parse voltage entries, thus users not being able to set higher clocks.
>
> When changing this value Nvidia driver still appeared to ignore it, and I wasn't able to find out why, thus the code is ignoring the value if it is zero.
>
> CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Mark Menzynski <mmenzyns@redhat.com>
> ---
>  drm/nouveau/nvkm/subdev/bios/volt.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drm/nouveau/nvkm/subdev/bios/volt.c b/drm/nouveau/nvkm/subdev/bios/volt.c
> index 7143ea46..33a9fb5a 100644
> --- a/drm/nouveau/nvkm/subdev/bios/volt.c
> +++ b/drm/nouveau/nvkm/subdev/bios/volt.c
> @@ -96,6 +96,8 @@ nvbios_volt_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
>                 info->min     = min(info->base,
>                                     info->base + info->step * info->vidmask);
>                 info->max     = nvbios_rd32(bios, volt + 0x0e);
> +               if (!info->max)
> +                       info->max = max(info->base, info->base + info->step * info->vidmask);
>                 break;
>         case 0x50:
>                 info->min     = nvbios_rd32(bios, volt + 0x0a);
> --
> 2.21.0
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau