aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3105-drm-amdkfd-kfd_mqd_manager_v10-Avoid-fall-through-wa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3105-drm-amdkfd-kfd_mqd_manager_v10-Avoid-fall-through-wa.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3105-drm-amdkfd-kfd_mqd_manager_v10-Avoid-fall-through-wa.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3105-drm-amdkfd-kfd_mqd_manager_v10-Avoid-fall-through-wa.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3105-drm-amdkfd-kfd_mqd_manager_v10-Avoid-fall-through-wa.patch
new file mode 100644
index 00000000..f4953dec
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3105-drm-amdkfd-kfd_mqd_manager_v10-Avoid-fall-through-wa.patch
@@ -0,0 +1,63 @@
+From d5098f7379f888812a7260397504fcaf13929e25 Mon Sep 17 00:00:00 2001
+From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
+Date: Mon, 22 Jul 2019 12:47:16 -0500
+Subject: [PATCH 3105/4256] drm/amdkfd/kfd_mqd_manager_v10: Avoid fall-through
+ warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In preparation to enabling -Wimplicit-fallthrough, this patch silences
+the following warning:
+
+drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c: In function ‘mqd_manager_init_v10’:
+./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]
+ #define __dynamic_func_call(id, fmt, func, ...) do { \
+ ^
+./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
+ __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
+ ^~~~~~~~~~~~~~~~~~~
+./include/linux/dynamic_debug.h:153:2: note: in expansion of macro ‘_dynamic_func_call’
+ _dynamic_func_call(fmt, __dynamic_pr_debug, \
+ ^~~~~~~~~~~~~~~~~~
+./include/linux/printk.h:336:2: note: in expansion of macro ‘dynamic_pr_debug’
+ dynamic_pr_debug(fmt, ##__VA_ARGS__)
+ ^~~~~~~~~~~~~~~~
+drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:432:3: note: in expansion of macro ‘pr_debug’
+ pr_debug("%s@%i\n", __func__, __LINE__);
+ ^~~~~~~~
+drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_mqd_manager_v10.c:433:2: note: here
+ case KFD_MQD_TYPE_COMPUTE:
+ ^~~~
+
+by removing the call to pr_debug() in KFD_MQD_TYPE_CP:
+
+"The mqd init for CP and COMPUTE will have the same routine." [1]
+
+This bug was found thanks to the ongoing efforts to enable
+-Wimplicit-fallthrough.
+
+[1] https://lore.kernel.org/lkml/c735a1cc-a545-50fb-44e7-c0ad93ee8ee7@amd.com/
+
+Reviewed-by: shaoyunl <shaoyun.liu@amd.com>
+Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
+index 0b68a17eb902..29d50d6af9d7 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
+@@ -429,7 +429,6 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type,
+
+ switch (type) {
+ case KFD_MQD_TYPE_CP:
+- pr_debug("%s@%i\n", __func__, __LINE__);
+ case KFD_MQD_TYPE_COMPUTE:
+ pr_debug("%s@%i\n", __func__, __LINE__);
+ mqd->allocate_mqd = allocate_mqd;
+--
+2.17.1
+