[#4765] u-boot crashs on fat operation

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

[#4765] u-boot crashs on fat operation

Submitted By: Cliff Cai

Open Date

2008-12-30 03:17:48     Close Date

2008-12-31 01:15:49

Priority:

Medium     Assignee:

Bryan Wu

Category:

N/A     Fixed In Release:

N/A

Found In Release:

N/A     Status:

Closed

Board:

EZ-Kit Lite     Processor:

N/A

Silicon Revision:

    Resolution:

Fixed

Is the bug repeatable?:

yes     

Summary: u-boot crashs on fat operation

Details:

 

running "fatls" will cause u-boot to crash

r1559 is OK,while r1560 is not OK.

 

Cliff

 

 

bfin> mmcinit

CID information:

Manufacturer ID:       03

OEM/Application ID:    5344

Product name:          SD02G

Product Revision:      8.0

Product Serial Number: 271617822

Manufacturing Date:    07/06

SD Card detected (RCA 59852)

CSD information:

CSD structure version:   1.0

Card command classes:    5f5

Max trans speed: 25MHz

Read block length:       1024

Write block length:      1024

Card capacity:          2032664576 bytes

 

bfin> fatls mmc 0

mmc: bread failed, status = 0022a020, card status = 00000b00

 

Ack! Something bad happened to the Blackfin!

 

SEQUENCER STATUS:

SEQSTAT: 00000024  IPEND: 8008  SYSCFG: 0032

  HWERRCAUSE: 0x0: undef

  EXCAUSE   : 0x24: misaligned data

  physical IVG15 asserted : <0x03f40518> { _evt_default + 0x0 }

RETE: <0x0b020002> { ___ashrdi3 + 0x70bd90e }

RETN: <0x0c104222> { ___ashrdi3 + 0x81a1b2e }

RETX: <0x03f5b434> { _do_fat_read + 0x264 }

RETS: <0x03f5b834> { _do_fat_read + 0x664 }

RETI: <0x03f400d6> { _start + 0xd6 }

DCPLB_FAULT_ADDR: <0x03fc80dc> { ___ashrdi3 + 0x659e8 }

ICPLB_FAULT_ADDR: <0x03f5b434> { _do_fat_read + 0x264 }

 

PROCESSOR STATE:

R0 : 00000020    R1 : 00000000    R2 : 00000019    R3 : 00000001

R4 : 03f67324    R5 : 00000002    R6 : 000001f7    R7 : 03e7fad4

P0 : 03e7fadc    P1 : 00000000    P2 : 03e7fad5    P3 : 03f635f9

P4 : 03fc80c1    P5 : 03e7ff80    FP : 00000000    SP : 03e7e42c

LB0: 03f40d1a    LT0: 03f40d18    LC0: 00000000

LB1: 03f583fa    LT1: 03f583f4    LC1: 00000000

B0 : 0000000b    L0 : 00000000    M0 : 0000003f    I0 : 00000000

B1 : 03eeb118    L1 : 00000000    M1 : 0000000f    I1 : 03e7fa94

B2 : 03eec3f0    L2 : 00000000    M2 : 7f2c3fe6    I2 : 00001414

B3 : 000001ff    L3 : 00000000    M3 : 03f6c374    I3 : 00000001

A0.w: 020d0000   A0.x: 00000000   A1.w: 000036da   A1.x: 00000000

USP : ffb00ffc  ASTAT: 00003004

 

Hardware Trace:

   0 Target : <0x03f40b00> { _bfin_panic + 0x0 }

     Source : <0x03f40c7c> { _trap_c + 0x140 }

   1 Target : <0x03f40c70> { _trap_c + 0x134 }

     Source : <0x03f40b58> { _trap_c + 0x1c }

   2 Target : <0x03f40b3c> { _trap_c + 0x0 }

     Source : <0x03f404be> { _trap + 0x56 }

   3 Target : <0x03f40468> { _trap + 0x0 }

     Source : <0x03f5b432> { _do_fat_read + 0x262 }

   4 Target : <0x03f5b428> { _do_fat_read + 0x258 }

     Source : <0x03f5b83e> { _do_fat_read + 0x66e }

   5 Target : <0x03f5b83e> { _do_fat_read + 0x66e }

     Source : <0x03f5b83a> { _do_fat_read + 0x66a }

   6 Target : <0x03f5b834> { _do_fat_read + 0x664 }

     Source : <0x03f5ab46> { _downcase + 0x22 }

   7 Target : <0x03f5ab28> { _downcase + 0x4 }

     Source : <0x03f5ab44> { _downcase + 0x20 }

   8 Target : <0x03f5ab3e> { _downcase + 0x1a }

     Source : <0x03f5ab26> { _downcase + 0x2 }

   9 Target : <0x03f5ab24> { _downcase + 0x0 }

     Source : <0x03f5b1cc> { _get_name + 0x88 }

  10 Target : <0x03f5b1c0> { _get_name + 0x7c }

     Source : <0x03f5b1ba> { _get_name + 0x76 }

  11 Target : <0x03f5b1b6> { _get_name + 0x72 }

     Source : <0x03f5b1b0> { _get_name + 0x6c }

  12 Target : <0x03f5b1a6> { _get_name + 0x62 }

     Source : <0x03f5b178> { _get_name + 0x34 }

  13 Target : <0x03f5b172> { _get_name + 0x2e }

     Source : <0x03f5b16a> { _get_name + 0x26 }

  14 Target : <0x03f5b164> { _get_name + 0x20 }

     Source : <0x03f5b170> { _get_name + 0x2c }

  15 Target : <0x03f5b166> { _get_name + 0x22 }

     Source : <0x03f5b162> { _get_name + 0x1e }

 

Follow-ups

 

--- Bryan Wu                                                 2008-12-30 23:03:18

It should be fixed now.

 

--

U-Boot 2008.10-svn1568 (ADI-2009R1-pre) (Dec 31 2008 - 11:49:51)

 

CPU:   ADSP bf548-0.0 (Detected Rev: 0.1)

Board: ADI BF548 EZ-Kit board

       Support: http://blackfin.uclinux.org/

Clock: VCO: 525 MHz, Core: 525 MHz, System: 131.250 MHz

RAM:   64 MB

Flash: 16 MB

NAND:  256 MiB

*** Warning - bad CRC, using default environment

 

In:    serial

Out:   serial

Err:   serial

Net:   Hit any key to stop autoboot:  0

bfin> mmcinit

CID information:

Manufacturer ID:       03

OEM/Application ID:    5344

Product name:          SD02G

Product Revision:      8.0

Product Serial Number: 271617822

Manufacturing Date:    07/06

SD Card detected (RCA 59852)

CSD information:

CSD structure version:   1.0

Card command classes:    5f5

Max trans speed: 25MHz

Read block length:       1024

Write block length:      1024

Card capacity:          2032664576 bytes

 

bfin> fatls mmc 0

   310020   busybox

 

1 file(s), 0 dir(s)

 

bfin>

--

 

-Bryan

 

--- Jie Zhang                                                2008-12-30 23:15:37

Hi Bryan,

 

I'm curious that how the type char of usb_started caused the bug. It looks to

me the it's a bug in other place: something should be aligned explicitly to

4-byte. Your change just hide the bug.

 

--- Cliff Cai                                                2008-12-30 23:29:48

it works for mmc now.

 

Cliff

 

--- Bryan Wu                                                 2008-12-30 23:38:08

Jie,

 

Exactly. I guess it related to FAT filesystem code.

There are several data structs which should be need to check.

 

-Bryan

 

--- Robin Getz                                               2008-12-31 00:27:10

Bryan:

 

Then shouldn't we revert the change, and find where the real problem exists?

 

It should be a simple matter of

 

rgetz@imhotep:~/u-boot-2008.10> bfin-elf-addr2line -f -e u-boot 0x03f5b434

get_dentfromdir

./u-boot-2008.10/fs/fat/fat.c:529

 

Which is wrong for this specific case - but for your build - it should tell you

the exact line number of the file which caused the problem - and the specific

data structure. (just use the ICPLB_FAULT_ADDR which prints out of the dump)

 

-Robin

 

--- Bryan Wu                                                 2008-12-31 01:08:32

We found the issue is related to the _u8 buffer array in fat.c should be aligned

to 4.

 

I fixed it in the trunk now.

 

Thanks

-Bryan

 

--- Cliff Cai                                                2008-12-31 01:15:49

it's ok now,so close it.

 

Cliff

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes