Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu/userq: call dma_resv_wait_timeout without test for signalled

In function amdgpu_userq_gem_va_unmap_validate call
dma_resv_wait_timeout directly. Also since we are waiting
forever we should not be having any return value and hence
no handling needed.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sunil Khatri and committed by
Alex Deucher
38476bde 4c86e12a

+11 -23
+6 -13
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
··· 1462 1462 return ret; 1463 1463 } 1464 1464 1465 - int amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev, 1466 - struct amdgpu_bo_va_mapping *mapping, 1467 - uint64_t saddr) 1465 + void amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev, 1466 + struct amdgpu_bo_va_mapping *mapping, 1467 + uint64_t saddr) 1468 1468 { 1469 1469 u32 ip_mask = amdgpu_userq_get_supported_ip_mask(adev); 1470 1470 struct amdgpu_bo_va *bo_va = mapping->bo_va; 1471 1471 struct dma_resv *resv = bo_va->base.bo->tbo.base.resv; 1472 - int ret = 0; 1473 1472 1474 1473 if (!ip_mask) 1475 - return 0; 1474 + return; 1476 1475 1477 1476 dev_warn_once(adev->dev, "now unmapping a vital queue va:%llx\n", saddr); 1478 1477 /** ··· 1482 1483 * unmap is only for one kind of userq VAs, so at this point suppose 1483 1484 * the eviction fence is always unsignaled. 1484 1485 */ 1485 - if (!dma_resv_test_signaled(resv, DMA_RESV_USAGE_BOOKKEEP)) { 1486 - ret = dma_resv_wait_timeout(resv, DMA_RESV_USAGE_BOOKKEEP, true, 1487 - MAX_SCHEDULE_TIMEOUT); 1488 - if (ret <= 0) 1489 - return -EBUSY; 1490 - } 1491 - 1492 - return 0; 1486 + dma_resv_wait_timeout(resv, DMA_RESV_USAGE_BOOKKEEP, 1487 + false, MAX_SCHEDULE_TIMEOUT); 1493 1488 } 1494 1489 1495 1490 void amdgpu_userq_pre_reset(struct amdgpu_device *adev)
+3 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
··· 160 160 int amdgpu_userq_input_va_validate(struct amdgpu_device *adev, 161 161 struct amdgpu_usermode_queue *queue, 162 162 u64 addr, u64 expected_size); 163 - int amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev, 164 - struct amdgpu_bo_va_mapping *mapping, 165 - uint64_t saddr); 163 + void amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev, 164 + struct amdgpu_bo_va_mapping *mapping, 165 + uint64_t saddr); 166 166 #endif
+2 -7
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 1978 1978 struct amdgpu_bo_va_mapping *mapping; 1979 1979 struct amdgpu_vm *vm = bo_va->base.vm; 1980 1980 bool valid = true; 1981 - int r; 1982 1981 1983 1982 saddr /= AMDGPU_GPU_PAGE_SIZE; 1984 1983 ··· 2002 2003 * during user requests GEM unmap IOCTL except for forcing the unmap 2003 2004 * from user space. 2004 2005 */ 2005 - if (unlikely(atomic_read(&bo_va->userq_va_mapped) > 0)) { 2006 - r = amdgpu_userq_gem_va_unmap_validate(adev, mapping, saddr); 2007 - if (unlikely(r == -EBUSY)) 2008 - dev_warn_once(adev->dev, 2009 - "Attempt to unmap an active userq buffer\n"); 2010 - } 2006 + if (unlikely(atomic_read(&bo_va->userq_va_mapped) > 0)) 2007 + amdgpu_userq_gem_va_unmap_validate(adev, mapping, saddr); 2011 2008 2012 2009 list_del(&mapping->list); 2013 2010 amdgpu_vm_it_remove(mapping, &vm->va);