linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pratyush Yadav <p.yadav@ti.com>
To: Mark Brown <broonie@kernel.org>, Vignesh Raghavendra <vigneshr@ti.com>
Cc: Pratyush Yadav <p.yadav@ti.com>, <linux-spi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 6/7] spi: cadence-quadspi: Wait at least 500 ms for direct reads
Date: Wed, 23 Dec 2020 00:14:24 +0530	[thread overview]
Message-ID: <20201222184425.7028-7-p.yadav@ti.com> (raw)
In-Reply-To: <20201222184425.7028-1-p.yadav@ti.com>

When performing a direct read via DMA the timeout for completion is set
equal to the read length. This is fine for larger reads. For a small
read like the Read Status Register command, the timeout would be 1 or 2
milliseconds. This is not enough to cover the overhead needed in setting
up DMA.

Make sure the timeout is at least 500 ms to allow DMA ample time to
finish. For reads larger than 500 bytes, the timeout will continue to be
equal to the read length.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
---
 drivers/spi/spi-cadence-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 1781d4e94ebd..90040664e1b9 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -963,7 +963,7 @@ static int cqspi_direct_read_execute(struct cqspi_flash_pdata *f_pdata,
 
 	dma_async_issue_pending(cqspi->rx_chan);
 	if (!wait_for_completion_timeout(&cqspi->rx_dma_complete,
-					 msecs_to_jiffies(len))) {
+					 msecs_to_jiffies(max(len, 500UL)))) {
 		dmaengine_terminate_sync(cqspi->rx_chan);
 		dev_err(dev, "DMA wait_for_completion_timeout\n");
 		ret = -ETIMEDOUT;
-- 
2.28.0


  parent reply	other threads:[~2020-12-22 18:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 18:44 [PATCH 0/7] spi: cadence-quadspi: Add Octal DTR support Pratyush Yadav
2020-12-22 18:44 ` [PATCH 1/7] spi: cadence-quadspi: Set master max_speed_hz Pratyush Yadav
2020-12-22 18:44 ` [PATCH 2/7] spi: cadence-quadspi: Abort read if dummy cycles required are too many Pratyush Yadav
2020-12-22 18:44 ` [PATCH 3/7] spi: cadence-quadspi: Set dummy cycles from STIG commands Pratyush Yadav
2020-12-22 18:44 ` [PATCH 4/7] spi: cadence-quadspi: Fix dummy cycle calculation when buswidth > 1 Pratyush Yadav
2020-12-22 18:44 ` [PATCH 5/7] spi: cadence-quadspi: Implement a simple supports_op hook Pratyush Yadav
2020-12-22 18:44 ` Pratyush Yadav [this message]
2020-12-29  3:29   ` [PATCH 6/7] spi: cadence-quadspi: Wait at least 500 ms for direct reads kernel test robot
2020-12-29  9:18     ` Pratyush Yadav
2021-01-05 19:41       ` Nick Desaulniers
2020-12-22 18:44 ` [PATCH 7/7] spi: cadence-quadspi: Add DTR support Pratyush Yadav
2021-01-06 14:59 ` [PATCH 0/7] spi: cadence-quadspi: Add Octal " Mark Brown
2021-01-08 16:48   ` Pratyush Yadav

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=20201222184425.7028-7-p.yadav@ti.com \
    --to=p.yadav@ti.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=vigneshr@ti.com \
    /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 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).