[#5288] copy to spi flash on bf526 ezbrd would trigger kernel panic.
Submitted By: Mingquan Pan
Open Date
2009-06-22 04:00:31 Close Date
2009-08-07 00:33:43
Priority:
Medium Assignee:
Graf Yang
Status:
Closed Fixed In Release:
N/A
Found In Release:
N/A Release:
Category:
N/A Board:
N/A
Processor:
BF526 Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Fixed
Uboot version or rev.:
Toolchain version or rev.:
09r1-rc7
App binary format:
N/A
Summary: copy to spi flash on bf526 ezbrd would trigger kernel panic.
Details:
copy to spi flash on bf526 ezbrd would trigger kernel panic.
## Booting kernel from Legacy Image at 02000000 ...
Image Name: Linux-2.6.28.10-ADI-2009R1-svn68
Created: 2009-06-22 8:53:39 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 2322058 Bytes = 2.2 MB
Load Address: 00001000
Entry Point: 001cb694
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 001cb694
Linux version 2.6.28.10-ADI-2009R1-svn6816 (test@uclinux81-bf526) (gcc version 4.1.2 (ADI svn)) #45 Mon Jun 22 08:53:29 GMT 2009
console [early_BFuart0] enabled
early printk enabled on early_BFuart0
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x00135380
rodata = 0x00135380-0x00197670
bss = 0x00198000-0x001a9820
data = 0x001a9820-0x001be000
stack = 0x001bc000-0x001be000
init = 0x001be000-0x00420000
available = 0x00420000-0x03eff000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Boot Mode: 1
Blackfin support (C) 2004-2009 Analog Devices, Inc.
Compiled for ADSP-BF526 Rev 0.0
Warning: Compiled for Rev 0, but running on Rev 65535
Warning: Unsupported Chip Revision ADSP-BF526 Rev 0.65535 detected
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 400 MHz core clock and 80 MHz System Clock
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
Data Cache Enabled for CPU0 (write-back)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16001
Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 ip=10.100.4.50:10.100.4.174:192.168.0.1:255.255.255.0:bf526-ezbrd:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 59716k/65536k RAM, (2440k init code, 1232k kernel code, 548k data, 1024k dma, 572k reserved)
Calibrating delay loop... 796.67 BogoMIPS (lpj=1593344)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (15 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (42 KB free)
net_namespace: 288 bytes
NET: Registered protocol family 16
Blackfin DMA Controller
ezbrd_init(): registering device resources
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
musb_hdrc: version 6.0, musb-dma, host, debug=0
musb_hdrc: USB Host mode controller at ffc03800 using DMA, IRQ 59
musb_hdrc musb_hdrc.0: MUSB HDRC host driver
musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
dma_alloc_init: dma_page @ 0x03ece000 - 256 pages at 0x03f00000
hub 1-0:1.0: 1 port detected
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 116
io scheduler noop registered (default)
bfin-otp: initialized
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc02000 (irq = 31) is a BFIN-UART
brd: module loaded
bfin_mii_bus: probed
bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=15)@sclk=80MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
Driver \'sd\' needs updating - please use bus_type methods
physmap platform flash device: 00400000 at 20000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
cfi_cmdset_0001: Erase suspend on write enabled
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on \"physmap-flash.0\":
0x00000000-0x00040000 : \"bootloader(nor)\"
0x00040000-0x00200000 : \"linux kernel(nor)\"
0x00200000-0x00400000 : \"file system(nor)\"
m25p80 spi0.1: sst25wf040 (512 Kbytes)
Creating 2 MTD partitions on \"m25p80\":
0x00000000-0x00040000 : \"bootloader(spi)\"
0x00040000-0x00080000 : \"linux kernel(spi)\"
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc01400
TCP cubic registered
NET: Registered protocol family 17
IP-Config: Gateway not on directly connected network.
Freeing unused kernel memory: 2440k freed
PHY: 0:01 - Link is Up - 100/Full
_____________________________________
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...
BusyBox v1.13.4 (2009-06-22 06:29:04 GMT) built-in shell (msh)
Enter \'help\' for a list of built-in commands.
root:/> version
kernel: Linux release 2.6.28.10-ADI-2009R1-svn6816, build #45 Mon Jun 22 08:53:29 GMT 2009
toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release svn-8335, build #775 Mon Jun 22 08:53:05 GMT 2009
root:/>
************** STEP 3: MTD test
cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00010000 \"bootloader(nor)\"
mtd1: 001c0000 00010000 \"linux kernel(nor)\"
mtd2: 00200000 00010000 \"file system(nor)\"
mtd3: 00040000 00001000 \"bootloader(spi)\"
mtd4: 00040000 00001000 \"linux kernel(spi)\"
root:/>
Case 1 ...PASS
Case 1 ...PASS
************** STEP 4: Mount MTD
mount -t jffs2 /dev/mtdblock4 /mnt
root:/>
Case 2 ...PASS
Case 2 ...PASS
************** STEP 5: Reading MTD
ls /mnt
root:/>
************** STEP 6: Reading MTD
umount /mnt
root:/>
Case 3 ...PASS
Case 3 ...PASS
************** STEP 7: Erase MTD
flash_eraseall /dev/mtd4
Erasing 4 Kibyte @ 40000 -- 100 % complete.
root:/>
Case 4 ...PASS
Case 4 ...PASS
************** STEP 8: Make jffs2 image
1)create file system directory
mkdir -p rootfs
root:/>
2)create test file
echo This is test for mtd driver > rootfs/test
root:/>
3)create JFFS2 image
mkfs.jffs2 -n -r rootfs -s 4096 -e 65536 -o mtd.img
root:/>
************** STEP 9: Writing MTD
cp mtd.img /dev/mtd4
root:/>
Case 5 ...PASS
Case 5 ...PASS
************** STEP 10: Reading MTD
mount -t jffs2 /dev/mtdblock4 /mnt
root:/>
Case 6 ...PASS
Case 6 ...PASS
************** STEP 11: cp pwd to JFFS.
cp /bin/pwd /mnt
Node totlen on flash (0xffffffff) != totlen from node ref (0x0000000c)
Node totlen on flash (0xffffffff) != totlen from node ref (0x00000044)
Node CRC ffffffff != calculated CRC f09e7845 for node at 0003e07c
Hardware Trace:
0 Target : <0x000048ac> { _dump_bfin_trace_buffer + 0x0 }
Source : <0x00073e18> { _jffs2_write_end + 0x24 } CALL pcrel
1 Target : <0x00073df4> { _jffs2_write_end + 0x0 }
Source : <0x0002c5e8> { _generic_file_buffered_write + 0x140 } CALL (P2)
2 Target : <0x0002c5ca> { _generic_file_buffered_write + 0x122 }
Source : <0x00008498> { _blackfin_dcache_flush_range + 0x18 } RTS
3 Target : <0x00008490> { _blackfin_dcache_flush_range + 0x10 }
Source : <0x000084a0> { _blackfin_dflush_page + 0x4 } JUMP.S
4 Target : <0x0000849c> { _blackfin_dflush_page + 0x0 }
Source : <0x0002c5c6> { _generic_file_buffered_write + 0x11e } CALL pcrel
5 Target : <0x0002c5a8> { _generic_file_buffered_write + 0x100 }
Source : <0x0002b91e> { _iov_iter_copy_from_user_atomic + 0x76 } RTS
6 Target : <0x0002b906> { _iov_iter_copy_from_user_atomic + 0x5e }
Source : <0x0002b92c> { _iov_iter_copy_from_user_atomic + 0x84 } JUMP.S
7 Target : <0x0002b92a> { _iov_iter_copy_from_user_atomic + 0x82 }
Source : <0x00094fb2> { _memcpy + 0x4e } RTS
8 Target : <0x00094f94> { _memcpy + 0x30 }
Source : <0x00094f86> { _memcpy + 0x22 } IF !CC JUMP
9 Target : <0x00094f64> { _memcpy + 0x0 }
Source : <0x0002b926> { _iov_iter_copy_from_user_atomic + 0x7e } CALL pcrel
10 Target : <0x0002b920> { _iov_iter_copy_from_user_atomic + 0x78 }
Source : <0x0002b902> { _iov_iter_copy_from_user_atomic + 0x5a } IF !CC JUMP
11 Target : <0x0002b900> { _iov_iter_copy_from_user_atomic + 0x58 }
Source : <0xffa00212> { __access_ok + 0xba } RTS
12 Target : <0xffa00210> { __access_ok + 0xb8 }
Source : <0xffa00222> { __access_ok + 0xca } IF !CC JUMP
13 Target : <0xffa00218> { __access_ok + 0xc0 }
Source : <0xffa0018c> { __access_ok + 0x34 } IF CC JUMP
14 Target : <0xffa00158> { __access_ok + 0x0 }
Source : <0x0002b8fc> { _iov_iter_copy_from_user_atomic + 0x54 } CALL pcrel
15 Target : <0x0002b8a8> { _iov_iter_copy_from_user_atomic + 0x0 }
Source : <0x0002c5a4> { _generic_file_buffered_write + 0xfc } CALL pcrel
BUG: failure at fs/jffs2/file.c:251/jffs2_write_end()!
Kernel panic - not syncing: BUG!
Follow-ups
--- Mingquan Pan 2009-06-22 04:15:52
Since the spi flash size on bf526 ezbrd is especially small, I change
"pwd" to "version" to be copied over to /mnt, sill get the
panic error.
lrwxrwxrwx 1 root root 7 Jun 22 2009 pwd -> busybox
-rwxr-xr-x 1 root root 401540 Jun 22 2009 busybox
-rwxr--r-- 1 root root 19268 Jun 22 2009 version
--- Graf Yang 2009-06-22 04:34:38
This spi flash erase with 4K,
Erasing 4 Kibyte @ 40000 -- 100 % complete.
But you create a image with erase 65536,
mkfs.jffs2 -n -r rootfs -s 4096 -e 65536 -o mtd.img
So you copy a wrong fs to this partition. I will check it more.
--- Mingquan Pan 2009-06-25 23:33:03
I have tried with 4096, but it says the size is too small on bf526 0.0 board:
root:/> mkfs.jffs2 -n -r rootfs -s 4096 -e 4096 -o mtd.img
Erase size 0x1000 too small. Increasing to 8KiB minimum
And still have this panic if the erase size is increased to 8k.
--- Graf Yang 2009-07-02 01:42:28
It's a driver bug, now is fixed.
--- Mingquan Pan 2009-07-07 05:35:32
After erasing the spi flash in the u-boot (sf erase 0x40000 0x40000), this issue
looks gone and the case can pass now.
--- Mingquan Pan 2009-07-30 02:55:25
However, this issue still shows up in regression testing and need sf erase
0x40000 0x40000 before every time run the regression test. So reopen it for
detailed investigation.
And more strange, in the test script, there is flash_eraseall /dev/mtd4, which
should has the same effect as "sf erase 0x40000 0x40000 ", why it
doesn't work and need sf erase command?
--- Graf Yang 2009-08-03 03:34:39
It's the driver bug, SST SPI flash will set the BP0 and BP1 to 1 at power up, we
need clear them at probe.
--- Mingquan Pan 2009-08-07 05:33:46
Yes, it is seen pass on regression machine.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found