Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu amdgpu: Call idr_p...
details: https://anonhg.NetBSD.org/src/rev/ace925595384
branches: trunk
changeset: 1028934:ace925595384
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 12:31:04 2021 +0000
description:
amdgpu: Call idr_preload(_end) around idr_alloc, outside lock.
diffstat:
sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (44 lines):
diff -r 14bc5ea79a0c -r ace925595384 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c Sun Dec 19 12:30:56 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c Sun Dec 19 12:31:04 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amdgpu_vm.c,v 1.8 2021/12/19 12:30:47 riastradh Exp $ */
+/* $NetBSD: amdgpu_vm.c,v 1.9 2021/12/19 12:31:04 riastradh Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
* Jerome Glisse
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_vm.c,v 1.8 2021/12/19 12:30:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_vm.c,v 1.9 2021/12/19 12:31:04 riastradh Exp $");
#include <linux/dma-fence-array.h>
#include <linux/interval_tree_generic.h>
@@ -2900,10 +2900,12 @@
if (pasid) {
unsigned long flags;
+ idr_preload(GFP_ATOMIC);
spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags);
r = idr_alloc(&adev->vm_manager.pasid_idr, vm, pasid, pasid + 1,
GFP_ATOMIC);
spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags);
+ idr_preload_end();
if (r < 0)
goto error_free_root;
@@ -3007,10 +3009,12 @@
if (pasid) {
unsigned long flags;
+ idr_preload(GFP_ATOMIC);
spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags);
r = idr_alloc(&adev->vm_manager.pasid_idr, vm, pasid, pasid + 1,
GFP_ATOMIC);
spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags);
+ idr_preload_end();
if (r == -ENOSPC)
goto unreserve_bo;
Home |
Main Index |
Thread Index |
Old Index