All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Gunnarsson <johan.gunnarsson@axis.com>
To: <linux-mtd@lists.infradead.org>
Cc: jespern@axis.com
Subject: [PATCH 1/2] mtd: nand: panic_nand_wait expects timeout in ms.
Date: Mon, 21 May 2012 10:42:37 +0200	[thread overview]
Message-ID: <1337589758-8775-2-git-send-email-johan.gunnarsson@axis.com> (raw)
In-Reply-To: <1337589758-8775-1-git-send-email-johan.gunnarsson@axis.com>

Signed-off-by: Johan Gunnarsson <johan.gunnarsson@axis.com>
---
 drivers/mtd/nand/nand_base.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index eb88d8b..b927e64 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -867,14 +867,16 @@ static void panic_nand_wait(struct mtd_info *mtd, struct nand_chip *chip,
  */
 static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
 {
-
+	unsigned long timeout_ms;
 	unsigned long timeo = jiffies;
 	int status, state = chip->state;
 
 	if (state == FL_ERASING)
-		timeo += (HZ * 400) / 1000;
+		timeout_ms = 400;
 	else
-		timeo += (HZ * 20) / 1000;
+		timeout_ms = 20;
+
+	timeo += (HZ * timeout_ms) / 1000;
 
 	led_trigger_event(nand_led_trigger, LED_FULL);
 
@@ -890,7 +892,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
 		chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
 
 	if (in_interrupt() || oops_in_progress)
-		panic_nand_wait(mtd, chip, timeo);
+		panic_nand_wait(mtd, chip, timeout_ms);
 	else {
 		while (time_before(jiffies, timeo)) {
 			if (chip->dev_ready) {
-- 
1.7.2.5

  reply	other threads:[~2012-05-21  8:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21  8:42 [PATCH 0/2] use hrtimer in nand_wait Johan Gunnarsson
2012-05-21  8:42 ` Johan Gunnarsson [this message]
2012-05-21  8:42 ` [PATCH 2/2] mtd: nand: use hrtimer to measure timeout in nand_wait{_ready, } Johan Gunnarsson
2012-05-22  7:53   ` Artem Bityutskiy
2012-05-22  8:52     ` Johan Gunnarsson
2012-05-22 10:25       ` Artem Bityutskiy
2012-05-22 14:24         ` Johan Gunnarsson
2012-05-22 17:10       ` Ivan Djelic
2012-05-22 18:21         ` Artem Bityutskiy
2012-05-23  6:39         ` Brian Norris
2012-05-23  8:36           ` Ivan Djelic
2012-05-23  8:14         ` Johan Gunnarsson
2012-05-22  7:23 ` [PATCH 0/2] use hrtimer in nand_wait Artem Bityutskiy
2012-05-22  8:37   ` Johan Gunnarsson

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=1337589758-8775-2-git-send-email-johan.gunnarsson@axis.com \
    --to=johan.gunnarsson@axis.com \
    --cc=jespern@axis.com \
    --cc=linux-mtd@lists.infradead.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.