On Thu, Mar 21, 2019 at 04:59:14PM +0100, Tobias Klausmann wrote:
> Hi,
> 
> just for your information and maybe for some help: with 5.1rc1 and SVM
> enabled i see the following backtrace [1] when the nouveau card (reverse
> prime) goes to sleep, for now i have papered over with [2] which leaves me
> with userspace hangs. Any pointers where to look for the actual culprit?
> 
> PS: Card is: nouveau 0000:01:00.0: NVIDIA GP106 (136000a1)
> 
> Greetings,
> 
> Tobias

Can you check if attached patch fix the issue ?

Cheers,
Jérôme

>From 0304725edbaa3b828598a3babb785e6b9555af0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= <[email protected]>
Date: Thu, 21 Mar 2019 13:08:46 -0400
Subject: [PATCH] gpu/nouveau: initialize some fields of dmem no matter what
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On GPU that do not support device memory we left dmem fields uninitialized
and this lead to troube in suspend/resume which try to use those fields. It
seems best to initialize those fields no matter what.

Signed-off-by: Jérôme Glisse <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
---
 drivers/gpu/drm/nouveau/nouveau_dmem.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c 
b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index aa9fec80492d..35b6e83ead8a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c
@@ -593,6 +593,11 @@ nouveau_dmem_init(struct nouveau_drm *drm)
        unsigned long i, size;
        int ret;
 
+       mutex_init(&drm->dmem->mutex);
+       INIT_LIST_HEAD(&drm->dmem->chunk_free);
+       INIT_LIST_HEAD(&drm->dmem->chunk_full);
+       INIT_LIST_HEAD(&drm->dmem->chunk_empty);
+
        /* This only make sense on PASCAL or newer */
        if (drm->client.device.info.family < NV_DEVICE_INFO_V0_PASCAL)
                return;
@@ -600,11 +605,6 @@ nouveau_dmem_init(struct nouveau_drm *drm)
        if (!(drm->dmem = kzalloc(sizeof(*drm->dmem), GFP_KERNEL)))
                return;
 
-       mutex_init(&drm->dmem->mutex);
-       INIT_LIST_HEAD(&drm->dmem->chunk_free);
-       INIT_LIST_HEAD(&drm->dmem->chunk_full);
-       INIT_LIST_HEAD(&drm->dmem->chunk_empty);
-
        size = ALIGN(drm->client.device.info.ram_user, DMEM_CHUNK_SIZE);
 
        /* Initialize migration dma helpers before registering memory */
-- 
2.17.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to