public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* PATCH: solving a hang while waiting in FL_STATUS
@ 2008-04-23  8:57 Abel Bernabeu
  2008-04-23 10:33 ` David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Abel Bernabeu @ 2008-04-23  8:57 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

I am experimenting an infinite loop problem happening at
cfi_cmdset_0001.c:chip_ready.

Some kind of timeout while waiting  in FL_STATUS should be included.
Indeed, this timeout feature is not new at all.

The feature was present in 2.6.23.17 but disappeared in 2.6.24 (after
some refactoring work easily perceptible).

The present patch restores the "lost functionality" and solves my
problem. Please consider the patch to be included in the mtd code.

Yours, Abel.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: chip_ready.patch --]
[-- Type: text/x-patch; name=chip_ready.patch, Size: 551 bytes --]

--- linux-2.6.25/drivers/mtd/chips/cfi_cmdset_0001.c	2008-04-17 04:49:44.000000000 +0200
+++ linux-2.6.25.hacked/drivers/mtd/chips/cfi_cmdset_0001.c	2008-04-23 10:27:12.000000000 +0200
@@ -712,6 +712,12 @@
 			if (chip->priv && map_word_andequal(map, status, status_PWS, status_PWS))
 				break;
 
+			if (time_after(jiffies, timeo)) {
+				printk(KERN_ERR "%s: Waiting for chip to be ready timed out. Status %lx\n",
+					map->name, status.x[0]);
+				return -EIO;
+			}
+
 			spin_unlock(chip->mutex);
 			cfi_udelay(1);
 			spin_lock(chip->mutex);

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-23 18:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox