From: "Anders Grafström" <grfstrm@users.sourceforge.net>
To: abelbg@m2grp.com, linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>,
abel.bernabeu@gmail.com, Alexey Korolev <akorolev@infradead.org>
Subject: Re: PATCH: solving a hang while waiting in FL_STATUS
Date: Wed, 23 Apr 2008 20:57:25 +0200 [thread overview]
Message-ID: <480F8695.2050804@users.sourceforge.net> (raw)
In-Reply-To: <15577be70804230935q252b90a5td60b9a7de1d2da46@mail.gmail.com>
Abel Bernabeu wrote:
> Image you have a broken sector which will never respond... that could
> hang the process while unlocking the sectors of a partition. In my
> case the problem prevents our board to complete the kernel start-up.
I have seen a case with a faulty Intel 28F128J3 that had a sector that
wouldn't erase. What happened was that the device kept trying to erase
the sector until the max specified erase time had passed then it set
the ready and error bits. The max erase time in this case was 25 seconds.
(early chip revision suffering from errata #2, I believe)
inval_cache_and_wait_for_operation() timed out already after 8 seconds
and set chip->state to FL_STATUS. It thus lost the actual state of the chip.
All operations within the next 17 seconds failed. The unit was impossble
to boot since it just kept panicing.
The error message I saw at that time (2.6.18) was
"Waiting for chip to be ready timed out. Status xxxx"
then JFFS2 got very unhappy.
A patched kernel with proper timeouts later booted this unit with just a
warning message about the bad sector. I'll post the patch shortly.
I've added this patch below as a safeguard. (Any thoughts on it?)
You could try it and see if it gets you out of the loop.
Anders
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index e812df6..e8a880c 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -706,6 +706,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
case FL_STATUS:
for (;;) {
+ map_write(map, CMD(0x70), adr);
status = map_read(map, adr);
if (map_word_andequal(map, status, status_OK, status_OK))
break;
prev parent reply other threads:[~2008-04-23 18:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-23 8:57 PATCH: solving a hang while waiting in FL_STATUS Abel Bernabeu
2008-04-23 10:33 ` David Woodhouse
2008-04-23 13:27 ` Alexey Korolev
2008-04-23 16:35 ` Abel Bernabeu
2008-04-23 16:41 ` David Woodhouse
2008-04-23 17:28 ` Alexey Korolev
2008-04-23 18:57 ` Anders Grafström [this message]
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=480F8695.2050804@users.sourceforge.net \
--to=grfstrm@users.sourceforge.net \
--cc=abel.bernabeu@gmail.com \
--cc=abelbg@m2grp.com \
--cc=akorolev@infradead.org \
--cc=dwmw2@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox