Skip to content

Commit f220913

Browse files
nbuchwitzpelwell
authored andcommitted
dmaengine: dw-axi-dmac: report per-channel max_burst via device_caps
The patch "dmaengine: dw-axi-dmac: add per-channel AXI burst length support" programs ARLEN/AWLEN from the snps,axi-max-burst-len array but still exposed a single max_burst value via dma_get_slave_caps(). As a result all channels reported 8 even when limited to 4, leading to warnings: dma dma2chan5: requested source burst length 8 exceeds supported 4 Add a .device_caps callback to return the correct per-channel max_burst. This allows drivers like amba-pl011 to clamp burst lengths properly. Fixes: 0e4e6a0c4f4e ("dmaengine: dw-axi-dmac: add per-channel AXI burst length support") Signed-off-by: Nicolai Buchwitz <[email protected]>
1 parent 69fbc0f commit f220913

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,16 @@ static int __maybe_unused axi_dma_runtime_resume(struct device *dev)
14761476
return axi_dma_resume(chip);
14771477
}
14781478

1479+
static void dw_axi_dma_device_caps(struct dma_chan *dchan,
1480+
struct dma_slave_caps *caps)
1481+
{
1482+
struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan);
1483+
struct dw_axi_dma *dw = chan->chip->dw;
1484+
1485+
if (dw->hdata->restrict_axi_burst_len)
1486+
caps->max_burst = dw->hdata->axi_rw_burst_len[chan->id];
1487+
}
1488+
14791489
static bool dw_axi_dma_filter_fn(struct dma_chan *dchan, void *filter_param)
14801490
{
14811491
struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan);
@@ -1720,7 +1730,7 @@ static int dw_probe(struct platform_device *pdev)
17201730
dma_cap_set(DMA_CYCLIC, dw->dma.cap_mask);
17211731

17221732
/* DMA capabilities */
1723-
dw->dma.max_burst = hdata->axi_rw_burst_len[0];
1733+
dw->dma.device_caps = dw_axi_dma_device_caps;
17241734
dw->dma.src_addr_widths = AXI_DMA_BUSWIDTHS;
17251735
dw->dma.dst_addr_widths = AXI_DMA_BUSWIDTHS;
17261736
dw->dma.directions = BIT(DMA_MEM_TO_MEM);

0 commit comments

Comments
 (0)