Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: tegra: add slave capabilities reporting

After commit ecc19d17868be9c9f8f00ed928791533c420f3e0 ("dmaengine: Add
a warning for drivers not using the generic slave caps retrieval"),
the Tegra APB DMA driver causes this warning during boot:

WARNING: CPU: 0 PID: 1 at drivers/dma/dmaengine.c:830 dma_async_device_register+0x294/0x538()
this driver doesn't support generic slave capabilities reporting

Fix by setting the appropriate reporting structure fields that are
passed to dma_async_device_register().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Paul Walmsley and committed by
Vinod Koul
891653ab 0fdd244f

+15
+15
drivers/dma/tegra20-apb-dma.c
··· 1425 1425 tegra_dma_free_chan_resources; 1426 1426 tdma->dma_dev.device_prep_slave_sg = tegra_dma_prep_slave_sg; 1427 1427 tdma->dma_dev.device_prep_dma_cyclic = tegra_dma_prep_dma_cyclic; 1428 + tdma->dma_dev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | 1429 + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | 1430 + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | 1431 + BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); 1432 + tdma->dma_dev.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | 1433 + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | 1434 + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | 1435 + BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); 1436 + tdma->dma_dev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); 1437 + /* 1438 + * XXX The hardware appears to support 1439 + * DMA_RESIDUE_GRANULARITY_BURST-level reporting, but it's 1440 + * only used by this driver during tegra_dma_terminate_all() 1441 + */ 1442 + tdma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; 1428 1443 tdma->dma_dev.device_config = tegra_dma_slave_config; 1429 1444 tdma->dma_dev.device_terminate_all = tegra_dma_terminate_all; 1430 1445 tdma->dma_dev.device_tx_status = tegra_dma_tx_status;