diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/4292-drm-amdkfd-Simplify-obj-handle-allocation.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.14.71/4292-drm-amdkfd-Simplify-obj-handle-allocation.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/4292-drm-amdkfd-Simplify-obj-handle-allocation.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/4292-drm-amdkfd-Simplify-obj-handle-allocation.patch new file mode 100644 index 00000000..28bfdfae --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/4292-drm-amdkfd-Simplify-obj-handle-allocation.patch @@ -0,0 +1,51 @@ +From 9a909d46cdc3369acaeab9768cf4e77b49409e6f Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Thu, 26 Apr 2018 15:11:48 -0400 +Subject: [PATCH 4292/5725] drm/amdkfd: Simplify obj handle allocation + +MIN and MAX_IDR_IDs aren't necessary because the entire ID range is +fine for this purpose, including 0. + +Don't use the idr_preload functionality. This is meant for situations +where an ID allocation is done in a place where it cannot fail. Then +idr_preload can be done in a place where it's still OK to fail. Here +both are in the same place, so it's not necessary to preload the memory +allocation. + +Change-Id: I484657cd43904b546a5c605b766955925068ff99 +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +--- + drivers/gpu/drm/amd/amdkfd/kfd_process.c | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c +index ecee955..f62baaa 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c +@@ -60,9 +60,6 @@ static struct workqueue_struct *kfd_process_wq; + */ + static struct workqueue_struct *kfd_restore_wq; + +-#define MIN_IDR_ID 1 +-#define MAX_IDR_ID 0 /*0 - for unlimited*/ +- + static struct kfd_process *find_process(const struct task_struct *thread, + bool ref); + static void kfd_process_ref_release(struct kref *ref); +@@ -842,12 +839,7 @@ int kfd_process_device_create_obj_handle(struct kfd_process_device *pdd, + + INIT_LIST_HEAD(&buf_obj->cb_data_head); + +- idr_preload(GFP_KERNEL); +- +- handle = idr_alloc(&pdd->alloc_idr, buf_obj, MIN_IDR_ID, MAX_IDR_ID, +- GFP_NOWAIT); +- +- idr_preload_end(); ++ handle = idr_alloc(&pdd->alloc_idr, buf_obj, 0, 0, GFP_KERNEL); + + if (handle < 0) + kfree(buf_obj); +-- +2.7.4 + |