]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/nouveau/pmu/tu102-: prepare for GSP-RM
authorBen Skeggs <bskeggs@redhat.com>
Mon, 18 Sep 2023 20:21:23 +0000 (06:21 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 31 Oct 2023 05:08:12 +0000 (15:08 +1000)
- disable PMU completely when GSP-RM detected

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-19-skeggsb@gmail.com
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c

index cd3148360996f24964f9f892524672ddacbc8168..da5b2b2190d3d6f741dc1f7eb06dc3ca3519bfcb 100644 (file)
@@ -23,6 +23,8 @@
  */
 #include "priv.h"
 
+#include <subdev/gsp.h>
+
 static const struct nvkm_falcon_func
 gp102_pmu_flcn = {
        .disable = gm200_flcn_disable,
@@ -54,5 +56,8 @@ int
 gp102_pmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
              struct nvkm_pmu **ppmu)
 {
+       if (nvkm_gsp_rm(device->gsp))
+               return -ENODEV;
+
        return nvkm_pmu_new_(gp102_pmu_fwif, device, type, inst, ppmu);
 }