Skip to content

Commit d22915d

Browse files
Ben SkeggsLyude
authored andcommitted
drm/nouveau/devinit/tu102-: wait for GFW_BOOT_PROGRESS == COMPLETED
Starting from Turing, the driver is no longer responsible for initiating DEVINIT when required as the GPU started loading a FW image from ROM and executing DEVINIT itself after power-on. However - we apparently still need to wait for it to complete. This should correct some issues with runpm on some systems, where we get control of the HW before it's been fully reinitialised after resume from suspend. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230130223715.1831509-1-bskeggs@redhat.com
1 parent d2ceea0 commit d22915d

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • drivers/gpu/drm/nouveau/nvkm/subdev/devinit

drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,33 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)
6565
return ret;
6666
}
6767

68+
static int
69+
tu102_devinit_wait(struct nvkm_device *device)
70+
{
71+
unsigned timeout = 50 + 2000;
72+
73+
do {
74+
if (nvkm_rd32(device, 0x118128) & 0x00000001) {
75+
if ((nvkm_rd32(device, 0x118234) & 0x000000ff) == 0xff)
76+
return 0;
77+
}
78+
79+
usleep_range(1000, 2000);
80+
} while (timeout--);
81+
82+
return -ETIMEDOUT;
83+
}
84+
6885
int
6986
tu102_devinit_post(struct nvkm_devinit *base, bool post)
7087
{
7188
struct nv50_devinit *init = nv50_devinit(base);
89+
int ret;
90+
91+
ret = tu102_devinit_wait(init->base.subdev.device);
92+
if (ret)
93+
return ret;
94+
7295
gm200_devinit_preos(init, post);
7396
return 0;
7497
}

0 commit comments

Comments
 (0)