[#6845] ubifs errors after updating kernel.
Submitted By: Chris Page
Open Date
2011-10-25 15:40:35
Priority:
Medium High Assignee:
Aaron Wu
Status:
Open Fixed In Release:
N/A
Found In Release:
2010R1-RC5 Release:
2010R1-RC5
Category:
Memory Board:
Custom
Processor:
BF537 Silicon Revision:
3
Is this bug repeatable?:
Yes Resolution:
Out of Date
Uboot version or rev.:
2010R1-RC2 Toolchain version or rev.:
4.3.5
App binary format:
N/A
Summary: ubifs errors after updating kernel.
Details:
This is the same error as [#6839] (ubifs issues while updating kernel. 2010r1-rc5 mounted nand). I have had to create another bug report because it was closed without a proper resolution.
After further testing there seems to be an issue with the ubi/nand driver and
large nands. When I use the later kernel with a smaller nand device it seemed to
work fine. I went from using a NAND04GW (4Gbit) which gave me errors shown below to a smaller NAND512 (512Mbit) that worked fine.
The driver does not appear to handle large partitions. When I use a 400M BYTE
partition and move large files (10 M BYTES) back and forth from the nand to ram I get these errors after resetting and trying to copy them from nand to ram. I Noticed you were using a small nand with a small partition (around 2 M Bytes) and tested using small files.
Have you tested a large NAND memory with large files? The file system should be
able to handle this.
So to get these errors.
1.Use a large nand partition ~400 Mbytes.
2.Format the partition
3.Move large files ~10 Mbytes back and forth from nand to ram.
4.RESET the board.
5. Remount the partition and try moving large files again.
6. Repeat resetting and moving files and after a couple of attempts you will get these errors.
/* ERRORS */
uncorrectable error :
UBI error: ubi_io_read: error -74 while reading 2836 bytes from PEB 43:73120, read 2836 bytes
UBIFS error (pid 327): try_read_node: cannot read node type 1 from LEB 21:71072, error -74
UBIFS error (pid 327): ubifs_read_node: bad node type (17 but expected 0)
UBIFS error (pid 327): ubifs_read_node: bad node at LEB 15:10056
UBIFS error (pid 327): ubifs_iget: failed to read inode 74, error -22
UBIFS error (pid 327): ubifs_lookup: dead directory entry 'variance.so', error -22
UBIFS warning (pid 327): ubifs_ro_mode: switched to read-only mode, error -22
UBI: scrubbed PEB 2106 (LEB 0:15), data moved to PEB 2107
UBIFS error (pid 327): ubifs_read_node: bad node type (0 but expected 9)
UBIFS error (pid 327): ubifs_read_node: bad node at LEB 14:107304
UBIFS error (pid 327): ubifs_iget: failed to read inode 91, error -22
UBIFS error (pid 327): ubifs_lookup: dead directory entry 'prog2', error -22
UBI: scrubbed PEB 2105 (LEB 0:14), data moved to PEB 2106
Follow-ups
--- Sonic Zhang 2011-10-25 23:09:30
bug 6839 is duplicated to 6840. Why not comments in 6840 instead of submitting a
new one?
https://blackfin.uclinux.org/gf/tracker/6840
Bugs item #6840, was opened at 2011-10-24 19:46:38
Priority: 2
Submitted By: Chris Page (cpage3)
Assigned to: Aaron Wu (aaronwu1)
Summary: ubifs issues while updating kernel. 2010r1-rc5 mounted nand
Status: Open
--- Chris Page 2011-10-26 11:21:58
Hi
Since 6840 has been closed I will continue to use this bug report. Both of the
chips I am using are correctly identified by the nand driver. As can be seen in
startup code (NAND device: Manufacturer ID: 0x20, Chip ID: 0xdc (ST Micro NAND
512MiB 3,3V 8-bit)
)
In nand_ids.c the configuration is already done {"NAND 512MiB 3,3V
8-bit", 0xDC, 0, 512, 0, LP_OPTIONS}, and the page size and erase size are
determined from the extended id bytes. I have done all of the mtd tests and
passed.
The nand is in the mainline kernel and there is a bug. After more testing I
believe the errors are more of a result of large files ~10MByte been read and
written from ram to nand then resetting the board after the write or read has
completed.
--- Aaron Wu 2011-10-26 21:18:06
Thanks for the detailed info, did you do sync before resetting? Or will a
regular shutdown routine cause the same problem? Data in buffer may get lost if
press the reset or remove power suddenly
--- Chris Page 2011-10-26 23:19:51
Hi
Yes I make sure to sync every time. I even wait just to make sure there is no
data loss in the buffers. I have managed to get the same errors with files
around 2 Mega bytes in size. Files around 50 to 500 KBytes seem to be ok.
--- Chris Page 2011-10-28 15:04:13
Hi
I Would like to know the status of the bug.
--- Mingquan Pan 2011-10-31 02:28:25
HI, I have tried as you described in the tracker. Use a large file as you said
(10 M gfortran.log), with a partition to 100M.
Bytes transferred = 10621357 (a211ad hex)
## Booting kernel from Legacy Image at 01000000 ...
Image Name: bf548-0.2-3.0.0-ADI-2011R1-pre-s
Created: 2011-10-28 19:09:49 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 10621293 Bytes = 10.1 MiB
Load Address: 00001000
Entry Point: 002a1e48
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 002a1e48
Linux version 3.0.0-ADI-2011R1-pre-svn10111 (test@uclinux61-bf548-std) (gcc
version 4.3.5 (ADI-2011R1-RC2) ) #8 Sat Oct 29 03:09:41 CST 2011
register early platform devices
bootconsole [early_shadow0] enabled
bootconsole [early_BFuart1] enabled
early printk enabled on early_BFuart1
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x001cf960
rodata = 0x001cf960-0x00269248
bss = 0x0026a000-0x0027c43c
data = 0x0027c43c-0x00298000
stack = 0x00296000-0x00298000
init = 0x00298000-0x011b8000
available = 0x011b8000-0x03e00000
DMA Zone = 0x03e00000-0x04000000
Hardware Trace active and enabled
Boot Mode: 1
Reset caused by Software reset
Blackfin support (C) 2004-2010 Analog Devices, Inc.
Compiled for ADSP-BF548 Rev 0.2
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 525 MHz core clock and 131 MHz System Clock
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
External memory: cacheable in instruction cache
L2 SRAM : uncacheable in instruction cache
Data Cache Enabled for CPU0
External memory: cacheable (write-through) in data cache
L2 SRAM : uncacheable in data cache
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 15748
Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000
earlyprintk=serial,uart1,57600 console=ttyBF1,57600
ip=10.100.4.50:10.100.4.174:10.100.4.174:255.255.255.0:bf548-ezkit:eth0:off
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 44736k/65536k RAM, (15488k init code, 1850k kernel code, 802k
data, 2048k dma, 612k reserved)
NR_IRQS:295
Configuring Blackfin Priority Driven Interrupts
console [ttyBF1] enabled, bootconsole disabled
console [ttyBF1] enabled, bootconsole disabled
Calibrating delay loop... 1044.48 BogoMIPS (lpj=2088960)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (16 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (41 KB free)
Blackfin L2 SRAM: 128 KB (128 KB free)
NET: Registered protocol family 16
Blackfin DMA Controller
ezkit_init(): registering device resources
bio: create slab <bio-0> at 0
SCSI subsystem initialized
spi spi0.2: Warning: SPI CPHA not set: Slave Select not under software
control!
See Documentation/blackfin/bfin-spi-notes.txt
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0,
regs@ffc00500, dma channel@4
bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0,
regs@ffc02300, dma channel@5
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller,
regs_base@ffc00700
i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller,
regs_base@ffc02200
Advanced Linux Sound Architecture Driver Version 1.0.24.
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
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
debug-mmrs: setting up Blackfin MMR debugfs
msgmni has been set to 87
io scheduler noop registered (default)
bf54x-lq043: FrameBuffer initializing...
dma_alloc_init: dma_page @ 0x029f7000 - 512 pages at 0x03e00000
bfin-uart: Blackfin serial driver
bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 48) is a BFIN-UART
bfin-otp: initialized
brd: module loaded
register bfin atapi driver
scsi0 : pata-bf54x
ata1: PATA max UDMA/66 irq 68
physmap platform flash device: 02000000 at 20000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID
0x000089 Chip ID 0x00881e
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
Using physmap partition information
Creating 5 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000080000 : "bootloader(nor)"
0x000000080000-0x000000480000 : "linux kernel(nor)"
0x000000480000-0x000000fe0000 : "file system(nor)"
0x000000fe0000-0x000000ff8000 : "config(nor)"
0x000000ff8000-0x000001000000 : "u-boot env(nor)"
m25p80 spi0.1: m25p16 (2048 Kbytes)
Creating 2 MTD partitions on "m25p80":
0x000000000000-0x000000080000 : "bootloader(spi)"
0x000000080000-0x000000200000 : "linux kernel(spi)"
BF5xx on-chip NAND FLash Controller Driver, Version 1.2 (c) 2007 Analog
Devices, Inc.
bf5xx-nand bf5xx-nand.0: data_width=8, wr_dly=3, rd_dly=3
NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V
8-bit)
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000080000 : "bootloader(nand)"
0x000000080000-0x000000480000 : "linux kernel(nand)"
0x000000480000-0x000010000000 : "file system(nand)"
smsc911x: Driver version 2008-10-21
smsc911x-mdio: probed
smsc911x smsc911x.0: eth0: attached PHY driver [Generic PHY]
(mii_bus:phy_addr=0:01, irq=-1)
smsc911x smsc911x.0: eth0: MAC Address: 00:e0:22:fe:bf:4e
input: bf54x-keys as /devices/platform/bf54x-keys/input/input0
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
i2c /dev entries driver
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
ALSA device list:
No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting system clock to 2004-06-01 06:15:29 UTC
(1086070529)
smsc911x smsc911x.0: eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175
IP-Config: Complete:
device=eth0, addr=10.100.4.50, mask=255.255.255.0, gw=10.100.4.174,
host=bf548-ezkit, domain=, nis-domain=(none),
bootserver=10.100.4.174, rootserver=10.100.4.174, rootpath=
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card at address e624
ata1.00: ATA-6: TOSHIBA MK4032GAX, AD101A, max UDMA/100
ata1.00: 78140160 sectors, multi 16: LBA48
ata1.00: configured for UDMA/66
blk_queue_max_segments: set to minimum 1
scsi 0:0:0:0: Direct-Access ATA TOSHIBA MK4032GA AD10 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 78140160 512-byte logical blocks: (40.0 GB/37.2 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI disk
Freeing unused kernel memory: 15488k freed
_____________________________________
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.18.4 (2011-10-28 19:10:29 CST) hush - the humble shell
root:/> ubiattach /dev/ubi_ctrl -m 9
UBI: attaching mtd9 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: max. sequence number: 79
UBI: attached mtd9 to ubi0
UBI: MTD device name: "file system(nand)"
UBI: MTD device size: 251 MiB
UBI: number of good PEBs: 2012
UBI: number of bad PEBs: 0
UBI: number of corrupted PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 1175
UBI: total number of reserved PEBs: 837
UBI: number of PEBs reserved for bad PEB handling: 20
UBI: max/mean erase counter: 846/359
UBI: image sequence number: 1622483402
UBI: background thread "ubi_bgt0d" started, PID 329
UBI device number 0, total 2012 LEBs (259596288 bytes, 247.6 MiB), available
1175 LEBs (151603200 bytes, 144.6 MiB), LEB size 129024 bytes (126.0 KiB)
root:/> mount -t ubifs ubi0:ubifs0 /mnt
UBIFS: mounted UBI device 0, volume 0, name "ubifs0"
UBIFS: file system size: 103606272 bytes (101178 KiB, 98 MiB, 803 LEBs)
UBIFS: journal size: 5160960 bytes (5040 KiB, 4 MiB, 40 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 4893579 bytes (4778 KiB)
root:/> ls /mnt/
2 3 gfortran-4.3.log
root:/> cp /mnt/gfortran-4.3.log /home/
root:/> cp /mnt/gfortran-4.3.log /
root:/> cp gfortran-4.3.log /mnt/3/
root:/> cp gfortran-4.3.log /mnt/3/
root:/> cp gfortran-4.3.log /mnt/3/
root:/> ls -lh gfortran-4.3.log
-rwxr-xr-x 1 root root 11.5M Jun 1 06:16 gfortran-4.3.log
root:/> umount /mnt/
UBIFS: un-mount UBI device 0, volume 0
root:/>
root:/> reboot
sd 0:0:0:0: [sda] Synchronizing SCSI cache
Restarting system.
U-Boot 2010.06-svn2467 (ADI-2010R1) (Oct 08 2010 - 16:04:41)
CPU: ADSP bf548-0.0 (Detected Rev: 0.2) (parallel flash boot)
Board: ADI BF548 EZ-Kit board
Support: http://blackfin.uclinux.org/
Clock: VCO: 525 MHz, Core: 525 MHz, System: 131.250 MHz
RAM: 64 MiB
Flash: 16 MiB
NAND: 256 MiB
MMC: Blackfin SDH: 0
In: serial
Out: serial
Err: serial
KGDB: [on serial] ready
Net: smc911x-0
Hit any key to stop autoboot: 0
I run this successively for serveral times and copy gfortran.log to and from
/mnt and root directory every time, I don't see your error message and it can
work ok.
--- Aaron Wu 2011-10-31 03:55:17
Thanks Grace for verification on the trunk. I tried reading/writing to and from
the ubifs partition of 243MB with a large file of 10MB, then reset, reboot,
repeating for a couple of times. I see no difference.
--- Aaron Wu 2011-10-31 03:56:30
My test is done on 2010R1 release with a bf548 board with NAND on it.
--- Chris Page 2011-10-31 17:57:03
I will post on the forum to see if anybody else can reproduce this. The nand
device is in the mainline kernel, passes all mtd tests. The nand works when I
use 2009R1. Once I updated to 2010R1-RC5 I get these errors. Thanks for
checking. I am shocked it is not reproducible. Which 2010R1 release candidate
were you using? Maybe I will try that.
--- Aaron Wu 2011-11-01 01:06:31
The standard 2010R1 release. SVN rev 9993.
--- Chris Page 2011-11-08 10:16:40
I am using the same. The bug has nothing to do with the files. There is a bug
with the ST Micro Nand Flash on EBIU. Both of the nand flashes I was checking
were ST Micro. I am not the only one. Look at the following links. Similar
issues even on the latest kernel.
http://ez.analog.com/thread/9923
Remember I only got these errors after updating to 2010R1.
--- Chris Page 2011-11-08 13:26:14
In addition to what I just posted I wanted to note these issues also arise with
the bf537. The bf54x use the Blackfin on-chip NAND Flash Controller drive which
the bf537 does not. This is a bug with the 537 and ST Micro Nand Flash.
--- Sonic Zhang 2011-11-08 22:06:39
We don't have your ST Macro Nand Flash addon board for bf537-stamp. If you could
ship one to us, we can help to debug.
--- Chris Page 2011-11-08 23:27:05
Could you please provide me with you shipping address. Who should I make it out
to? I could will send one of our boards with the NAND on it. Programs the same
as a stamp board. I will also send a separate NAND flash.
--- Aaron Wu 2011-11-09 00:18:12
Hi Chris,
We just tried the BF537 aync interface for a ST NAND01GW chip on 2010R1
release, we see no problem. Likely your problem happens on specific chip.
ubiattach /dev/ubi_ctrl -m 1
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: attached mtd1 to ubi0
UBI: MTD device name: "file system(nand)"
UBI: MTD device size: 124 MiB
UBI: number of good PEBs: 992
UBI: number of bad PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 816
UBI: total number of reserved PEBs: 176
UBI: number of PEBs reserved for bad PEB handling: 9
UBI: max/mean erase counter: 2/1
UBI: image sequence number: 0
UBI: background thread "ubi_bgt0d" started, PID 228
UBI device number 0, total 992 LEBs (127991808 bytes, 122.1 MiB), available 816
LEBs (105283584 bytes, 100.4 MiB), LEB size 129024 bytes (126.0 KiB)
root:/> mount -t ubifs ubi0:ubifs0 /mnt
UBIFS: mounted UBI device 0, volume 0, name "ubifs0"
UBIFS: file system size: 19869696 bytes (19404 KiB, 18 MiB, 154 LEBs)
UBIFS: journal size: 1032193 bytes (1008 KiB, 0 MiB, 8 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 938494 bytes (916 KiB)
root:/> cp test_data /mnt
--- Aaron Wu 2011-11-09 00:27:36
Hi Chris, here is the adress:
10F, 1010-1018, One corporate Avenue, 222 Hubin Road, Shanghai, 200021, China.
Please ship to Aaron Wu.
Telephone: 8621-23208064
Yes please ship us a suite of your board, with other hardware stuffs like power
supply etc, and share me information about how to boot it. Please also send a
seperate Nand Chip.
--- Chris Page 2011-11-09 21:41:24
Hi Aaron,
As I was going through all the steps to program, recreate, and test the board
before I shipped it I think I figured something out. From u-boot I would erase
and clean the nand. I would then boot the image and format and mount the ubi.
This time I did a flash_eraseall (from the kernel) before formatting the UBI and
it seems to work. I had tried to flash_eraseall before but used the -j option.
With the -j option it didn't work (not sure if it has something to do with not
having gluebi configured) in this newer release. So flash_eraseall before
formatting seems to have corrected it. I will be doing more tests tomorrow and
throughout the week to make sure. If the errors arise again I will let you know.
Thanks for your patience and your help.
--- Sonic Zhang 2011-12-09 05:02:34
No follow up information from customers.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
bugreport.tar.gz application/x-gzip 20225 Chris Page