diff --git a/patches/mainline/20250918_guodong_dmaengine_mmp_pdma_fix_dma_mask_handling.patch b/patches/mainline/88ebb29d3244e515a92c2331434bb73fef7efdc6.patch similarity index 67% rename from patches/mainline/20250918_guodong_dmaengine_mmp_pdma_fix_dma_mask_handling.patch rename to patches/mainline/88ebb29d3244e515a92c2331434bb73fef7efdc6.patch index 60db81be..e81f989d 100644 --- a/patches/mainline/20250918_guodong_dmaengine_mmp_pdma_fix_dma_mask_handling.patch +++ b/patches/mainline/88ebb29d3244e515a92c2331434bb73fef7efdc6.patch @@ -1,11 +1,7 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] dmaengine: mmp_pdma: fix DMA mask handling +From 88ebb29d3244e515a92c2331434bb73fef7efdc6 Mon Sep 17 00:00:00 2001 From: Guodong Xu Date: Thu, 18 Sep 2025 22:27:27 +0800 -Message-Id: <20250918-mmp-pdma-simplify-dma-addressing-v1-1-5c2be2b85696@riscstar.com> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit +Subject: dmaengine: mmp_pdma: fix DMA mask handling The driver's existing logic for setting the DMA mask for "marvell,pdma-1.0" was flawed. It incorrectly relied on pdev->dev->coherent_dma_mask instead @@ -36,47 +32,18 @@ Reported-by: Naresh Kamboju Closes: https://lore.kernel.org/lkml/CA+G9fYsPcMfW-e_0_TRqu4cnwqOqYF3aJOeKUYk6Z4qRStdFvg@mail.gmail.com Suggested-by: Arnd Bergmann Signed-off-by: Guodong Xu -Tested-by: Naresh Kamboju -Tested-by: Nathan Chancellor # build Reviewed-by: Arnd Bergmann -Link: https://patch.msgid.link/20250918-mmp-pdma-simplify-dma-addressing-v1-1-5c2be2b85696@riscstar.com +Tested-by: Nathan Chancellor # build +Tested-by: Naresh Kamboju +Signed-off-by: Vinod Koul --- -Hi Vinod, Arnd, and all, - -This patch fixes a build failure in the mmp_pdma driver when using -clang-20, as reported by Naresh Kamboju [1]. The error, -a -Wshift-count-overflow warning, is caused by a known issue in the clang -compiler. When the DMA_BIT_MASK(64) macro is used in a static initializer, -it triggers a long-standing bug in how clang evaluates compile-time -constants [2, 3]. Thanks to Nathan Chancellor for providing these links. - -While investigating this, Arnd Bergmann pointed out that the driver's -logic for setting the DMA mask was unnecessarily complex. This logic, -which was inherited from the original Marvel PDMA driver when adding -support for SpacemiT K1 DMA, could be simplified. A better solution is to -set each device's DMA mask directly based on its hardware capability. - -This patch implements Arnd's suggestion. It refactors the driver to store -the controller's DMA width (either 32 or 64 bits) and generates the mask -at runtime within the probe() function. - -This approach also avoids the clang false error reporting. - -This patch is based on dmaengine.git next [4]. - -Thanks, -Guodong Xu - -[1] https://lore.kernel.org/lkml/CA+G9fYsPcMfW-e_0_TRqu4cnwqOqYF3aJOeKUYk6Z4qRStdFvg@mail.gmail.com/ -[2] https://github.com/ClangBuiltLinux/linux/issues/92 -[3] https://github.com/llvm/llvm-project/issues/38137 -[4] https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/log/?h=next +Link: https://git.kernel.org/vkoul/dmaengine/p/88ebb29d3244e515a92c2331434bb73fef7efdc6 --- drivers/dma/mmp_pdma.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c -index d07229a748868b8115892c63c54c16130d88e326..86661eb3cde1ff6d6d8f02b6f0d4142878b5a890 100644 +index d07229a748868b..86661eb3cde1ff 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -152,8 +152,8 @@ struct mmp_pdma_phy { @@ -134,12 +101,6 @@ index d07229a748868b8115892c63c54c16130d88e326..86661eb3cde1ff6d6d8f02b6f0d41428 ret = dma_async_device_register(&pdev->device); if (ret) { - ---- -base-commit: cc0bacac6de7763a038550cf43cb94634d8be9cd -change-id: 20250904-mmp-pdma-simplify-dma-addressing-f6aef03e07c3 - -Best regards, -- -Guodong Xu +cgit 1.2.3-korg diff --git a/patches/mainline/c710de671789388b3af1046c7091685594ec44d9.patch b/patches/mainline/c710de671789388b3af1046c7091685594ec44d9.patch deleted file mode 100644 index f03851f0..00000000 --- a/patches/mainline/c710de671789388b3af1046c7091685594ec44d9.patch +++ /dev/null @@ -1,88 +0,0 @@ -From c710de671789388b3af1046c7091685594ec44d9 Mon Sep 17 00:00:00 2001 -From: Nathan Chancellor -Date: Tue, 30 Sep 2025 11:31:34 -0700 -Subject: nfsd: Avoid strlen conflict in nfsd4_encode_components_esc() - -There is an error building nfs4xdr.c with CONFIG_SUNRPC_DEBUG_TRACE=y -and CONFIG_FORTIFY_SOURCE=n due to the local variable strlen conflicting -with the function strlen(): - - In file included from include/linux/cpumask.h:11, - from arch/x86/include/asm/paravirt.h:21, - from arch/x86/include/asm/irqflags.h:102, - from include/linux/irqflags.h:18, - from include/linux/spinlock.h:59, - from include/linux/mmzone.h:8, - from include/linux/gfp.h:7, - from include/linux/slab.h:16, - from fs/nfsd/nfs4xdr.c:37: - fs/nfsd/nfs4xdr.c: In function 'nfsd4_encode_components_esc': - include/linux/kernel.h:321:46: error: called object 'strlen' is not a function or function pointer - 321 | __trace_puts(_THIS_IP_, str, strlen(str)); \ - | ^~~~~~ - include/linux/kernel.h:265:17: note: in expansion of macro 'trace_puts' - 265 | trace_puts(fmt); \ - | ^~~~~~~~~~ - include/linux/sunrpc/debug.h:34:41: note: in expansion of macro 'trace_printk' - 34 | # define __sunrpc_printk(fmt, ...) trace_printk(fmt, ##__VA_ARGS__) - | ^~~~~~~~~~~~ - include/linux/sunrpc/debug.h:42:17: note: in expansion of macro '__sunrpc_printk' - 42 | __sunrpc_printk(fmt, ##__VA_ARGS__); \ - | ^~~~~~~~~~~~~~~ - include/linux/sunrpc/debug.h:25:9: note: in expansion of macro 'dfprintk' - 25 | dfprintk(FACILITY, fmt, ##__VA_ARGS__) - | ^~~~~~~~ - fs/nfsd/nfs4xdr.c:2646:9: note: in expansion of macro 'dprintk' - 2646 | dprintk("nfsd4_encode_components(%s)\n", components); - | ^~~~~~~ - fs/nfsd/nfs4xdr.c:2643:13: note: declared here - 2643 | int strlen, count=0; - | ^~~~~~ - -This dprintk() instance is not particularly useful, so just remove it -altogether to get rid of the immediate strlen() conflict. - -At the same time, eliminate the local strlen variable to avoid potential -conflicts with strlen() in the future. - -Fixes: ec7d8e68ef0e ("sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer") -Signed-off-by: Nathan Chancellor -Reviewed-by: NeilBrown -Signed-off-by: Chuck Lever ---- -Link: https://git.kernel.org/cel/c/c710de671789388b3af1046c7091685594ec44d9 ---- - fs/nfsd/nfs4xdr.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c -index 8f5ee3014abc81..b689b792c21f2b 100644 ---- a/fs/nfsd/nfs4xdr.c -+++ b/fs/nfsd/nfs4xdr.c -@@ -2628,10 +2628,8 @@ static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep, - __be32 *p; - __be32 pathlen; - int pathlen_offset; -- int strlen, count=0; - char *str, *end, *next; -- -- dprintk("nfsd4_encode_components(%s)\n", components); -+ int count = 0; - - pathlen_offset = xdr->buf->len; - p = xdr_reserve_space(xdr, 4); -@@ -2658,9 +2656,8 @@ static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep, - for (; *end && (*end != sep); end++) - /* find sep or end of string */; - -- strlen = end - str; -- if (strlen) { -- if (xdr_stream_encode_opaque(xdr, str, strlen) < 0) -+ if (end > str) { -+ if (xdr_stream_encode_opaque(xdr, str, end - str) < 0) - return nfserr_resource; - count++; - } else --- -cgit 1.2.3-korg - diff --git a/patches/mainline/series b/patches/mainline/series index 5132b50f..3e256999 100644 --- a/patches/mainline/series +++ b/patches/mainline/series @@ -1,2 +1 @@ -20250918_guodong_dmaengine_mmp_pdma_fix_dma_mask_handling.patch -c710de671789388b3af1046c7091685594ec44d9.patch +88ebb29d3244e515a92c2331434bb73fef7efdc6.patch