From: "vimal singh" <vimalsingh@ti.com>
To: "David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH][MTD][NAND]: fix omap2.c compile failure and warning
Date: Sun, 28 Jun 2009 11:10:44 +0530 (IST) [thread overview]
Message-ID: <59240.192.168.10.88.1246167644.squirrel@dbdmail.itg.ti.com> (raw)
> Er, did he? And please put proper email addresses in. If you can't find
> an @ sign on your keyboard, cut and paste it from elsewhere.
Corrected this.
>> - if (!(status & 0x40))
>> + if (status & NAND_STATUS_READY)
>> break;
>
> Hm... now you're polling the PASS/FAIL bit in the status, not the
> READY/BUSY bit. I suspect that's not going to work too well...
>
Value of macro 'NAND_STATUS_READY' is '0x40' only. And AFAIK this is the bit
for ready/busy, isn't it?
Signed-off-by: Vimal Singh <vimalsingh@ti.com>
---
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 0cd76f8..3b6e6ad 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -11,6 +11,8 @@
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
+#include <linux/jiffies.h>
+#include <linux/sched.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
@@ -541,7 +543,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
unsigned long timeo = jiffies;
- int status, state = this->state;
+ int status = NAND_STATUS_FAIL, state = this->state;
if (state == FL_ERASING)
timeo += (HZ * 400) / 1000;
@@ -558,6 +560,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip
status = __raw_readb(this->IO_ADDR_R);
- if (!(status & 0x40))
+ if (status & NAND_STATUS_READY)
break;
+ cond_resched();
}
return status;
}
next reply other threads:[~2009-06-28 5:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-28 5:40 vimal singh [this message]
[not found] <53729.192.168.10.89.1246035472.squirrel@dbdmail.itg.ti.com>
2009-06-26 17:02 ` vimal singh
2009-06-26 17:14 ` David Woodhouse
[not found] ` <57946.192.168.10.89.1246035774.squirrel@dbdmail.itg.ti.com>
2009-06-27 5:37 ` vimal singh
2009-06-27 7:45 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2009-06-26 13:21 tom.leiming
2009-06-26 15:09 ` David Woodhouse
2009-06-26 15:45 ` Singh, Vimal
2009-06-26 16:18 ` David Woodhouse
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=59240.192.168.10.88.1246167644.squirrel@dbdmail.itg.ti.com \
--to=vimalsingh@ti.com \
--cc=dwmw2@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®