First patch fixes a potential vbios parsing bug on Fermi GPUs, but it may also affect Kepler ones. Second patch wakes the GPU up whenever the user tries to reclock to prevent the write to the pstate file from freezing. Karol Herbst (2): bios/vpstate: There are some fermi vbios with no boost or tdp entry debugfs: Wake up GPU before doing any reclocking drm/nouveau/nouveau_debugfs.c | 4 ++++ drm/nouveau/nvkm/subdev/bios/vpstate.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) -- 2.17.1
Karol Herbst
2018-Jul-14 10:52 UTC
[Nouveau] [PATCH 1/2] bios/vpstate: There are some fermi vbios with no boost or tdp entry
From: Karol Herbst <karolherbst at gmail.com> If the entry size is too small, default to invalid values for both boost_id and tdp_id, so as to default to the base clock in both cases. Signed-off-by: Karol Herbst <karolherbst at gmail.com> Signed-off-by: Martin Peres <martin.peres at free.fr> --- drm/nouveau/nvkm/subdev/bios/vpstate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/bios/vpstate.c b/drm/nouveau/nvkm/subdev/bios/vpstate.c index 20b6fc82..71524548 100644 --- a/drm/nouveau/nvkm/subdev/bios/vpstate.c +++ b/drm/nouveau/nvkm/subdev/bios/vpstate.c @@ -58,8 +58,14 @@ nvbios_vpstate_parse(struct nvkm_bios *b, struct nvbios_vpstate_header *h) h->ecount = nvbios_rd08(b, h->offset + 0x5); h->base_id = nvbios_rd08(b, h->offset + 0x0f); - h->boost_id = nvbios_rd08(b, h->offset + 0x10); - h->tdp_id = nvbios_rd08(b, h->offset + 0x11); + if (h->hlen > 0x10) + h->boost_id = nvbios_rd08(b, h->offset + 0x10); + else + h->boost_id = 0xff; + if (h->hlen > 0x11) + h->tdp_id = nvbios_rd08(b, h->offset + 0x11); + else + h->tdp_id = 0xff; return 0; default: return -EINVAL; -- 2.17.1
Karol Herbst
2018-Jul-14 10:52 UTC
[Nouveau] [PATCH 2/2] debugfs: Wake up GPU before doing any reclocking
From: Karol Herbst <karolherbst at gmail.com> Fixes various reclocking related issues on prime systems. Signed-off-by: Karol Herbst <karolherbst at gmail.com> Signed-off-by: Martin Peres <martin.peres at free.fr> --- drm/nouveau/nouveau_debugfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c index 963a4dba..9109b69c 100644 --- a/drm/nouveau/nouveau_debugfs.c +++ b/drm/nouveau/nouveau_debugfs.c @@ -160,7 +160,11 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf, args.ustate = value; } + ret = pm_runtime_get_sync(drm->dev); + if (IS_ERR_VALUE(ret) && ret != -EACCES) + return ret; ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args)); + pm_runtime_put_autosuspend(drm->dev); if (ret < 0) return ret; -- 2.17.1
Possibly Parallel Threads
- [PATCH 01/32] bios/vpstate: There are some fermi vbios with no boost or tdp entry
- [PATCH 00/32] Updated State of my clk patches
- [PATCH v5 00/20] Engine Reclocking Fixes for Fermi-Maxwell2
- [RFC PATCH 00/29] Current State of my clk patches
- [PATCH 01/32] bios/vpstate: There are some fermi vbios with no boost or tdp entry