AnsweredAssumed Answered

BF548 crash when removing USB stick

Question asked by Uli on Nov 11, 2012
Latest reply on Nov 12, 2012 by Uli

Hi all,

we are successfully running uCLinux 3.2.0-ADI-2012R1-pre on a custom board with USB and SCSI enabled to mount USB memory sticks. While this works well in general, there is a problem when the system gets low on memory -- in which case an inserted stick is recognized but mdev obviously can not allocate enough memory when the stick is *removed*:

 

Aug 12 08:41:12 blackfin user.notice kernel: sd 1:0:0:0: [sda] Attached SCSI removable disk

Aug 12 08:41:19 blackfin user.info kernel: usb 1-1: USB disconnect, device number 3

Aug 12 08:41:19 blackfin user.warn kernel: mdev: page allocation failure: order:7, mode:0xd0

Aug 12 08:41:19 blackfin user.notice kernel: Stack info:

Aug 12 08:41:19 blackfin user.notice kernel:  SP: [0x02629ca4]

Aug 12 08:41:19 blackfin user.notice kernel:  Memory from 0x02629ca0 to 0262a000

...

Aug 12 08:41:19 blackfin user.notice kernel: Return addresses in stack:

Aug 12 08:41:19 blackfin user.warn kernel: Mem-Info:

Aug 12 08:41:19 blackfin user.warn kernel: DMA per-cpu:

Aug 12 08:41:19 blackfin user.warn kernel: CPU    0: hi:    0, btch:   1 usd:   0

Aug 12 08:41:19 blackfin user.warn kernel: Allocation of length 483328 from process 689 (mdev) failed

Aug 12 08:41:19 blackfin user.warn kernel: DMA per-cpu:

Aug 12 08:41:19 blackfin user.warn kernel: CPU    0: hi:    0, btch:   1 usd:   0

Aug 12 08:41:19 blackfin user.warn kernel: active_anon:0 inactive_anon:0 isolated_anon:0

Aug 12 08:41:19 blackfin user.warn kernel:  active_file:53 inactive_file:72 isolated_file:0

Aug 12 08:41:19 blackfin user.warn kernel:  unevictable:923 dirty:0 writeback:0 unstable:0

Aug 12 08:41:19 blackfin user.warn kernel:  free:1985 slab_reclaimable:461 slab_unreclaimable:370

Aug 12 08:41:19 blackfin user.warn kernel:  mapped:0 shmem:0 pagetables:0 bounce:0

Aug 12 08:41:19 blackfin user.warn kernel: DMA free:7940kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anon:0kB active_file:212kB inactive_file:288kB unevictable:3692kB isolated(anon):0kB isolated(file):0kB present:46736kB mlocked:0kB dirty:0kB writeback:

Aug 12 08:41:19 blackfin user.warn kernel: lowmem_reserve[]: 0 0 0

Aug 12 08:41:19 blackfin user.warn kernel: DMA: 105*4kB 72*8kB 40*16kB 17*32kB 20*64kB 13*128kB 9*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 7940kB

Aug 12 08:41:19 blackfin user.warn kernel: 1048 total pagecache pages

Aug 12 08:41:19 blackfin user.warn kernel: Unable to allocate RAM for process text/data, errno 12

 

Specifically, it looks like the kernel needs at least one 1024k block of memory to successfully re-init USB driver(s). Does anyone have experience with this or does anyone know a more light-weight way of accessing USB sticks from ucLinux?

 

Thanks, Ulrich

Outcomes