2009-02-06 12:30:58     NAND broken by Xenomai?

Document created by Aaronwu Employee on Aug 13, 2013
Version 1Show Document
  • View in full screen mode

2009-02-06 12:30:58     NAND broken by Xenomai?

Michael McTernan (UNITED KINGDOM)

Message: 68997   

 

Hi,

 

After patching the 2008R1 kernel with the blackfin Xenomai patch, I find that I jffs2 has problems mounting and creates lots and lots of ECC errors:

 

mtd->read(0x3178 bytes from 0x78e88) returned ECC error

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af10: 0x0219 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af18: 0xf7fb instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af20: 0x0004 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af24: 0x0081 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af30: 0x9854 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af34: 0x9856 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af38: 0x9856 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af48: 0xf300 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af50: 0xdbe1 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007af54: 0x0219 instead

 

If I reboot with an unpatched kernel, I see no problem.  The chip detection seems okay using the bfin_nand driver:

 

root:/> modprobe bfin_nand

NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bit)

Scanning device for bad blocks

Bad eraseblock 1302 at 0x01458000

Bad eraseblock 1746 at 0x01b48000

Creating 1 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x00000000-0x04000000 : "file system"

 

I'm not sure why there would be an interaction here and I'm not actually running any Xenomai stuff while doing the mount.  Enabling verbose logging in mtd doesn't really show anything interesting.

 

To use Xenomai properly I really need to resolve this.  Where should I start looking?

 

Regards,

 

Mike

QuoteReplyEditDelete

 

 

2009-02-06 14:33:00     Re: NAND broken by Xenomai?

Mike Frysinger (UNITED STATES)

Message: 69009   

 

what hardware exactly are you using ?

QuoteReplyEditDelete

 

 

2009-02-06 14:45:41     Re: NAND broken by Xenomai?

Michael McTernan (UNITED KINGDOM)

Message: 69010   

 

A custom board which is similar to the BF537-EZKIT, but with some ST micro NAND added (29W320/NAND512).  It's a BF537-0.3 Blackfin.

QuoteReplyEditDelete

 

 

2009-02-06 16:25:57     Re: NAND broken by Xenomai?

Mike Frysinger (UNITED STATES)

Message: 69013   

 

and you're using the bfin_nand driver right ?  could you try the platform nand driver instead ?  we've converted the bf537-stamp to use that in trunk and we're going to be dropping the bfin_nand driver ...

QuoteReplyEditDelete

 

 

2009-02-06 18:45:59     Re: NAND broken by Xenomai?

Michael McTernan (UNITED KINGDOM)

Message: 69014   

 

Oh, cool.  It took a bit of time to merge down the changes (the docs at http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin_async_nand don't have all the code) and add our bits (there's a chip select GPIO and the address & partition differ), but....

 

It appears to work!  It's mounted, and there are no complaints about ECC, excellent - thanks!

 

So what's the under-the-hood difference that makes this work?  I still don't see how Xenomai should affect this part of the system.

QuoteReplyEditDelete

 

 

2009-02-06 23:45:34     Re: NAND broken by Xenomai?

Mike Frysinger (UNITED STATES)

Message: 69016   

 

if i had to guess, our bfin_nand driver is broken in some regard and you just dont notice it normally.  but xenomai stresses the system differently and exacerbates the bug.

 

could you highlight what is missing in the doc so i can get it added ?

QuoteReplyEditDelete

 

 

2009-02-09 04:45:39     Re: NAND broken by Xenomai?

Michael McTernan (UNITED KINGDOM)

Message: 69076   

 

In 2008R1 none of the functions given exist, so I was copying them from there.  I found some #includes were needed, and that the bfin_plat_nand_data needs adding to the  initialisation array.

 

When looking at trunk, the code is already in there, so no problem.  I just merged from trunk in the end, then applied a couple of local fixes (different GPIO pins, no R/B line).

 

The docs will probably be good for 2009R1.

QuoteReplyEditDelete

 

 

2009-02-09 11:05:52     Re: NAND broken by Xenomai?

Mike Frysinger (UNITED STATES)

Message: 69127   

 

OK, thanks for the info

Attachments

    Outcomes