Skip to content

Commit db9055f

Browse files
authored
Merge pull request #887 from nathanchance/update-patches-oct-30-2025
Update patches (October 30, 2025)
2 parents 8a3607a + f403364 commit db9055f

File tree

3 files changed

+9
-137
lines changed

3 files changed

+9
-137
lines changed
Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
From git@z Thu Jan 1 00:00:00 1970
2-
Subject: [PATCH] dmaengine: mmp_pdma: fix DMA mask handling
1+
From 88ebb29d3244e515a92c2331434bb73fef7efdc6 Mon Sep 17 00:00:00 2001
32
From: Guodong Xu <[email protected]>
43
Date: Thu, 18 Sep 2025 22:27:27 +0800
5-
Message-Id: <20250918-mmp-pdma-simplify-dma-addressing-v1-1-5c2be2b85696@riscstar.com>
6-
MIME-Version: 1.0
7-
Content-Type: text/plain; charset="utf-8"
8-
Content-Transfer-Encoding: 7bit
4+
Subject: dmaengine: mmp_pdma: fix DMA mask handling
95

106
The driver's existing logic for setting the DMA mask for "marvell,pdma-1.0"
117
was flawed. It incorrectly relied on pdev->dev->coherent_dma_mask instead
@@ -36,47 +32,18 @@ Reported-by: Naresh Kamboju <[email protected]>
3632
Closes: https://lore.kernel.org/lkml/CA+G9fYsPcMfW-e_0_TRqu4cnwqOqYF3aJOeKUYk6Z4qRStdFvg@mail.gmail.com
3733
Suggested-by: Arnd Bergmann <[email protected]>
3834
Signed-off-by: Guodong Xu <[email protected]>
39-
Tested-by: Naresh Kamboju <[email protected]>
40-
Tested-by: Nathan Chancellor <[email protected]> # build
4135
Reviewed-by: Arnd Bergmann <[email protected]>
42-
Link: https://patch.msgid.link/20250918-mmp-pdma-simplify-dma-addressing-v1-1-5c2be2b85696@riscstar.com
36+
Tested-by: Nathan Chancellor <[email protected]> # build
37+
Tested-by: Naresh Kamboju <[email protected]>
38+
Signed-off-by: Vinod Koul <[email protected]>
4339
---
44-
Hi Vinod, Arnd, and all,
45-
46-
This patch fixes a build failure in the mmp_pdma driver when using
47-
clang-20, as reported by Naresh Kamboju [1]. The error,
48-
a -Wshift-count-overflow warning, is caused by a known issue in the clang
49-
compiler. When the DMA_BIT_MASK(64) macro is used in a static initializer,
50-
it triggers a long-standing bug in how clang evaluates compile-time
51-
constants [2, 3]. Thanks to Nathan Chancellor for providing these links.
52-
53-
While investigating this, Arnd Bergmann pointed out that the driver's
54-
logic for setting the DMA mask was unnecessarily complex. This logic,
55-
which was inherited from the original Marvel PDMA driver when adding
56-
support for SpacemiT K1 DMA, could be simplified. A better solution is to
57-
set each device's DMA mask directly based on its hardware capability.
58-
59-
This patch implements Arnd's suggestion. It refactors the driver to store
60-
the controller's DMA width (either 32 or 64 bits) and generates the mask
61-
at runtime within the probe() function.
62-
63-
This approach also avoids the clang false error reporting.
64-
65-
This patch is based on dmaengine.git next [4].
66-
67-
Thanks,
68-
Guodong Xu
69-
70-
[1] https://lore.kernel.org/lkml/CA+G9fYsPcMfW-e_0_TRqu4cnwqOqYF3aJOeKUYk6Z4qRStdFvg@mail.gmail.com/
71-
[2] https://github.com/ClangBuiltLinux/linux/issues/92
72-
[3] https://github.com/llvm/llvm-project/issues/38137
73-
[4] https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/log/?h=next
40+
Link: https://git.kernel.org/vkoul/dmaengine/p/88ebb29d3244e515a92c2331434bb73fef7efdc6
7441
---
7542
drivers/dma/mmp_pdma.c | 20 ++++++++------------
7643
1 file changed, 8 insertions(+), 12 deletions(-)
7744

7845
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
79-
index d07229a748868b8115892c63c54c16130d88e326..86661eb3cde1ff6d6d8f02b6f0d4142878b5a890 100644
46+
index d07229a748868b..86661eb3cde1ff 100644
8047
--- a/drivers/dma/mmp_pdma.c
8148
+++ b/drivers/dma/mmp_pdma.c
8249
@@ -152,8 +152,8 @@ struct mmp_pdma_phy {
@@ -134,12 +101,6 @@ index d07229a748868b8115892c63c54c16130d88e326..86661eb3cde1ff6d6d8f02b6f0d41428
134101

135102
ret = dma_async_device_register(&pdev->device);
136103
if (ret) {
137-
138-
---
139-
base-commit: cc0bacac6de7763a038550cf43cb94634d8be9cd
140-
change-id: 20250904-mmp-pdma-simplify-dma-addressing-f6aef03e07c3
141-
142-
Best regards,
143104
--
144-
Guodong Xu <[email protected]>
105+
cgit 1.2.3-korg
145106

patches/mainline/c710de671789388b3af1046c7091685594ec44d9.patch

Lines changed: 0 additions & 88 deletions
This file was deleted.

patches/mainline/series

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
20250918_guodong_dmaengine_mmp_pdma_fix_dma_mask_handling.patch
2-
c710de671789388b3af1046c7091685594ec44d9.patch
1+
88ebb29d3244e515a92c2331434bb73fef7efdc6.patch

0 commit comments

Comments
 (0)