Openmoko Bug #2232: unplugging with gadgetfs causes panic: "softlockup: blocked tasks"

Openmoko Public Trac bugs at
Fri Feb 13 23:58:48 CET 2009

#2232: unplugging with gadgetfs causes panic: "softlockup: blocked tasks"
 Reporter:  lindi            |          Owner:  openmoko-kernel
     Type:  defect           |         Status:  new            
 Priority:  normal           |      Milestone:                 
Component:  System Software  |        Version:  unspecified    
 Severity:  normal           |       Keywords:                 
 Haspatch:  0                |      Blockedby:                 
Estimated:                   |    Patchreview:                 
 Blocking:                   |   Reproducible:                 
 Steps to reproduce:
 1) tar xzf testcase1.tar.gz
 2) configure gadgetfs on freerunner:
 2.1) sudo ifconfig usb0 down
 2.2) sudo rmmod g_ether
 2.3) sudo modprobe gadgetfs
 2.4) sudo mkdir /dev/gadget
 2.5) sudo mount -t gadgetfs gadgetfs /dev/gadget
 3) run gadgetfs example on freerunner:
 3.1) cd sink
 3.2) gcc -Wall -g -o usb usb.c usbstring.c -lpthread
 3.3) sudo ./usb -r 1.3 -p 1
 4) verify that lsusb on PC side shows the same contents as sink-source-
 5) run driver example on PC:
 5.1) cd sink-source-reader
 5.2) make
 5.3) sudo ./reader1 0x0525 0xa4a4
 6) unplug freerunner from PC and add a hub between freerunner and PC, do
 not kill "sink" process while doing this.
 7) run lsusb again

 Expected results:
 7) gadgetfs survives unplugging and replugging usb cable and lsusb again
 shows our device

 Actual results:
 7) kernel on freerunner crashes with

 INFO: task usb:20196 blocked for more than 120 seconds.
 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 usb           D c03a6cbc     0 20196  20111
 [<c03a6900>] (schedule+0x0/0x430) from [<bf01c504>] (ep_io+0x1fc/0x24c
 [<bf01c308>] (ep_io+0x0/0x24c [gadgetfs]) from [<bf01cf1c>]
 (ep_write+0x104/0x120 [gadgetfs])
 [<bf01ce18>] (ep_write+0x0/0x120 [gadgetfs]) from [<c00b21d4>]
  r8:c0034048 r7:00001c00 r6:c6e8df78 r5:40972200 r4:c6c590c0
 [<c00b211c>] (vfs_write+0x0/0x148) from [<c00b232c>] (sys_write+0x4c/0x7c)
  r7:00000004 r6:c6c590c0 r5:00000000 r4:00000000
 [<c00b22e0>] (sys_write+0x0/0x7c) from [<c0033ea0>]
  r6:4004b000 r5:40974490 r4:409744d8
 no locks held by usb/20196.
 Kernel panic - not syncing: softlockup: blocked tasks
 fbcon_event_notify action=12, data=c782de04
 jbt6k74 spi2.0: **** jbt6k74 unblank
 BUG: scheduling while atomic: watchdog/0/4/0x00000003
 6 locks held by watchdog/0/4:
  #0:  (tasklist_lock){....}, at: [<c00828c4>]
  #1:  ((fb_notifier_list).rwsem){....}, at: [<c006f814>]
  #2:  (&new_bd->ops_lock){....}, at: [<c01c5f30>]
  #3:  (&new_bd->update_lock){....}, at: [<c01c5f78>]
  #4:  (&pcf->lock){....}, at: [<c01f7c9c>] pcf50633_reg_read+0x28/0x4c
  #5:  (&adap->bus_lock){....}, at: [<c027795c>] i2c_transfer+0x68/0x12c
 Modules linked in: gadgetfs s3c2410_wdt [last unloaded: g_ether]

 (please see attached kernel.log for complete output)

 More info:
 1) I am using andy-tracking b8b36e5ec3db71d5 on freerunner and regular
 linux on a 32-bit x86 system.

Ticket URL: <> <>
openmoko trac

More information about the buglog mailing list