Error: Wacky! Unable to decode failure status
Michael Moedt
xemc at yahoo.com
Mon May 5 16:51:52 EDT 2003
--- Thayne Harbaugh <tharbaugh at lnxi.com> wrote:
> On Mon, 2003-05-05 at 13:42, Michael Moedt wrote:
> > > > I'm getting the error message "Wacky! Unable
> > > > to decode failure status". See below:
> > >
..
> > I am using 1.68. (last modified 04/21, by thayne.
> > =])
>
> Good.
>
> > As far as we can tell, it looks like the erase
> > operation completes correctly, and we start
> > reading the flash again, getting the erased value
> > of 0xffff.
> > (It is in 16-bit wide mode)
>
> Correct - all prior "MTD do_erase_oneblock(): Check"
> messages indicate that dq6 is toggling.
>
> > The 'ones' variable that it compares the read
> > values to is only an 8-bit 0xff. I traced this
> > back a little, (the CMD macro in
include/linux/mtd/cfi.h
> > and the function right above it) and it keeps it
> > as 8-bit even if it knows that it's x16.
>
> The status should only be a single byte because the
> erase or write (depending on the operation) is being
> sent to a single chip (not using interlaced chips).
> The final test value should be two bytes because you
> are using the x16 mode.
>
> > Should it be masking off only the lowest byte?
>
> Nope - not for the final data verification.
>
> Try the attached patch.
>
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> --
> Thayne Harbaugh
> Linux Networx
> > diff -u -r1.68 cfi_cmdset_0002.c
...
Thanks! I guess that was the problem. However, I
think that it should compare CFIDEV_BUSWIDTH_ 1,2,4
and 8 instead of 1,2,3,4. Here's the corrected patch.
diff -u -r1.68 cfi_cmdset_0002.c
--- drivers/mtd/chips/cfi_cmdset_0002.c 21 Apr 2003
23:26:25 -0000 1.68
+++ drivers/mtd/chips/cfi_cmdset_0002.c 5 May 2003
20:21:53 -0000
@@ -925,7 +931,16 @@
DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x
0x%.8x\n",
__func__, oldstatus, status );
- ones = CMD( (__u8)~0 );
+ switch(CFIDEV_BUSWIDTH) {
+ case(CFIDEV_BUSWIDTH_1): ones = (__u8)~0; break;
+ case(CFIDEV_BUSWIDTH_2): ones = (__u16)~0; break;
+ case(CFIDEV_BUSWIDTH_4): ones = (__u32)~0; break;
+ case(CFIDEV_BUSWIDTH_8): ones = (__u64)~0; break;
+ default:
+ printk(KERN_WARNING "Unsupported
buswidth\n");
+ goto erase_failed;
+ }
+ ones = CMD( ones );
if ( oldstatus == ones && status == ones ) {
/* success - do nothing */
@@ -1095,8 +1111,17 @@
DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x
0x%.8x\n",
__func__, oldstatus, status );
- ones = CMD( (__u8)~0 );
-
+ switch(CFIDEV_BUSWIDTH) {
+ case(CFIDEV_BUSWIDTH_1): ones = (__u8)~0; break;
+ case(CFIDEV_BUSWIDTH_2): ones = (__u16)~0; break;
+ case(CFIDEV_BUSWIDTH_4): ones = (__u32)~0; break;
+ case(CFIDEV_BUSWIDTH_8): ones = (__u64)~0; break;
+ default:
+ printk(KERN_WARNING "Unsupported
buswidth\n");
+ goto erase_failed;
+ }
+ ones = CMD( ones );
+
if ( oldstatus == ones && status == ones ) {
/* success - do nothing */
goto erase_done;
Thanks again,
Mike
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
More information about the linux-mtd
mailing list