Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1045109

Bug#976788: Patch to fix: nouveau DRM timeout causes machine to freeze

From Philip Stewart <philip.stewart.public@gmail.com>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#976788: Patch to fix: nouveau DRM timeout causes machine to freeze
Date 2021-01-28 22:40 +0100
Message-ID <BCnbb-6DG-3@gated-at.bofh.it> (permalink)
References <Bjxup-5Bc-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


Hi,

A patch [1] has been proposed by Bastian Beranek [2] to fix the issue. 
The issue has been found to affect NV50/Tesla GPUs on kernels 5.9+ and 
renders the system unusable.

I've personally tested the patch (and its earlier variant) on the 5.10 
kernel for the past couple of weeks without issue and it has passed an 
initial review [3] by the nouveau maintainers.

The upstream patch appears to be some way off making it into mainline 
before it can be backported to 5.10, so given the scope and effects of 
the bug, I'm submitting it here to be considered to patch the bullseye 
kernel in the interim.

I include the contents of the patch at the end of this mail for your 
convenience.

Cheers,
Phil


[1] 
https://gitlab.freedesktop.org/drm/nouveau/uploads/8844d508dbe905daf9802007dc1c7e03/0001-drm-gpu-nouveau-dispnv50-Restore-pushing-of-all-data.patch
[2] https://gitlab.freedesktop.org/drm/nouveau/-/issues/14#note_773217
[3] 
https://lists.freedesktop.org/archives/nouveau/2021-January/037782.html

------

 From 7fcdc2555c9055049c0bc67866012e9dc9b49d89 Mon Sep 17 00:00:00 2001
 From: Bastian Beranek <bastian.beischer@rwth-aachen.de>
Date: Mon, 18 Jan 2021 13:19:32 +0100
Subject: [PATCH v3] drm/gpu/nouveau/dispnv50: Restore pushing of all 
data.

Commit f844eb485eb056ad3b67e49f95cbc6c685a73db4 introduced a regression 
for
NV50, which lead to visual artifacts, tearing and eventual crashes.

In the changes of f844eb485eb056ad3b67e49f95cbc6c685a73db4 only the 
first line
was correctly translated to the new NVIDIA header macros:

- PUSH_NVSQ(push, NV827C, 0x0110, 0,
- 0x0114, 0);
+ PUSH_MTHD(push, NV827C, SET_PROCESSING,
+ NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));

The lower part ("0x0114, 0") was probably omitted by accident.

This patch restores the push of the missing data and fixes the 
regression.

Signed-off-by: Bastian Beranek <bastian.beischer@rwth-aachen.de>
Fixes: f844eb485eb056ad3b67e49f95cbc6c685a73db4
Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/14
---
 drivers/gpu/drm/nouveau/dispnv50/base507c.c | 6 +++++-
 drivers/gpu/drm/nouveau/dispnv50/base827c.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/base507c.c 
b/drivers/gpu/drm/nouveau/dispnv50/base507c.c
index 302d4e6fc52f..788db043a342 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/base507c.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/base507c.c
@@ -88,7 +88,11 @@ base507c_image_set(struct nv50_wndw *wndw, struct 
nv50_wndw_atom *asyw)
      NVVAL(NV507C, SET_CONVERSION, OFS, 0x64));
  } else {
   PUSH_MTHD(push, NV507C, SET_PROCESSING,
- NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
+ NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
+
+ SET_CONVERSION,
+ NVVAL(NV507C, SET_CONVERSION, GAIN, 0) |
+ NVVAL(NV507C, SET_CONVERSION, OFS, 0));
  }

  PUSH_MTHD(push, NV507C, SURFACE_SET_OFFSET(0, 0), 
asyw->image.offset[0] >> 8);
diff --git a/drivers/gpu/drm/nouveau/dispnv50/base827c.c 
b/drivers/gpu/drm/nouveau/dispnv50/base827c.c
index 18d34096f125..093d4ba6910e 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/base827c.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/base827c.c
@@ -49,7 +49,11 @@ base827c_image_set(struct nv50_wndw *wndw, struct 
nv50_wndw_atom *asyw)
      NVVAL(NV827C, SET_CONVERSION, OFS, 0x64));
  } else {
   PUSH_MTHD(push, NV827C, SET_PROCESSING,
- NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
+ NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
+
+ SET_CONVERSION,
+ NVVAL(NV827C, SET_CONVERSION, GAIN, 0) |
+ NVVAL(NV827C, SET_CONVERSION, OFS, 0));
  }

  PUSH_MTHD(push, NV827C, SURFACE_SET_OFFSET(0, 0), 
asyw->image.offset[0] >> 8,
-- 
2.30.0

Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread


Thread

Bug#976788: Patch to fix: nouveau DRM timeout causes machine to freeze Philip Stewart <philip.stewart.public@gmail.com> - 2021-01-28 22:40 +0100

csiph-web