linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/8] spi: dw: Zero DMA Tx and Rx configurations on stack
@ 2020-05-06 15:30 Andy Shevchenko
  2020-05-06 15:30 ` [PATCH v1 2/8] spi: dw: Remove unused variable in CR0 configuring hooks Andy Shevchenko
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Andy Shevchenko @ 2020-05-06 15:30 UTC (permalink / raw)
  To: Mark Brown, linux-spi; +Cc: Andy Shevchenko, Feng Tang

Some DMA controller drivers do not tolerate non-zero values in
the DMA configuration structures. Zero them to avoid issues with
such DMA controller drivers. Even despite above this is a good
practice per se.

Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support")
Cc: Feng Tang <feng.tang@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-dw-mid.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index 9cc010e9737e8..86d9f79267f05 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -147,6 +147,7 @@ static struct dma_async_tx_descriptor *dw_spi_dma_prepare_tx(struct dw_spi *dws,
 	if (!xfer->tx_buf)
 		return NULL;
 
+	memset(&txconf, 0, sizeof(txconf));
 	txconf.direction = DMA_MEM_TO_DEV;
 	txconf.dst_addr = dws->dma_addr;
 	txconf.dst_maxburst = 16;
@@ -193,6 +194,7 @@ static struct dma_async_tx_descriptor *dw_spi_dma_prepare_rx(struct dw_spi *dws,
 	if (!xfer->rx_buf)
 		return NULL;
 
+	memset(&rxconf, 0, sizeof(rxconf));
 	rxconf.direction = DMA_DEV_TO_MEM;
 	rxconf.src_addr = dws->dma_addr;
 	rxconf.src_maxburst = 16;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-06 17:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 15:30 [PATCH v1 1/8] spi: dw: Zero DMA Tx and Rx configurations on stack Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 2/8] spi: dw: Remove unused variable in CR0 configuring hooks Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 3/8] spi: dw: Move interrupt.h to spi-dw.h who is user of it Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 4/8] spi: dw: Downgrade interrupt.h to irqreturn.h where appropriate Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 5/8] spi: dw: Move few headers under #ifdef CONFIG_SPI_DW_MID_DMA Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 6/8] spi: dw: Add 'mfld' suffix to Intel Medfield related routines Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 7/8] spi: dw: Propagate struct device pointer to ->dma_init() callback Andy Shevchenko
2020-05-06 15:30 ` [PATCH v1 8/8] spi: dw: Add Elkhart Lake PSE DMA support Andy Shevchenko
2020-05-06 15:38 ` [PATCH v1 1/8] spi: dw: Zero DMA Tx and Rx configurations on stack Feng Tang
2020-05-06 17:11 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).