From: Feng Tang <feng.tang@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>, linux-spi@vger.kernel.org
Subject: Re: [PATCH v1 1/8] spi: dw: Zero DMA Tx and Rx configurations on stack
Date: Wed, 6 May 2020 23:38:55 +0800 [thread overview]
Message-ID: <20200506153855.GA18389@shbuild999.sh.intel.com> (raw)
In-Reply-To: <20200506153025.21441-1-andriy.shevchenko@linux.intel.com>
On Wed, May 06, 2020 at 06:30:18PM +0300, Andy Shevchenko wrote:
> 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>
Acked-by: Feng Tang <feng.tang@intel.com>
Thanks,
Feng
> ---
> 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
next prev parent reply other threads:[~2020-05-06 15:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Feng Tang [this message]
2020-05-06 17:11 ` [PATCH v1 1/8] spi: dw: Zero DMA Tx and Rx configurations on stack Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200506153855.GA18389@shbuild999.sh.intel.com \
--to=feng.tang@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.