Skip to content

Commit 381ea3b

Browse files
tmlindKelsey Skunberg
authored andcommitted
spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config
BugLink: https://bugs.launchpad.net/bugs/1946024 [ Upstream commit 209ab22 ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kelsey Skunberg <[email protected]>
1 parent da23014 commit 381ea3b

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
@@ -423,6 +423,7 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
423423
goto err_rx_dma_buf;
424424
}
425425

426+
memset(&cfg, 0, sizeof(cfg));
426427
cfg.src_addr = phy_addr + SPI_POPR;
427428
cfg.dst_addr = phy_addr + SPI_PUSHR;
428429
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;

0 commit comments

Comments
 (0)