Skip to content

Commit 8a39db7

Browse files
author
Ben Skeggs
committed
drm/nouveau/ttm: evict other IO mappings when running out of BAR1 space
Signed-off-by: Ben Skeggs <[email protected]>
1 parent 0e7e619 commit 8a39db7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,8 +1494,13 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
14941494
ret = nvif_object_map_handle(&mem->mem.object,
14951495
&args, argc,
14961496
&handle, &length);
1497-
if (ret != 1)
1498-
return ret ? ret : -EINVAL;
1497+
if (ret != 1) {
1498+
if (WARN_ON(ret == 0))
1499+
return -EINVAL;
1500+
if (ret == -ENOSPC)
1501+
return -EAGAIN;
1502+
return ret;
1503+
}
14991504

15001505
reg->bus.base = 0;
15011506
reg->bus.offset = handle;

0 commit comments

Comments
 (0)