[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200819123208.12337-8-l.stelmach@samsung.com>
Date: Wed, 19 Aug 2020 14:32:07 +0200
From: Łukasz Stelmach <l.stelmach@...sung.com>
To: Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Andi Shyti <andi@...zian.org>, Mark Brown <broonie@...nel.org>,
linux-spi@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: m.szyprowski@...sung.com, b.zolnierkie@...sung.com,
Łukasz Stelmach <l.stelmach@...sung.com>
Subject: [PATCH 7/8] spi: spi-s3c64xx: Increase transfer timeout
Signed-off-by: Łukasz Stelmach <l.stelmach@...sung.com>
---
drivers/spi/spi-s3c64xx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 27d77600a820..27db1e0f6f32 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -464,7 +464,8 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
/* millisecs to xfer 'len' bytes @ 'cur_speed' */
ms = xfer->len * 8 * 1000 / sdd->cur_speed;
- ms += 10; /* some tolerance */
+ ms = (ms * 10) + 30; /* some tolerance */
+ ms = max(ms, 100); /* minimum timeout */
val = msecs_to_jiffies(ms) + 10;
val = wait_for_completion_timeout(&sdd->xfer_completion, val);
--
2.26.2
Powered by blists - more mailing lists