aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1403-drm-amdkfd-kfd_chardev.c-Reconcile-code-with-upstrea.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/1403-drm-amdkfd-kfd_chardev.c-Reconcile-code-with-upstrea.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/1403-drm-amdkfd-kfd_chardev.c-Reconcile-code-with-upstrea.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/1403-drm-amdkfd-kfd_chardev.c-Reconcile-code-with-upstrea.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/1403-drm-amdkfd-kfd_chardev.c-Reconcile-code-with-upstrea.patch
new file mode 100644
index 00000000..5996e285
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/1403-drm-amdkfd-kfd_chardev.c-Reconcile-code-with-upstrea.patch
@@ -0,0 +1,80 @@
+From c1dc0f92abe5116f4061ac03173da7d9dc3b8d13 Mon Sep 17 00:00:00 2001
+From: Kent Russell <kent.russell@amd.com>
+Date: Tue, 5 Jul 2016 10:59:48 -0400
+Subject: [PATCH 1403/4131] drm/amdkfd/kfd_chardev.c: Reconcile code with
+ upstream
+
+Reconcile the address_watch and wave_control functions so that they line
+up with upstream.
+
+Change-Id: I46d5cbdc98c9700c2693a8eedef12ff6e9a9a84b
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+index 595640a..fa55d99 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+@@ -596,6 +596,7 @@ kfd_ioctl_dbg_address_watch(struct file *filep,
+ struct dbg_address_watch_info aw_info;
+ unsigned char *args_buff = NULL;
+ unsigned int args_idx = 0;
++ void __user *cmd_from_user;
+ uint64_t watch_mask_value = 0;
+
+ memset((void *) &aw_info, 0, sizeof(struct dbg_address_watch_info));
+@@ -609,6 +610,8 @@ kfd_ioctl_dbg_address_watch(struct file *filep,
+ break;
+ }
+
++ cmd_from_user = (void __user *) args->content_ptr;
++
+ if (args->buf_size_in_bytes > MAX_ALLOWED_AW_BUFF_SIZE) {
+ status = -EINVAL;
+ break;
+@@ -621,14 +624,6 @@ kfd_ioctl_dbg_address_watch(struct file *filep,
+
+ /* this is the actual buffer to work with */
+
+- args_buff = kzalloc(args->buf_size_in_bytes -
+- sizeof(*args), GFP_KERNEL);
+- if (args_buff == NULL) {
+- status = -ENOMEM;
+- break;
+- }
+-
+- /* this is the actual buffer to work with */
+ args_buff = memdup_user(cmd_from_user,
+ args->buf_size_in_bytes - sizeof(*args));
+ if (IS_ERR(args_buff))
+@@ -711,6 +706,7 @@ kfd_ioctl_dbg_wave_control(struct file *filep, struct kfd_process *p, void *data
+ struct dbg_wave_control_info wac_info;
+ unsigned char *args_buff = NULL;
+ unsigned int args_idx = 0;
++ void __user *cmd_from_user;
+ uint32_t computed_buff_size;
+
+ memset((void *) &wac_info, 0, sizeof(struct dbg_wave_control_info));
+@@ -744,12 +740,14 @@ kfd_ioctl_dbg_wave_control(struct file *filep, struct kfd_process *p, void *data
+ break;
+ }
+
+- /* copy the entire buffer from user */
++ cmd_from_user = (void __user *) args->content_ptr;
+
+- args_buff = memdup_user(cmd_from_user,
++ /* copy the entire buffer from user */
++
++ args_buff = memdup_user(cmd_from_user,
+ args->buf_size_in_bytes - sizeof(*args));
+- if (IS_ERR(args_buff))
+- return PTR_ERR(args_buff);
++ if (IS_ERR(args_buff))
++ return PTR_ERR(args_buff);
+
+ if (copy_from_user(args_buff,
+ (void __user *) args->content_ptr,
+--
+2.7.4
+