aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-11-01 03:56:19 +1000
committerBen Skeggs <bskeggs@redhat.com>2017-11-02 13:32:19 +1000
commit69b136f200006ee37b039195eaeb08942c419ecc (patch)
tree83497ca98b3d7500d2a6ce5824c7d3d581409409 /drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
parentdrm/nouveau/imem/nv50: map bar2 write-combined (diff)
downloadlinux-dev-69b136f200006ee37b039195eaeb08942c419ecc.tar.xz
linux-dev-69b136f200006ee37b039195eaeb08942c419ecc.zip
drm/nouveau/imem/nv50: prevent fast-path for mapped objects when BAR isn't ready
Another piece of solving the "GP100 BAR2 VMM bootstrap" puzzle. Without doing this, we'd attempt to write PDEs for the lower page table levels through BAR2 before BAR2 access has been fully initialised. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
index ec2904a0e9fc..1a254e69fece 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
@@ -196,9 +196,11 @@ nv50_instobj_acquire(struct nvkm_memory *memory)
}
/* Attempt to get a direct CPU mapping of the object. */
- if (!iobj->map && (vmm = nvkm_bar_bar2_vmm(imem->subdev.device)))
- nv50_instobj_kmap(iobj, vmm);
- map = iobj->map;
+ if ((vmm = nvkm_bar_bar2_vmm(imem->subdev.device))) {
+ if (!iobj->map)
+ nv50_instobj_kmap(iobj, vmm);
+ map = iobj->map;
+ }
if (!refcount_inc_not_zero(&iobj->maps)) {
if (map)