Re: [PATCH v3 2/9] dmaengine: dma-axi-dmac: Use bus width capability helpers

From
sashiko-bot@kernel.org
Date
2026-08-31 12:01:12
Reply to
Nuno Sá, 2026-08-31
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The legacy `src_addr_widths` and `dst_addr_widths` fields in `struct dma_device` are left uninitialized (0), breaking bisection for unconverted dmaengine consumers and directly contradicting the commit message.
--

commit e0d3ea2099710250e81c32b95cc62ac180daeb2f
Author: Nuno Sá [off-list ref]

dmaengine: dma-axi-dmac: Use bus width capability helpers

Advertise the source and destination bus widths through the new
dma_set_{src,dst}_bus_width() helpers instead of open-coding the legacy
BIT() mask.
quoted hunk ↗ jump to hunk
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index d47ff27e1408f..dc56178cafe08 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -1262,8 +1263,13 @@ static int axi_dmac_probe(struct platform_device *pdev)
 	dma_dev->device_terminate_all = axi_dmac_terminate_all;
 	dma_dev->device_synchronize = axi_dmac_synchronize;
 	dma_dev->dev = &pdev->dev;
-	dma_dev->src_addr_widths = BIT(dmac->chan.src_width);
-	dma_dev->dst_addr_widths = BIT(dmac->chan.dest_width);
+	ret = dma_bus_width_set(dma_dev->src_bus_widths, dmac->chan.src_width);
+	if (ret)
+		return ret;
+
+	ret = dma_bus_width_set(dma_dev->dst_bus_widths, dmac->chan.dest_width);
+	if (ret)
+		return ret;
[Severity: Medium]
Will this break bisection for unconverted dmaengine consumers by leaving the
legacy src_addr_widths and dst_addr_widths uninitialized?

The commit message states the intent is "keeping the legacy u32 fields
populated during the transition."

However, this patch removes the assignments to dma_dev->src_addr_widths and
dma_dev->dst_addr_widths and replaces them with dma_bus_width_set(), which only
populates the new bitmap masks.

The DMA engine core's fallback logic in dma_get_slave_caps() (which folds the
new bitmaps into the legacy caps fields) is placed inside an if
(device->device_caps) block. Because axi-dmac does not implement a
device_caps() callback, this fallback is never executed.

Consequently, will unconverted legacy consumers (like IIO) querying channel
capabilities during bisection receive caps->src_addr_widths == 0, causing DMA
transfer configurations to fail?

While this regression is fixed later in the patch series (when legacy fields
are dropped and consumers are fully converted), it seems to cause a bisection
breakage in the intermediate patches.

Could the legacy assignments be retained alongside the new helper calls to
match the commit message's stated intent?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260831-dmaengine-support-wider-dma-masks-v3-0-507d97496f2d@analog.com?part=2
Thread (29 messages) 29 messages, 5 authors, last reply 2026-09-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help