Skip to content

Commit e71aa2a

Browse files
committed
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 2fa00bc commit e71aa2a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
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);
@@ -1733,6 +1743,7 @@ static int dw_probe(struct platform_device *pdev)
17331743
dw->dma.device_terminate_all = dma_chan_terminate_all;
17341744
dw->dma.device_pause = dma_chan_pause;
17351745
dw->dma.device_resume = dma_chan_resume;
1746+
dw->dma.device_caps = dw_axi_dma_device_caps;
17361747

17371748
dw->dma.device_alloc_chan_resources = dma_chan_alloc_chan_resources;
17381749
dw->dma.device_free_chan_resources = dma_chan_free_chan_resources;

0 commit comments

Comments
 (0)