From: Ben Skeggs Date: Tue, 31 Oct 2017 17:56:19 +0000 (+1000) Subject: drm/nouveau/imem/nv50: prevent fast-path for mapped objects when BAR isn't ready X-Git-Tag: v4.19~1787^2^2~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69b136f200006ee37b039195eaeb08942c419ecc;p=platform%2Fkernel%2Flinux-rpi3.git 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 --- diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c index ec2904a..1a254e6 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)