Skip to content

Commit 45655ff

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/bar/tu102-: prepare for GSP-RM
- (temporarily) disable if GSP-RM detected, will be added later - move BAR2 teardown from dtor(), it doesn't belong there Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 74e2011 commit 45655ff

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/bar/base.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,16 @@ static int
9393
nvkm_bar_fini(struct nvkm_subdev *subdev, bool suspend)
9494
{
9595
struct nvkm_bar *bar = nvkm_bar(subdev);
96+
97+
if (!subdev->use.enabled)
98+
return 0;
99+
96100
if (bar->func->bar1.fini)
97101
bar->func->bar1.fini(bar);
102+
103+
if (!suspend) /* Handled by instmem. */
104+
nvkm_bar_bar2_fini(subdev->device);
105+
98106
return 0;
99107
}
100108

@@ -120,7 +128,7 @@ static void *
120128
nvkm_bar_dtor(struct nvkm_subdev *subdev)
121129
{
122130
struct nvkm_bar *bar = nvkm_bar(subdev);
123-
nvkm_bar_bar2_fini(subdev->device);
131+
124132
return bar->func->dtor(bar);
125133
}
126134

drivers/gpu/drm/nouveau/nvkm/subdev/bar/tu102.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "gf100.h"
2323

2424
#include <core/memory.h>
25+
#include <subdev/gsp.h>
2526
#include <subdev/timer.h>
2627

2728
static void
@@ -95,5 +96,8 @@ int
9596
tu102_bar_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
9697
struct nvkm_bar **pbar)
9798
{
99+
if (nvkm_gsp_rm(device->gsp))
100+
return -ENODEV;
101+
98102
return gf100_bar_new_(&tu102_bar, device, type, inst, pbar);
99103
}

0 commit comments

Comments
 (0)