Patchwork mtd: omap2: fix IOERR

login
register
mail settings
Submitter Brian Norris
Date March 15, 2013, 5:44 p.m.
Message ID <1363369499-29459-1-git-send-email-computersforpeace@gmail.com>
Download mbox | patch
Permalink /patch/228125/
State New
Headers show

Comments

Brian Norris - March 15, 2013, 5:44 p.m.
From: Toan Pham <tpham3783@gmail.com>

Fix mtd-utils from returning -EIO.
Formatting jffs2 filesystem was impossible when CONFIG_HZ was set to a low
value.

Signed-off-by: Toan Pham <tpham3783@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
Toan: it looks like your mailer uses MIME/HTML formatting, whereas the mailing
list expects plain text. It also seems your tabs were replaced with spaces. I
am resubmitting your patch for you, as it is simple and is not worth a lot more
email struggles. Thanks for the fix!

 drivers/mtd/nand/omap2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Artem Bityutskiy - April 4, 2013, 3:17 p.m.
On Fri, 2013-03-15 at 10:44 -0700, Brian Norris wrote:
> From: Toan Pham <tpham3783@gmail.com>
> 
> Fix mtd-utils from returning -EIO.
> Formatting jffs2 filesystem was impossible when CONFIG_HZ was set to a low
> value.
> 
> Signed-off-by: Toan Pham <tpham3783@gmail.com>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Pushed to l2-mtd.git, thanks!
Artem Bityutskiy - April 4, 2013, 3:35 p.m.
On Fri, 2013-03-15 at 10:44 -0700, Brian Norris wrote:
> From: Toan Pham <tpham3783@gmail.com>
> 
> Fix mtd-utils from returning -EIO.
> Formatting jffs2 filesystem was impossible when CONFIG_HZ was set to a low
> value.
> 
> Signed-off-by: Toan Pham <tpham3783@gmail.com>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index b97ef3b..81b80af 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1023,9 +1023,9 @@  static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
 	int status, state = this->state;
 
 	if (state == FL_ERASING)
-		timeo += (HZ * 400) / 1000;
+		timeo += msecs_to_jiffies(400);
 	else
-		timeo += (HZ * 20) / 1000;
+		timeo += msecs_to_jiffies(20);
 
 	writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
 	while (time_before(jiffies, timeo)) {