]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.60/drm-nouveau-fifo-gk104-poll-for-runlist-update-completion.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / drm-nouveau-fifo-gk104-poll-for-runlist-update-completion.patch
1 From foo@baz Sat Jul 28 10:25:26 CEST 2018
2 From: Ben Skeggs <bskeggs@redhat.com>
3 Date: Tue, 8 May 2018 20:39:46 +1000
4 Subject: drm/nouveau/fifo/gk104-: poll for runlist update completion
5
6 From: Ben Skeggs <bskeggs@redhat.com>
7
8 [ Upstream commit 4f2fc25c0f8bcc8db1b8a7b21e88c3d7f35c5acb ]
9
10 Newer HW doesn't appear to send this event, which will cause long delays
11 in runlist updates if they don't complete immediately.
12
13 RM doesn't use these events anywhere, and an NVGPU commit message notes
14 that polling is the preferred method even on HW that supports the event.
15
16 Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
17 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 8 ++++----
21 1 file changed, 4 insertions(+), 4 deletions(-)
22
23 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
24 +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
25 @@ -155,10 +155,10 @@ gk104_fifo_runlist_commit(struct gk104_f
26 (target << 28));
27 nvkm_wr32(device, 0x002274, (runl << 20) | nr);
28
29 - if (wait_event_timeout(fifo->runlist[runl].wait,
30 - !(nvkm_rd32(device, 0x002284 + (runl * 0x08))
31 - & 0x00100000),
32 - msecs_to_jiffies(2000)) == 0)
33 + if (nvkm_msec(device, 2000,
34 + if (!(nvkm_rd32(device, 0x002284 + (runl * 0x08)) & 0x00100000))
35 + break;
36 + ) < 0)
37 nvkm_error(subdev, "runlist %d update timeout\n", runl);
38 unlock:
39 mutex_unlock(&subdev->mutex);