Commit 53d206bb authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs

drm/nouveau/bar: only ioremap BAR3 if it exists

Some chips that use system memory exclusively (e.g. GK20A) do not
expose 2 BAR regions. For them only BAR1 exists, and it should be used
for USERD mapping. Do not map BAR3 if its resource does not exist.
Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 4c0dae57
...@@ -118,8 +118,10 @@ nouveau_bar_create_(struct nouveau_object *parent, ...@@ -118,8 +118,10 @@ nouveau_bar_create_(struct nouveau_object *parent,
if (ret) if (ret)
return ret; return ret;
bar->iomem = ioremap(nv_device_resource_start(device, 3), if (nv_device_resource_len(device, 3) != 0)
nv_device_resource_len(device, 3)); bar->iomem = ioremap(nv_device_resource_start(device, 3),
nv_device_resource_len(device, 3));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment