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>
}
/* 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)