drm/nouveau/falcon: avoid touching registers if engine is off
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 14 Dec 2018 03:44:08 +0000 (22:44 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 11 Jan 2019 06:25:54 +0000 (16:25 +1000)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/falcon.c

index 816ccaedfc7326581befc7fb7f2b39607325c903..8675613e142b64a54ac6a2acf8dd0afb934dc7e5 100644 (file)
@@ -22,6 +22,7 @@
 #include <engine/falcon.h>
 
 #include <core/gpuobj.h>
+#include <subdev/mc.h>
 #include <subdev/timer.h>
 #include <engine/fifo.h>
 
@@ -107,8 +108,10 @@ nvkm_falcon_fini(struct nvkm_engine *engine, bool suspend)
                }
        }
 
-       nvkm_mask(device, base + 0x048, 0x00000003, 0x00000000);
-       nvkm_wr32(device, base + 0x014, 0xffffffff);
+       if (nvkm_mc_enabled(device, engine->subdev.index)) {
+               nvkm_mask(device, base + 0x048, 0x00000003, 0x00000000);
+               nvkm_wr32(device, base + 0x014, 0xffffffff);
+       }
        return 0;
 }