CFI/MTD weird problem
Booting a linux-2.4.19-rmk4-ds3 I get this weird problem:
1.Without MTD support module I get a good output to console until the kernel prints out that there is no filesystem support. So my system's printk works fine.
2.With MTD support module
The CFI probing is working correctly and detects QRY.
When I start tracing the code execution putting some printk into the MTD/CFI code, I get a weird behavior where the console output is corrupted BEFORE the calling of the MTD/CFI code, (see minicom log below).
And I get out some '%' chars instead of the regular numerical values.
After some days debugging this problem I need a suggestion because I have exhausted ideas about where to search.
TIA
Is code executing out of the flash part being queried? Only thing I can think of off hand.
gg
-----Original Message-----
From: [email protected] [mailto:linux-mtd-admin at lists.infradead.org]On Behalf Of Nicola
Sent: Friday, February 07, 2003 12:03 PM
To: linux-mtd at lists.infradead.org
Subject: CFI/MTD weird problem
Booting a linux-2.4.19-rmk4-ds3 I get this weird problem:
1.Without MTD support module I get a good output to console until the kernel prints out that there is no filesystem support. So my system's printk works fine.
2.With MTD support module
The CFI probing is working correctly and detects QRY.
When I start tracing the code execution putting some printk into the MTD/CFI code, I get a weird behavior where the console output is corrupted BEFORE the calling of the MTD/CFI code, (see minicom log below).
And I get out some '%' chars instead of the regular numerical values.
After some days debugging this problem I need a suggestion because I have exhausted ideas about where to search.
TIA
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Quoted 5 lines · Nicola
When I start tracing the code execution putting some printk into the MTD/CFI code, I get a weird behavior where the console output is corrupted BEFORE the calling of the MTD/CFI code, (see minicom log below).
And I get out some '%' chars instead of the regular numerical values.
When adding/removing a printk changes the behaviour of the code, the usual cause is memory and/or cache corruption. Among the stuff I have seen:
- struct foo* cast to struct bar*, where sizeof(struct bar) > sizeof(struct foo). Writing to bar mangles someone elses memory, the concrete owner varies depending on the printks.
- dma buffer not alligned to cacheline size. part of dma buffer is in processor cache, dma transfers into buffer, variable on same cacheline is written and complete cacheline written back to memory. Part of the dma buffer now contains the old data again. Again, a printk might accidentally align the dma buffer, fixing the problem.
The problem with these bugs is that they take a long time to track down. Weeks or month are not uncommon. Good luck!
J?rn
Signature · 3 lines
Beware of bugs in the above code; I have only proved it correct, but not tried it. -- Donald Knuth