From: Christophe Kerello <christophe.kerello@st.com>
To: <miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com>,
<robh+dt@kernel.org>, <mark.rutland@arm.com>,
<gregkh@linuxfoundation.org>, <boris.brezillon@collabora.com>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<devicetree@vger.kernel.org>, <marex@denx.de>,
Christophe Kerello <christophe.kerello@st.com>
Subject: [PATCH v3 03/10] mtd: rawnand: stm32_fmc2: use FMC2_TIMEOUT_MS for timeouts
Date: Tue, 5 May 2020 19:11:01 +0200 [thread overview]
Message-ID: <1588698668-25288-4-git-send-email-christophe.kerello@st.com> (raw)
In-Reply-To: <1588698668-25288-1-git-send-email-christophe.kerello@st.com>
This patch removes the constant FMC2_TIMEOUT_US.
FMC2_TIMEOUT_MS will be used each time that we need to wait (except
when the timeout value is set by the framework).
It was seen, during stress tests with the sequencer in an overloaded
system, that we could be close to 1 second, even if we never met this
value. To be safe, FMC2_TIMEOUT_MS is set to 5 seconds.
Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
---
Changes in v3:
- add in the commit log the reason to increase FMC2_TIMEOUT_MS
drivers/mtd/nand/raw/stm32_fmc2_nand.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
index 3377fbe..5778a95 100644
--- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
+++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
@@ -37,8 +37,7 @@
/* Max ECC buffer length */
#define FMC2_MAX_ECC_BUF_LEN (FMC2_BCHDSRS_LEN * FMC2_MAX_SG)
-#define FMC2_TIMEOUT_US 1000
-#define FMC2_TIMEOUT_MS 1000
+#define FMC2_TIMEOUT_MS 5000
/* Timings */
#define FMC2_THIZ 1
@@ -526,8 +525,8 @@ static int stm32_fmc2_ham_calculate(struct nand_chip *chip, const u8 *data,
int ret;
ret = readl_relaxed_poll_timeout(fmc2->io_base + FMC2_SR,
- sr, sr & FMC2_SR_NWRF, 10,
- FMC2_TIMEOUT_MS);
+ sr, sr & FMC2_SR_NWRF, 1,
+ 1000 * FMC2_TIMEOUT_MS);
if (ret) {
dev_err(fmc2->dev, "ham timeout\n");
return ret;
@@ -1315,7 +1314,7 @@ static int stm32_fmc2_waitrdy(struct nand_chip *chip, unsigned long timeout_ms)
/* Check if there is no pending requests to the NAND flash */
if (readl_relaxed_poll_timeout_atomic(fmc2->io_base + FMC2_SR, sr,
sr & FMC2_SR_NWRF, 1,
- FMC2_TIMEOUT_US))
+ 1000 * FMC2_TIMEOUT_MS))
dev_warn(fmc2->dev, "Waitrdy timeout\n");
/* Wait tWB before R/B# signal is low */
--
1.9.1
next prev parent reply other threads:[~2020-05-05 17:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 17:10 [PATCH v3 00/10] add STM32 FMC2 EBI controller driver Christophe Kerello
2020-05-05 17:10 ` [PATCH v3 01/10] mtd: rawnand: stm32_fmc2: manage all errors cases at probe time Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 02/10] mtd: rawnand: stm32_fmc2: remove useless inline comments Christophe Kerello
2020-05-05 17:11 ` Christophe Kerello [this message]
2020-05-05 17:11 ` [PATCH v3 04/10] mtd: rawnand: stm32_fmc2: cleanup Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 05/10] mtd: rawnand: stm32_fmc2: use FIELD_PREP/FIELD_GET macros Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 06/10] dt-bindings: mtd: update STM32 FMC2 NAND controller documentation Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 07/10] dt-bindings: memory-controller: add STM32 FMC2 EBI " Christophe Kerello
2020-05-06 8:26 ` Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 08/10] memory: stm32-fmc2-ebi: add STM32 FMC2 EBI controller driver Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 09/10] mtd: rawnand: stm32_fmc2: use regmap APIs Christophe Kerello
2020-05-05 17:11 ` [PATCH v3 10/10] mtd: rawnand: stm32_fmc2: get resources from parent node Christophe Kerello
2020-05-06 9:16 ` [PATCH v3 00/10] add STM32 FMC2 EBI controller driver Christophe Kerello
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=1588698668-25288-4-git-send-email-christophe.kerello@st.com \
--to=christophe.kerello@st.com \
--cc=boris.brezillon@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=marex@denx.de \
--cc=mark.rutland@arm.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=robh+dt@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).