Skip to content

Commit 209ab22

Browse files
tmlindbroonie
authored andcommitted
spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config
Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For spi-fsl-dspi, this is probably not currently an issue but is still good to fix though. Fixes: 90ba370 ("spi: spi-fsl-dspi: Add DMA support for Vybrid") Cc: Sanchayan Maity <[email protected]> Cc: Vladimir Oltean <[email protected]> Cc: Peter Ujfalusi <[email protected]> Cc: Vinod Koul <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5c842e5 commit 209ab22

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
530530
goto err_rx_dma_buf;
531531
}
532532

533+
memset(&cfg, 0, sizeof(cfg));
533534
cfg.src_addr = phy_addr + SPI_POPR;
534535
cfg.dst_addr = phy_addr + SPI_PUSHR;
535536
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;

0 commit comments

Comments
 (0)