dmaengine: imx-sdma: Correct src_addr_widths and directions
Subsystems (2)
PATCH v2 1/1 dmaengine: imx-sdma: Correct src_addr_widths and directions
The driver already supports DMA_DEV_TO_DEV in sdma_config(), DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in sdma_prep_slave_sg(). So this patch adds them to the lists.
--- drivers/dma/imx-sdma.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/dma/imx-sdma.c +11 -3
@@ -178,6 +178,14 @@#define SDMA_WATERMARK_LEVEL_HWE BIT(29)#define SDMA_WATERMARK_LEVEL_CONT BIT(31) +#define SDMA_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES)) + +#define SDMA_DMA_DIRECTIONS (BIT(DMA_DEV_TO_MEM) | \ + BIT(DMA_MEM_TO_DEV) | \ + BIT(DMA_DEV_TO_DEV)) +/* * Mode/Count of data node descriptors - IPCv2 */
@@ -1851,9 +1859,9 @@ static int sdma_probe(struct platform_device *pdev) sdma->dma_device.device_prep_dma_cyclic = sdma_prep_dma_cyclic; sdma->dma_device.device_config = sdma_config; sdma->dma_device.device_terminate_all = sdma_disable_channel_with_delay; - sdma->dma_device.src_addr_widths =BIT (DMA_SLAVE_BUSWIDTH_4_BYTES ); - sdma->dma_device.dst_addr_widths =BIT (DMA_SLAVE_BUSWIDTH_4_BYTES ); - sdma->dma_device.directions =BIT (DMA_DEV_TO_MEM ) |BIT (DMA_MEM_TO_DEV ); + sdma->dma_device.src_addr_widths =SDMA_DMA_BUSWIDTHS ; + sdma->dma_device.dst_addr_widths =SDMA_DMA_BUSWIDTHS ; + sdma->dma_device.directions =SDMA_DMA_DIRECTIONS ; sdma->dma_device.residue_granularity =DMA_RESIDUE_GRANULARITY_SEGMENT ; sdma->dma_device.device_issue_pending = sdma_issue_pending; sdma->dma_device.dev->dma_parms = &sdma->dma_parms;
Signature · 1 line
2.1.4
Fabio Estevam
reviewerHi Nicolin,
Quoted 5 lines · Nicolin Chen
The driver already supports
DMA_DEV_TO_DEVinsdma_config(),DMA_SLAVE_BUSWIDTH_2_BYTESandDMA_SLAVE_BUSWIDTH_1_BYTEinsdma_prep_slave_sg(). So this patch adds them to the lists.Signed-off-by Nicolin Chen <[email protected]>
Patch looks good.
Just curious: what is the specific usecase that triggered this change?
Thanks
Quoted 7 lines · Fabio Estevam
Hi Nicolin,
Quoted 4 lines · Nicolin Chen
The driver already supports
DMA_DEV_TO_DEVinsdma_config(),DMA_SLAVE_BUSWIDTH_2_BYTESandDMA_SLAVE_BUSWIDTH_1_BYTEinsdma_prep_slave_sg(). So this patch adds them to the lists.
Quoted 5 lines
Quoted 1 line
Signed-off-by Nicolin Chen <[email protected]>Patch looks good.
Just curious: what is the specific usecase that triggered this change?
Any audio test case. The ASoC generic dmaengine gets the DMA cap (4_BYTES only) and apply it to hw->formats in ASoC core. SSI + WM8962 could have S8_LE, S16_LE and S24_LE formats but it turns out that it only has S24_LE now because of this.
I haven't seen any side effect by DMA_DEV_TO_DEV yet but it could potentially break ASRC once a similar constrain based on the "directions" is applied.
Vinod Koul
AppliedQuoted 3 lines · Nicolin Chen
The driver already supports
DMA_DEV_TO_DEVinsdma_config(),DMA_SLAVE_BUSWIDTH_2_BYTESandDMA_SLAVE_BUSWIDTH_1_BYTEinsdma_prep_slave_sg(). So this patch adds them to the lists.
Applied, thanks
Signature · 1 line
~Vinod