diff options
author | Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com> | 2023-07-25 13:48:08 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-25 20:11:55 +0200 |
commit | cfb81f2243b25a0d79accc6510ad66c5c5ad99ba (patch) | |
tree | ad20de83f7843faf473444770f06bcf6d8110306 | |
parent | spi: spi-qcom-qspi: Use GFP_ATOMIC flag while allocating for descriptor (diff) | |
download | linux-cfb81f2243b25a0d79accc6510ad66c5c5ad99ba.tar.xz linux-cfb81f2243b25a0d79accc6510ad66c5c5ad99ba.zip |
spi: spi-qcom-qspi: Call dma_wmb() after setting up descriptors
After setting up dma descriptors and before initiaiting dma transfer, call
dma_wmb() to ensure all writes go through.
This doesn't fix any reported problem but is added for safety.
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1690285689-30233-4-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-qcom-qspi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index 67c101792a74..75fcb9145d91 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -443,8 +443,10 @@ static int qcom_qspi_transfer_one(struct spi_master *master, ret = qcom_qspi_setup_dma_desc(ctrl, xfer); if (ret != -EAGAIN) { - if (!ret) + if (!ret) { + dma_wmb(); qcom_qspi_dma_xfer(ctrl); + } goto exit; } dev_warn_once(ctrl->dev, "DMA failure, falling back to PIO\n"); |