2009-02-02 10:20:27 _bfin_serial_console_putchar causes MPU violation?
Steve Strobel (UNITED STATES)
Message: 68678
In an effort to track down some application software bugs, I turned on memory protection in my uClinux build. Near the end of the boot process (after /etc/rc prints the MOTD), it now continously stack dumps complaining of a "CPLB protection violation" with a stack track that goes back to _bfin_serial_console_putchar. Looking at the forum archives, it seems that others are using the memory protection, so I am wondering what I am doing wrong.
The hardware is a custom BF537 design similar to the BF537 stamp. The BF537 chip is rev 0.3. I am using a Linux release 2.6.22.19-ADI-2008R1.5-svn408, build #26 Mon Jan 26 15:30:47 MST 2009 with a few custom drivers. A log of the serial messages printed on bootup follows:
## Booting image at 02000000 ...
Image Name: uClinux Kernel and ext2
Created: 2009-01-28 21:32:35 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 7462436 Bytes = 7.1 MB
Load Address: 00001000
Entry Point: 001a6000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 1a6000
Linux version 2.6.22.19-ADI-2008R1.5-svn408 (stevestrobel@dev1-ubuntu) (gcc version 4.1.2 (ADI svn)) #27 Wed Jan 28 13:3
9:17 MST 2009
Hardware Trace Active and Enabled
Reset caused by Software reset
Blackfin support (C) 2004-2007 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.3
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 100 MHz System Clock
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
text = 0x00001000-0x0013b880
rodata = 0x0013c000-0x00191704
data = 0x00192000-0x001a6000
stack = 0x00192000-0x00194000
init = 0x001a6000-0x001b9000
bss = 0x001b9000-0x001c9b10
available = 0x001c9b10-0x02000000
rootfs = 0x02000000-0x03f00000
DMA Zone = 0x03f00000-0x04000000
MPU: setting up cplb tables with memory protection
Instruction Cache Enabled
Data Cache Enabled (write-back)
Built 1 zonelists. Total pages: 8128
Kernel command line: root=/dev/mtdblock0 rw console=ttyBF0,115200
Configuring Blackfin Priority Driven Interrupts
Hardware Trace expanded to 2k
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory available: 28376k/65536k RAM, (76k init code, 1258k kernel code, 492k data, 1024k dma, 2568k reserved)
Blackfin Scratchpad data SRAM: 4 KB
Blackfin Data A SRAM: 16 KB (15 KB free)
Blackfin Data B SRAM: 16 KB (13 KB free)
Blackfin Instruction SRAM: 48 KB (40 KB free)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
msat_ip_board_init(): registering device resources
msat_ip_board_init(): registering Blackfin SPI resources
msat_ip_board_init(): finished registering Blackfin SPI resources
Generic PHY: Registered new driver
SCSI subsystem initialized
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
JFFS2 version 2.2. (NAND) Â 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
ISA-BlackFin-CAN CAN Driver 3.4.6_AD_BLACKFIN (c) Jan 28 2009
BlackFin port by H.J. Oertel (oe@port.de)
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
MSAT-IP leds driver
MSAT-IP ptts driver
MSAT-IP cors driver
RLC-DSP4 pls driver
RLC-DSP4 inputs driver
RLC-DSP4 outputs driver
RLC-DSP4 dtmf_data driver
RLC-DSP4 ltc1863_adc driver
ltc1863_spi_init
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 20) is a BFIN-UART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)
bfin_mac: Version 1.1, Blackfin BF53[67] BF527 on-chip Ethernet MAC driver
uclinux[mtd]: RAM probe address=0x2000000 size=0x1f00000
Creating 1 MTD partitions on "RAM":
0x00000000-0x01f00000 : "ROMfs"
m25p80 spi0.1: m25p128 (16384 Kbytes)
Creating 4 MTD partitions on "m25p80":
0x00000000-0x00040000 : "bootloader"
0x00040000-0x00080000 : "bootloader-environment"
0x00080000-0x00e00000 : "kernel"
0x00e00000-0x01000000 : "file system"
ltc1863_spi_probe with spi pointer 0x0058bb84
ltc1863_spi_probe: chip 0058aeac, spi 0058bb84
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
bfin-spi-gpio-mstr: registering platform driver
bfin-spi-gpio-mstr: bfin_spi_gpio_probe()
bits_per_word not specified in spi_bitbang_setup. Defaulting to 32.
bits_per_word not specified in spi_bitbang_setup. Defaulting to 32.
Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).
dma_alloc_init: dma_page @ 0x005a0000 - 256 pages at 0x03f00000
snd_ad1836_configure
ALSA device list:
#0: ADI ad1836 at PF4 SPORT0 rx/tx dma 3/4 err irq 45
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (ext2 filesystem).
_____________________________________
a8888b. / Welcome to the uClinux distribution \
d888888b. / _ _ \
8P"YP"Y88 / | | |_| __ __ (TM) |
8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
8' .88 \ | | | | _ \| | | | \ / |
8`._.' Y8. \ | |__ | | | | | |_| | / \ |
d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
dP . Y8b. \ For embedded processors including |
d8:' " `::88b \ the Analog Devices Blackfin /
d8" 'Y88b \___________________________________/
:8P ' :888
8a. : _a88P For further information, check out:
._/"Yaa_: .| 88P| - http://blackfin.uclinux.org/
\ YP" `| 8P `. - http://docs.blackfin.uclinux.org/
/ \.___.d| .' - http://www.uclinux.org/
`--..__)8888P`._.' jgs/a:f - http://www.analog.com/blackfin
Have a lot of fun...
CPLB protection violation
- Illegal instruction fetch access (memory protection violation).
Defered Exception context
CURRENT PROCESS:
COMM=init PID=1
TEXT = 0x005c0000-0x005c2a00 DATA = 0x005bfa00-0x005bfe48
BSS = 0x005bfe48-0x005e0000 USER-STACK = 0x005fff00
return address: [0x0068e886]; contents of:
0x0068e860: b0f2 3039 3017 63f8 300b e300 0007 e801
0x0068e870: 0000 0538 0010 0000 0578 e800 0003 a1bb
0x0068e880: e128 0072 00a0 [3038] e120 f000 0a07 1006
0x0068e890: 3007 e801 0000 0538 0010 e3ff e8b2 3210
SEQUENCER STATUS: Not tainted
SEQSTAT: 0000202b IPEND: 0030 SYSCFG: 0006
HWERRCAUSE: 0x0
EXCAUSE : 0x2b
RETE: <0x00000000> /* Maybe null pointer? */
RETN: <0x00466000> /* unknown address */
RETX: <0x0068e886> [ /lib/libuClibc-0.9.29.so + 0xe886 ]
RETS: <0x0068e852> [ /lib/libuClibc-0.9.29.so + 0xe852 ]
PC : <0x0068e886> [ /lib/libuClibc-0.9.29.so + 0xe886 ]
DCPLB_FAULT_ADDR: <0x001bb880> /* unknown address */
ICPLB_FAULT_ADDR: <0x0000e498> { _release_console_sem + 0x1c0 }
PROCESSOR STATE:
R0 : 00000077 R1 : 005ffd10 R2 : 00000000 R3 : 00000000
R4 : 005fff04 R5 : 005fff04 R6 : 00000001 R7 : 00000077
P0 : 00000072 P1 : 0068e840 P2 : 005d11f0 P3 : 006c1bd8
P4 : 006c3d94 P5 : 005bfdcc FP : 005ffc60 SP : 00465f24
LB0: 005ce181 LT0: 005ce174 LC0: 00000000
LB1: 005ccec7 LT1: 005ccec6 LC1: 00000000
B0 : 00000000 L0 : 00000000 M0 : 00000000 I0 : 005ffce9
B1 : 00000000 L1 : 00000000 M1 : 00000000 I1 : 006c1bd8
B2 : 00000000 L2 : 00000000 M2 : 00000000 I2 : 00000000
B3 : 00000000 L3 : 00000000 M3 : 00000000 I3 : 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
USP : 005ffc54 ASTAT: 02003025
Hardware Trace:
0 Target : <0x000044a4> { _dump_bfin_trace_buffer + 0x0 }
Source : <0x00004ae8> { _trap_c + 0x12c }
1 Target : <0x00004ae8> { _trap_c + 0x12c }
Source : <0x000044a0> { _show_regs + 0x394 }
2 Target : <0x0000449a> { _show_regs + 0x38e }
Source : <0x0000e0da> { _printk + 0x16 }
3 Target : <0x0000e0d6> { _printk + 0x12 }
Source : <0x0000df94> { _vprintk + 0x1c0 }
4 Target : <0x0000df7a> { _vprintk + 0x1a6 }
Source : <0x0000e4d6> { _release_console_sem + 0x1fe }
5 Target : <0x0000e4d0> { _release_console_sem + 0x1f8 }
Source : <0x0000ddb0> { _wake_up_klogd + 0x24 }
6 Target : <0x0000dd8c> { _wake_up_klogd + 0x0 }
Source : <0x0000e4cc> { _release_console_sem + 0x1f4 }
7 Target : <0x0000e4c8> { _release_console_sem + 0x1f0 }
Source : <0x0000e4ba> { _release_console_sem + 0x1e2 }
8 Target : <0x0000e4b0> { _release_console_sem + 0x1d8 }
Source : <0x0000e4a2> { _release_console_sem + 0x1ca }
9 Target : <0x0000e358> { _release_console_sem + 0x80 }
Source : <0x0000e326> { _release_console_sem + 0x4e }
10 Target : <0x0000e464> { _release_console_sem + 0x18c }
Source : <0x0000e45e> { _release_console_sem + 0x186 }
11 Target : <0x0000dc68> { __call_console_drivers + 0x60 }
Source : <0x0000dc62> { __call_console_drivers + 0x5a }
12 Target : <0x0000dc42> { __call_console_drivers + 0x3a }
Source : <0x0000dc32> { __call_console_drivers + 0x2a }
13 Target : <0x0000dc22> { __call_console_drivers + 0x1a }
Source : <0x0000dc08> { __call_console_drivers + 0x0 }
14 Target : <0x0000e45a> { _release_console_sem + 0x182 }
Source : <0x0000e450> { _release_console_sem + 0x178 }
15 Target : <0x0000e3de> { _release_console_sem + 0x106 }
Source : <0x0000e3d8> { _release_console_sem + 0x100 }
16 Target : <0x0000dc68> { __call_console_drivers + 0x60 }
Source : <0x0000dc62> { __call_console_drivers + 0x5a }
17 Target : <0x0000dc06> { ___call_console_drivers + 0x52 }
Source : <0x0000dbfa> { ___call_console_drivers + 0x46 }
18 Target : <0x000b3eae> { _bfin_serial_console_write + 0x46 }
Source : <0x000b3ea8> { _bfin_serial_console_write + 0x40 }
19 Target : <0x000b3e9a> { _bfin_serial_console_write + 0x32 }
Source : <0x000b3e96> { _bfin_serial_console_write + 0x2e }
20 Target : <0x000b1b08> { _uart_console_write + 0x44 }
Source : <0x000b1afe> { _uart_console_write + 0x3a }
21 Target : <0x000b3e62> { _bfin_serial_console_putchar + 0x52 }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
22 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
23 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
[snip - the same two addresses repeat over and over]
262 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
263 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
264 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x0000e482> { _release_console_sem + 0x1aa }
Stack from 00465f00:
00000000 005ffc60 ffa007c0 00196564 00196564 00196560 00000000 005fff04
000b1876 0068e886 00000030 0000202b 00000000 00466000 0068e886 0068e886
0068e852 00000077 02003025 005ccec7 005ce181 005ccec6 005ce174 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 006c1bd8 005ffce9 005ffc54 005ffc60 005bfdcc
Call Trace:
CPLB protection violation
- Illegal instruction fetch access (memory protection violation).
Defered Exception context
CURRENT PROCESS:
COMM=init PID=1
TEXT = 0x005c0000-0x005c2a00 DATA = 0x005bfa00-0x005bfe48
BSS = 0x005bfe48-0x005e0000 USER-STACK = 0x005fff00
return address: [0x0068e886]; contents of:
0x0068e860: b0f2 3039 3017 63f8 300b e300 0007 e801
0x0068e870: 0000 0538 0010 0000 0578 e800 0003 a1bb
0x0068e880: e128 0072 00a0 [3038] e120 f000 0a07 1006
0x0068e890: 3007 e801 0000 0538 0010 e3ff e8b2 3210
SEQUENCER STATUS: Not tainted
SEQSTAT: 0006202b IPEND: 0030 SYSCFG: 0006
HWERRCAUSE: 0x18
EXCAUSE : 0x2b
RETE: <0x00000000> /* Maybe null pointer? */
RETN: <0x00466000> /* unknown address */
RETX: <0x0068e886> [ /lib/libuClibc-0.9.29.so + 0xe886 ]
RETS: <0x0068e852> [ /lib/libuClibc-0.9.29.so + 0xe852 ]
PC : <0x0068e886> [ /lib/libuClibc-0.9.29.so + 0xe886 ]
DCPLB_FAULT_ADDR: <0x00196570> /* unknown address */
ICPLB_FAULT_ADDR: <0x0000e498> { _release_console_sem + 0x1c0 }
PROCESSOR STATE:
R0 : 00000077 R1 : 005ffd10 R2 : 00000000 R3 : 00000000
R4 : 005fff04 R5 : 005fff04 R6 : 00000001 R7 : 00000077
P0 : 00000072 P1 : 0068e840 P2 : 005d11f0 P3 : 006c1bd8
P4 : 006c3d94 P5 : 005bfdcc FP : 005ffc60 SP : 00465f24
LB0: 005ce181 LT0: 005ce174 LC0: 00000000
LB1: 005ccec7 LT1: 005ccec6 LC1: 00000000
B0 : 00000000 L0 : 00000000 M0 : 00000000 I0 : 005ffce9
B1 : 00000000 L1 : 00000000 M1 : 00000000 I1 : 006c1bd8
B2 : 00000000 L2 : 00000000 M2 : 00000000 I2 : 00000000
B3 : 00000000 L3 : 00000000 M3 : 00000000 I3 : 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
USP : 005ffc54 ASTAT: 02003025
Hardware Trace:
0 Target : <0x000044a4> { _dump_bfin_trace_buffer + 0x0 }
Source : <0x00004ae8> { _trap_c + 0x12c }
1 Target : <0x00004ae8> { _trap_c + 0x12c }
Source : <0x000044a0> { _show_regs + 0x394 }
2 Target : <0x0000449a> { _show_regs + 0x38e }
Source : <0x0000e0da> { _printk + 0x16 }
3 Target : <0x0000e0d6> { _printk + 0x12 }
Source : <0x0000df94> { _vprintk + 0x1c0 }
4 Target : <0x0000df7a> { _vprintk + 0x1a6 }
Source : <0x0000e4d6> { _release_console_sem + 0x1fe }
5 Target : <0x0000e4d0> { _release_console_sem + 0x1f8 }
Source : <0x0000ddb0> { _wake_up_klogd + 0x24 }
6 Target : <0x0000dd8c> { _wake_up_klogd + 0x0 }
Source : <0x0000e4cc> { _release_console_sem + 0x1f4 }
7 Target : <0x0000e4c8> { _release_console_sem + 0x1f0 }
Source : <0x0000e4ba> { _release_console_sem + 0x1e2 }
8 Target : <0x0000e4b0> { _release_console_sem + 0x1d8 }
Source : <0x0000e4a2> { _release_console_sem + 0x1ca }
9 Target : <0x0000e358> { _release_console_sem + 0x80 }
Source : <0x0000e326> { _release_console_sem + 0x4e }
10 Target : <0x0000e464> { _release_console_sem + 0x18c }
Source : <0x0000e45e> { _release_console_sem + 0x186 }
11 Target : <0x0000dc68> { __call_console_drivers + 0x60 }
Source : <0x0000dc62> { __call_console_drivers + 0x5a }
12 Target : <0x0000dc42> { __call_console_drivers + 0x3a }
Source : <0x0000dc32> { __call_console_drivers + 0x2a }
13 Target : <0x0000dc22> { __call_console_drivers + 0x1a }
Source : <0x0000dc08> { __call_console_drivers + 0x0 }
14 Target : <0x0000e45a> { _release_console_sem + 0x182 }
Source : <0x0000e450> { _release_console_sem + 0x178 }
15 Target : <0x0000e3de> { _release_console_sem + 0x106 }
Source : <0x0000e3d8> { _release_console_sem + 0x100 }
16 Target : <0x0000dc68> { __call_console_drivers + 0x60 }
Source : <0x0000dc62> { __call_console_drivers + 0x5a }
17 Target : <0x0000dc06> { ___call_console_drivers + 0x52 }
Source : <0x0000dbfa> { ___call_console_drivers + 0x46 }
18 Target : <0x000b3eae> { _bfin_serial_console_write + 0x46 }
Source : <0x000b3ea8> { _bfin_serial_console_write + 0x40 }
19 Target : <0x000b3e9a> { _bfin_serial_console_write + 0x32 }
Source : <0x000b3e96> { _bfin_serial_console_write + 0x2e }
20 Target : <0x000b1b08> { _uart_console_write + 0x44 }
Source : <0x000b1afe> { _uart_console_write + 0x3a }
21 Target : <0x000b3e62> { _bfin_serial_console_putchar + 0x52 }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
22 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
23 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
[and it repeats forever]
Thanks for any suggestions,
Steve
P.S. It seems that whenever there are two consecutive spaces like this " " in a message on this forum that it displays as an A with a "hat" over it in my email program (Eudora). This is the only forum or mailing list (of dozens I have joined) that works that way. Is there a chance that something isn't right with the forum software or configuration, or is it just my setup?
QuoteReplyEditDelete
2009-02-02 11:38:39 Re: _bfin_serial_console_putchar causes MPU violation?
Mike Frysinger (UNITED STATES)
Message: 68682
that trace shows that printk() was called after the crash happened, so it's most likely meaningless
you can try using the option that extends the hardware trace buffer to more than 16 entries
QuoteReplyEditDelete
2009-02-02 11:58:35 Re: _bfin_serial_console_putchar causes MPU violation?
Steve Strobel (UNITED STATES)
Message: 68684
That option is enabled, which is why it is printing 265 entries rather than just 16. Entries 22 through 263 are identical (some of them snipped for brevity), as shown in the original log and repeated below. Are you suggesting that I should extend the size of the trace buffer even more?
20 Target : <0x000b1b08> { _uart_console_write + 0x44 }
Source : <0x000b1afe> { _uart_console_write + 0x3a }
21 Target : <0x000b3e62> { _bfin_serial_console_putchar + 0x52 }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
22 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
23 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
[snip - the same two addresses repeat over and over]
262 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
263 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x000b3e36> { _bfin_serial_console_putchar + 0x26 }
264 Target : <0x000b3e4e> { _bfin_serial_console_putchar + 0x3e }
Source : <0x0000e482> { _release_console_sem + 0x1aa }
Steve
QuoteReplyEditDelete
2009-02-02 12:08:30 Re: _bfin_serial_console_putchar causes MPU violation?
Mike Frysinger (UNITED STATES)
Message: 68685
that just shows the console driver polling the status bit
are you using the latest 2008R1.5 svn branch ? there have been many fixes to the MPU since the release
QuoteReplyEditDelete
2009-02-02 12:38:42 Re: _bfin_serial_console_putchar causes MPU violation?
Steve Strobel (UNITED STATES)
Message: 68687
I appears from my notes that we are using uClinux-dist-2008R1.5-RC3.tar.bz2 with our drivers added. I will just turn the MPU off until I get a chance to update to a later version of the distribution. Thanks for your help.
Steve
QuoteReplyEditDelete
2009-02-02 13:14:58 Re: _bfin_serial_console_putchar causes MPU violation?
Mike Frysinger (UNITED STATES)
Message: 68689
that's best ... the MPU worked at first blush in the latest release, but under more usage it fell apart. that should all be fixed now in the latest svn branch though.