Re: [PATCH] drm/amdgpu: disable userptr if swiotlb is active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well in the worst case you could end up having a bounce buffer mapped instead of the real page.

Christian.

Am 20.02.19 um 18:02 schrieb Kuehling, Felix:
I guess we'll need something similar for KFD? I don't think we've ever
intentionally tested KFD with swiotlb. But I've seen some backtraces
with swiotlb in them before. I wonder how badly broken it is ...

Regards,
    Felix

On 2019-02-20 8:46 a.m., Christian König wrote:
Otherwise we can't be sure that we won't end up with a bounce buffer.

Signed-off-by: Christian König <christian.koenig@xxxxxxx>
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
   1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index d21dd2f369da..abc65633119b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -289,6 +289,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
   	if (offset_in_page(args->addr | args->size))
   		return -EINVAL;
+ /* We can't do this when swiotlb is active */
+	if (adev->needs_swiotlb)
+		return -ENXIO;
+
   	/* reject unknown flag values */
   	if (args->flags & ~(AMDGPU_GEM_USERPTR_READONLY |
   	    AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_VALIDATE |

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux