AnsweredAssumed Answered

i.MX233/i.MX28: kernel oops when insert this SD card

Question asked by PeterChan Employee on Feb 18, 2013
Latest reply on Mar 24, 2014 by lategoodbye

Hello All,

 

Recently, I got one 2GB SD card from market which always causes kernel oops when it is inserted to i.MX233 and i.MX28 EVK board. The error log from the i.MX28 is like this:

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mmc1: new high speed SD card at address b368

mmcblk1: mmc1:b368 SMI   1.87 GiB

mmcblk1:

kernel BUG at drivers/mmc/host/mxs-mmc.c:465!

Unable to handle kernel NULL pointer dereference at virtual address 00000000

pgd = c0004000

[00000000] *pgd=00000000

Internal error: Oops: 817 [#1] PREEMPT

last sysfs file: /sys/kernel/uevent_seqnum

Modules linked in:

CPU: 0    Not tainted  (2.6.35.3-571-gcca29a0-g4792be1-dirty #321)

PC is at __bug+0x20/0x2c

LR is at release_console_sem+0x1b4/0x230

pc : [<c0031138>]    lr : [<c004a07c>]    psr: 60000013

sp : c75f7da8  ip : c75f7cd0  fp : c75f7db4

r10: 00000000  r9 : 01230000  r8 : 00000000

r7 : 00000001  r6 : 00001000  r5 : c75f7e84  r4 : c756d600

r3 : 00000000  r2 : 00000000  r1 : c0469b48  r0 : 00000034

Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel

Control: 0005317f  Table: 47d28000  DAC: 00000017

Process mmcqd (pid: 2169, stack limit = 0xc75f6270)

Stack: (0xc75f7da8 to 0xc75f8000)

7da0:                   c75f7e04 c75f7db8 c0281ba0 c0031128 00000000 00000000

7dc0: 00000000 00000000 00000000 00000000 00000000 00000001 00000000 c756d600

7de0: c75f7e70 c756d400 00000001 c752e3c4 00000000 c75f7e70 c75f7e24 c75f7e08

7e00: c0282380 c0281974 c75f7e70 c756d400 c75f7e30 00000001 c75f7e54 c75f7e28

7e20: c0278fd8 c0282350 c75f7e54 00000000 c75f7e30 c75f7e30 c74a6340 c74a6340

7e40: c7cd6600 c75f6000 c75f7f8c c75f7e58 c028051c c0278ed0 00000000 00000000

7e60: 00000000 c75f7e84 00000000 00000000 c75f7e84 c75f7edc c75f7eb0 c75f7e2c

7e80: c027906c 00000012 00000000 00000000 00000000 00000000 00000000 000000b5

7ea0: 00000000 00000000 c75f7edc c75f7e70 0000000c 00000000 00000000 00000000

7ec0: 00000000 00000000 0000049d 00000000 00000000 00000000 c75f7e70 00000000

7ee0: 00000000 00000200 00000008 00000000 00000200 00000000 c75f7eb0 c75f7e70

7f00: 00000001 c7d20800 c01c9a18 c01c8d4c c75f7f3c c7797458 00000000 c7797498

7f20: c7c25cc0 c75f6000 c7564030 00000000 c75f6000 c7564030 c74a6340 c7564030

7f40: c75f7f74 c75f7f50 c74a6340 c752e3c4 c75f7f74 c75f7f60 c01ba694 c01c0160

7f60: c74a6340 c75f6000 c752e3c4 c752e3cc c7564030 00000001 00000000 c75641a0

7f80: c75f7fc4 c75f7f90 c02810bc c0280330 00000013 00000000 c75f7fc4 c7ca9d80

7fa0: c75f7fcc c0280f88 c752e3c4 00000000 00000000 00000000 c75f7ff4 c75f7fc8

7fc0: c0061688 c0280f98 00000000 00000000 c75f7fd0 c75f7fd0 c7ca9d80 c0061604

7fe0: c004d134 00000013 00000000 c75f7ff8 c004d134 c0061614 00000000 00000000

Backtrace:

[<c0031118>] (__bug+0x0/0x2c) from [<c0281ba0>] (mxs_mmc_start_cmd+0x23c/0x9dc)

[<c0281964>] (mxs_mmc_start_cmd+0x0/0x9dc) from [<c0282380>] (mxs_mmc_request+0x40/0x80)

[<c0282340>] (mxs_mmc_request+0x0/0x80) from [<c0278fd8>] (mmc_wait_for_req+0x118/0x130)

r7:00000001 r6:c75f7e30 r5:c756d400 r4:c75f7e70

[<c0278ec0>] (mmc_wait_for_req+0x0/0x130) from [<c028051c>] (mmc_blk_issue_rq+0x1fc/0x60c)

r6:c75f6000 r5:c7cd6600 r4:c74a6340

[<c0280320>] (mmc_blk_issue_rq+0x0/0x60c) from [<c02810bc>] (mmc_queue_thread+0x134/0x138)

[<c0280f88>] (mmc_queue_thread+0x0/0x138) from [<c0061688>] (kthread+0x84/0x8c)

[<c0061604>] (kthread+0x0/0x8c) from [<c004d134>] (do_exit+0x0/0x6dc)

r7:00000013 r6:c004d134 r5:c0061604 r4:c7ca9d80

Code: e1a01000 e59f000c eb0c803e e3a03000 (e5833000)

---[ end trace e8886db44828e727 ]---

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

The error is due to an invalid field in CSD register of this 2GB SD card. The CSD version of this card is 1.0 but the TAAC field is an invalid value 0. Since the kernel is making use of this TAAC field to calculate the SD card timeout, an invalid value 0 can lead to a oops error at mxs_ns_to_ssp_ticks().

 

This error is only found on this <=2GB SD card. >2GB SDHC cards will not see this error because these cards are CSD version 2.0. For these cards, kernel always use a fix timeout and calculation that causes the oops error is skipped. Of course, <=2GB SD card that fully complying to SD card physical layer specification will not see this error neither.

 

To solve this issue, please assign the TAAC field to its maximum value likes this attachment whenever the TAAC field is invalid.

 

Regards,

Peter

 

Original Attachment has been moved to: SD_card_invalid_TAAC.patch.zip

Outcomes