MPC5200-SPI: Where to search
Hi,
the following error happens on my system:
--------------------------------
Oops: Kernel access of bad area, sig: 11 [#1] PREEMPT Modules linked in: cam_spi_driver NIP: 00000000 LR: C30626C4 CTR: 00000000 REGS: c0329a30 TRAP: 0400 Not tainted (2.6.20-rt3-pcm030-3CAM-1) MSR: 20009032 <EE,ME,IR,DR> CR: 24008222 XER: 20000000
TASK = c030abf0[216] 'insmod' THREAD: c0328000
GPR00: 00000000 C0329AE0 C030ABF0 C1F01CC0 00000002 00000000 00000000 00000000
GPR08: 00000000 FFFFFF8D 00000000 C0329B24 22008282 10069448 C3060714 C0791840
GPR16: C305F03C C305F064 00000000 00000124 C305EB3E C305F08C C0230000 C0329C19
GPR24: C0322800 C0329C18 C0240000 C1F01D14 C0329B68 C1F01CC0 C0329B68 00000000 NIP [00000000] _start+0x40000000/0xc
LR [C30626C4] mpc52xx_psc_spi_transfer+0x44/0x94 [cam_spi_driver]
Call Trace:
[C0329AE0] [0000001C] 0x1c (unreliable)
[C0329B00] [C0130DEC] spi_sync+0x90/0xbc
[C0329B60] [C01315B0] spi_write_then_read+0x104/0x188 [C0329C10] [C01305C8] dataflash_probe+0x30/0x178
[C0329C30] [C0131460] spi_drv_probe+0x2c/0x3c
[C0329C40] [C011367C] really_probe+0x64/0x14c
[C0329C60] [C0112778] bus_for_each_drv+0x5c/0x9c
[C0329C90] [C011399C] device_attach+0x98/0xbc
[C0329CA0] [C011265C] bus_attach_device+0x34/0x88
[C0329CB0] [C01111C0] device_add+0x450/0x514
[C0329CF0] [C01310C0] spi_new_device+0xe0/0x148
[C0329D10] [C0131208] spi_register_master+0xe0/0x13c
[C0329D30] [C306298C] mpc52xx_spi_master_init+0x134/0x1c8 [cam_spi_driver] [C0329D60] [C30622D4] mpc52xx_spi_of_probe+0x174/0x458 [cam_spi_driver] [C0329DA0] [C00095E8] of_platform_device_probe+0x58/0x80 [C0329DC0] [C011367C] really_probe+0x64/0x14c
[C0329DE0] [C01138CC] __driver_attach+0x84/0x88
[C0329E00] [C0112A70] bus_for_each_dev+0x58/0x94
[C0329E30] [C01134E0] driver_attach+0x24/0x34
[C0329E40] [C0112EC4] bus_add_driver+0x88/0x1b4
[C0329E60] [C0113A9C] driver_register+0x68/0xb0
[C0329E70] [C0009928] of_register_platform_driver+0x28/0x38 [C0329E80] [C300601C] mpc52xx_spi_of_driver_init+0x1c/0xa8 [cam_spi_driver] [C0329E90] [C00403F4] sys_init_module+0x16c/0x1600
[C0329F40] [C000E9F8] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xff21a7c
LR = 0x1001d38c
--------------------------------
Its an RT preempt patched kernel. This happens most of the time when:
- Running from JFFS2 flash
- when insmod the SPI based MTD dataflash driver
It happens always, when the JFFS2 is a fresh one (whole area was erased and the new jffs2 image was written at the beginning of this flash area) and the kernel boots the first time into it. It happens *not always*, if this jffs2 filesystem was at least one times mounted and modified ($ touch <anything>; sync; reboot).
It never happens if I'm using NFS root instead.
SPI related? MTD related? JFFS2 related? Any hints where to start the search?
JB
Signature · 11 lines
Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry Handelsregister: Amtsgericht Hildesheim, HRA 2686 Vertretung Sued/Muenchen, Germany Phone: +49-8766-939 228 | Fax: +49-5121-206917-9 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 10 lines · Juergen Beisert
Hi,
the following error happens on my system:
--------------------------------
Oops: Kernel access of bad area, sig: 11 [#1] PREEMPT Modules linked in: cam_spi_driver NIP: 00000000 LR: C30626C4 CTR: 00000000 REGS: c0329a30 TRAP: 0400 Not tainted (2.6.20-rt3-pcm030-3CAM-1)
You might try more recent kernel code, with bugfixes etc...
Quoted 8 lines
MSR: 20009032 <EE,ME,IR,DR> CR: 24008222 XER: 20000000
TASK = c030abf0[216] 'insmod' THREAD:c0328000
GPR00: 00000000 C0329AE0 C030ABF0 C1F01CC0 00000002 00000000 00000000 00000000
GPR08: 00000000 FFFFFF8D 00000000 C0329B24 22008282 10069448 C3060714 C0791840
GPR16: C305F03C C305F064 00000000 00000124 C305EB3E C305F08C C0230000 C0329C19
GPR24: C0322800 C0329C18 C0240000 C1F01D14 C0329B68 C1F01CC0 C0329B68 00000000 NIP [00000000]_start+0x40000000/0xc
LR [C30626C4]mpc52xx_psc_spi_transfer+0x44/0x94[cam_spi_driver]
Whatis this "cam_spi_driver" thing? Looks like a module, but that driver should be in a "mpc52xx_psc_spi" module.
And what does the code at that address look like? That's the very first thing to check. It's your primary clue about exactly what's going wrong.
Quoted 8 lines
Call Trace:[C0329AE0] [0000001C]
0x1c(unreliable) [C0329B00] [C0130DEC]spi_sync+0x90/0xbc[C0329B60] [C01315B0]spi_write_then_read+0x104/0x188[C0329C10] [C01305C8]dataflash_probe+0x30/0x178... --- Exception: c01 at 0xff21a7c LR = 0x1001d38c
Quoted 6 lines
--------------------------------
Its an RT preempt patched kernel. This happens most of the time when:
- Running from JFFS2 flash
- when insmod the SPI based MTD dataflash driver
So there are probably at least two different MTD devices then? Some NOR or NAND flash, and the DataFlash...
Quoted 5 lines
It happens always, when the JFFS2 is a fresh one (whole area was erased and the new jffs2 image was written at the beginning of this flash area) and the kernel boots the first time into it. It happens *not always*, if this jffs2 filesystem was at least one times mounted and modified ($ touch <anything>; sync; reboot).
That would be one a NOR or NAND partition, not the DataFlash one?
Quoted 3 lines
It never happens if I'm using NFS root instead.
SPI related? MTD related? JFFS2 related? Any hints where to start the search?
See above ... as you observe, something about JFFS2 seems to be triggering the problem. That doesn't mean the issue is in JFFS2 itself, of course.
I've not had the best luck with jffs2 recently. Even on fairly generic NOR flash it's crapped out quickly ... so I run NFS root more often than I'd really like. Where "crapping out" means the JFFS partition turns itself to garbage, constantly spewing error messages, loses data, and so on. (FWIW I've observed that most recently on big-endian hardware.)
Not that I can read PowerPC stack traces, but from a quick look at the mpc52xx_psc_spi.c code the mpc52xx_psc_spi_transfer() routine mosty accesses fields in heap memory. So one possibility is that something's trashing your heap. Turn on slab poisoning and see if that reports anything interesting.
- Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Hi David,
Quoted 5 lines · David Brownell
Quoted 4 lines · Juergen Beisert
Hi,
the following error happens on my system:
Quoted 8 lines
Quoted 6 lines
--------------------------------
Oops: Kernel access of bad area, sig: 11 [#1] PREEMPT Modules linked in: cam_spi_driver NIP: 00000000 LR: C30626C4 CTR: 00000000 REGS: c0329a30 TRAP: 0400 Not tainted (2.6.20-rt3-pcm030-3CAM-1)You might try more recent kernel code, with bugfixes etc...
I could try, yes. But the customer forces me to stay at 2.6.20. But maybe I will find something I could backport.
Quoted 11 lines
Quoted 8 lines
MSR: 20009032 <EE,ME,IR,DR> CR: 24008222 XER: 20000000 TASK = c030abf0[216] 'insmod' THREAD:
c0328000
GPR00: 00000000 C0329AE0 C030ABF0 C1F01CC0 00000002 00000000 00000000 00000000 GPR08: 00000000 FFFFFF8D 00000000 C0329B24 22008282 10069448 C3060714 C0791840 GPR16: C305F03C C305F064 00000000 00000124 C305EB3E C305F08C C0230000 C0329C19 GPR24: C0322800 C0329C18 C0240000 C1F01D14 C0329B68 C1F01CC0 C0329B68 00000000 NIP [00000000]_start+0x40000000/0xcLR [C30626C4]mpc52xx_psc_spi_transfer+0x44/0x94[cam_spi_driver]Whatis this "
cam_spi_driver" thing? Looks like a module, but that driver should be in a "mpc52xx_psc_spi" module.
cam_spi_driver is my addition. Its an arbiter for the SPI bus to handle multi masters on this bus. It incorporates with MPC5200's SPI driver. Or to be more
precise: It checks if a SPI master access is possible and if yes, it let the MPC5200 SPI driver does its job.
Quoted 14 lines
And what does the code at that address look like? That's the very first thing to check. It's your primary clue about exactly what's going wrong.
Quoted 10 lines
Call Trace:[C0329AE0] [0000001C]
0x1c(unreliable) [C0329B00] [C0130DEC]spi_sync+0x90/0xbc[C0329B60] [C01315B0]spi_write_then_read+0x104/0x188[C0329C10] [C01305C8]dataflash_probe+0x30/0x178... --- Exception: c01 at 0xff21a7c LR = 0x1001d38c--------------------------------
Quoted 7 lines
Quoted 4 lines
Its an RT preempt patched kernel. This happens most of the time when:
- Running from JFFS2 flash
- when insmod the SPI based MTD dataflash driverSo there are probably at least two different MTD devices then? Some NOR or NAND flash, and the DataFlash...
Yes. 32MiB NOR flash for the root filesystem and a small SPI based dataflash. Currently only the NOR flash is used. The SPI dataflash driver only gets loaded, nothing else (but when loaded it tries to detect what kind of data flash is connected. So it initiates at least one SPI write/read transfer).
Quoted 7 lines
Quoted 5 lines
It happens always, when the JFFS2 is a fresh one (whole area was erased and the new jffs2 image was written at the beginning of this flash area) and the kernel boots the first time into it. It happens *not always*, if this jffs2 filesystem was at least one times mounted and modified ($ touch <anything>; sync; reboot).
That would be one a NOR or NAND partition, not the DataFlash one?
Yes. Working is only done on the jffs2 based NOR flash.
Quoted 8 lines
Quoted 4 lines
It never happens if I'm using NFS root instead.
SPI related? MTD related? JFFS2 related? Any hints where to start the search?
See above ... as you observe, something about JFFS2 seems to be triggering the problem. That doesn't mean the issue is in JFFS2 itself, of course.
Seems more a locking problem or something is racy...
Quoted 6 lines
I've not had the best luck with jffs2 recently. Even on fairly generic NOR flash it's crapped out quickly ... so I run NFS root more often than I'd really like. Where "crapping out" means the JFFS partition turns itself to garbage, constantly spewing error messages, loses data, and so on. (FWIW I've observed that most recently on big-endian hardware.)
Really bad news.
Quoted 5 lines
Not that I can read PowerPC stack traces, but from a quick look at the
mpc52xx_psc_spi.ccode thempc52xx_psc_spi_transfer()routine mosty accesses fields in heap memory. So one possibility is that something's trashing your heap. Turn on slab poisoning and see if that reports anything interesting.
I will do so. Thanks for your hints.
Juergen
Signature · 11 lines
Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry Handelsregister: Amtsgericht Hildesheim, HRA 2686 Vertretung Sued/Muenchen, Germany Phone: +49-8766-939 228 | Fax: +49-5121-206917-9 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 8 lines · Juergen Beisert
Quoted 6 lines
I've not had the best luck with jffs2 recently. Even on fairly generic NOR flash it's crapped out quickly ... so I run NFS root more often than I'd really like. Where "crapping out" means the JFFS partition turns itself to garbage, constantly spewing error messages, loses data, and so on. (FWIW I've observed that most recently on big-endian hardware.)
Really bad news.
Right, but for the record that's with GCC support that's not yet gone upstream. I have no reason to suspect it, since otherwise it seems OK ... but as you say, the behavior is bad news. I've not yet made time to try it with 2.6.23 or a newer compiler.
- Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/