usb2: kernel panic with an USB floppy drive

WATANABE Kazuhiro CQG00620 at nifty.ne.jp
Mon Jan 12 03:56:39 PST 2009


Hi.

This problem seems to be fixed by the patch you suggested,
and the floppy drive comes to work again.

*****
ugen0.2: <Y-E DATA> at usbus0
umass0: <FLOPPY> on usbus0
umass0:  UFI over CBI with CCI; quirks = 0x0042
umass0:1:0:-1: Attached to scbus1
(probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 
(probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI Status: Check Condition
(probe0:umass-sim0:0:0:0): NOT READY asc:3a,0
(probe0:umass-sim0:0:0:0): Medium not present
(probe0:umass-sim0:0:0:0): Unretryable error
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Y-E DATA USB-FDU 5.01> Removable Direct Access SCSI-0 device 
da0: 20KB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
*****

Thanks!

At Mon, 12 Jan 2009 09:37:27 +0100,
Hans Petter Selasky wrote:
> Hi,
> 
> Thanks for reporting.
> 
> This bug looks like a glitch on my side when introducing Zero-copy in UMASS.
> 
> Try the following patch:
> 
> http://perforce.freebsd.org/chv.cgi?CH=156005
> 
> --HPS
> 
> On Monday 12 January 2009, WATANABE Kazuhiro wrote:
> > Hi, all.
> >
> > I have an USB floppy drive which works well on 7.1-RELEASE, and
> > 8-current with the old USB stack.
> >
> > *****
> > umass0: <Y-E DATA USB Floppy Drive, class 0/0, rev 1.10/5.01, addr 2> on
> > uhub0 da0 at umass-sim0 bus 0 target 0 lun 0
> > da0: <Y-E DATA USB-FDU 5.01> Removable Direct Access SCSI-0 device
> > da0: 20KB/s transfers
> > da0: Attempt to query device size failed: NOT READY, Medium not present
> >
> > port 1 addr 2: full speed, power 500 mA, config 1, USB Floppy
> > Drive(0x0000), Y-E DATA(0x057b), rev 5.01 *****
> >
> > When I connect the floppy drive to the system with the new USB2 stack,
> > it causes a kernel panic.
> >
> >
> > Here is a stack trace and dmesg output.
> >
> > capricorn# kgdb /boot/kernel/kernel.symbols /var/crash/vmcore.0
> > GNU gdb 6.1.1 [FreeBSD]
> > Copyright 2004 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you
> > are welcome to change it and/or distribute copies of it under certain
> > conditions. Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB.  Type "show warranty" for details.
> > This GDB was configured as "i386-marcel-freebsd"...
> >
> > Unread portion of the kernel message buffer:
> > umass0:1:0:-1: Attached to scbus1
> > Kernel page fault with the following non-sleepable locks held:
> > exclusive sleep mutex UMASS lock (UMASS lock) r = 0 (0xc0d69800) locked @
> > /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:1781 KDB: stack
> > backtrace:
> > db_trace_self_wrapper(c0c1f7c2,cc93ea28,c088f145,c0c0d089,6f5,...) at
> > db_trace_self_wrapper+0x26
> > kdb_backtrace(c0c0d089,6f5,ffffffff,c0eabdc4,cc93ea60,...) at
> > kdb_backtrace+0x29 _witness_debugger(c0c21ae3,cc93ea74,4,1,0,...) at
> > _witness_debugger+0x25 witness_warn(5,0,c0c53da2,c28d3b40,c288ea90,...) at
> > witness_warn+0x1fd trap(cc93eb00) at trap+0x152
> > calltrap() at calltrap+0x6
> > --- trap 0xc, eip = 0xc0b32da5, esp = 0xcc93eb40, ebp = 0xcc93eb78 ---
> > bus_dmamap_load(c29a4e80,c0ef2bc0,0,24,c077e8b0,...) at
> > bus_dmamap_load+0xd5 usb2_pc_load_mem(c2b87f80,24,0,4cf,c0c02651,...) at
> > usb2_pc_load_mem+0x125
> > usb2_bdma_work_loop(c2b86000,c2b86400,10000ca,c2b4a900,1,...) at
> > usb2_bdma_work_loop+0x2b5
> > usb2_command_wrapper(c2b86000,c2b86400,c0c0d089,55b,c28d3be4,...) at
> > usb2_command_wrapper+0x116
> > usb2_start_hardware(c2b86400,c084127c,c2690b68,4,c0c1ac2a,...) at
> > usb2_start_hardware+0x6eb
> > umass_t_cbi_data_read_callback(c2b86400,0,c0c0d089,752,c0eabdc0,...) at
> > umass_t_cbi_data_read_callback+0xfe
> > usb2_callback_wrapper(c2b86014,6f6,0,c2b86000,c2b86000,...) at
> > usb2_callback_wrapper+0x63a
> > usb2_command_wrapper(c2b86014,0,c0c0d089,6f6,c2b86028,...) at
> > usb2_command_wrapper+0x116
> > usb2_callback_proc(c2b86028,c2690b68,c0c0cc24,51,c0d704c0,...) at
> > usb2_callback_proc+0x9b
> > usb2_process(c2b86078,cc93ed38,c0c18395,32d,c288ea90,...) at
> > usb2_process+0xde fork_exit(c07906b0,c2b86078,cc93ed38) at fork_exit+0xb8
> > fork_trampoline() at fork_trampoline+0x8
> > --- trap 0, eip = 0, esp = 0xcc93ed70, ebp = 0 ---
> >
> >
> > Fatal trap 12: page fault while in kernel mode
> > cpuid = 0; apic id = 00
> > fault virtual address	= 0xbfc00000
> > fault code		= supervisor read, page not present
> > instruction pointer	= 0x20:0xc0b32da5
> > stack pointer	        = 0x28:0xcc93eb40
> > frame pointer	        = 0x28:0xcc93eb78
> > code segment		= base 0x0, limit 0xfffff, type 0x1b
> > 			= DPL 0, pres 1, def32 1, gran 1
> > processor eflags	= interrupt enabled, resume, IOPL = 0
> > current process		= 1338 (USBPROC)
> > lock order reversal: (Giant after non-sleepable)
> >  1st 0xc0d69800 UMASS lock (UMASS lock) @
> > /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:1781 2nd 0xc0d6bfb0
> > Giant (Giant) @ /FreeBSD/HEAD/src/sys/dev/kbdmux/kbdmux.c:1044 KDB: stack
> > backtrace:
> > panic: from debugger
> > cpuid = 0
> > Uptime: 2m8s
> > Physical memory: 223 MB
> > Dumping 40 MB: 25 9
> >
> > Reading symbols from /boot/kernel/green_saver.ko...Reading symbols from
> > /boot/kernel/green_saver.ko.symbols...done. done.
> > Loaded symbols for /boot/kernel/green_saver.ko
> > #0  doadump () at pcpu.h:246
> > 246	pcpu.h: No such file or directory.
> > 	in pcpu.h
> > (kgdb) where
> > #0  doadump () at pcpu.h:246
> > #1  0xc084fe5e in boot (howto=260)
> >     at /FreeBSD/HEAD/src/sys/kern/kern_shutdown.c:420
> > #2  0xc0850132 in panic (fmt=Variable "fmt" is not available.
> > )
> >     at /FreeBSD/HEAD/src/sys/kern/kern_shutdown.c:576
> > #3  0xc04bdc27 in db_panic (addr=Could not find the frame base for
> > "db_panic". )
> >     at /FreeBSD/HEAD/src/sys/ddb/db_command.c:478
> > #4  0xc04be251 in db_command (last_cmdp=0xc0d3a55c, cmd_table=0x0,
> > dopager=1) at /FreeBSD/HEAD/src/sys/ddb/db_command.c:445
> > #5  0xc04be3aa in db_command_loop ()
> >     at /FreeBSD/HEAD/src/sys/ddb/db_command.c:498
> > #6  0xc04c020d in db_trap (type=12, code=0)
> >     at /FreeBSD/HEAD/src/sys/ddb/db_main.c:229
> > #7  0xc087d7f6 in kdb_trap (type=12, code=0, tf=0xcc93eb00)
> >     at /FreeBSD/HEAD/src/sys/kern/subr_kdb.c:534
> > #8  0xc0b50e0f in trap_fatal (frame=0xcc93eb00, eva=3217031168)
> >     at /FreeBSD/HEAD/src/sys/i386/i386/trap.c:920
> > #9  0xc0b51740 in trap (frame=0xcc93eb00)
> >     at /FreeBSD/HEAD/src/sys/i386/i386/trap.c:318
> > #10 0xc0b35b6b in calltrap ()
> >     at /FreeBSD/HEAD/src/sys/i386/i386/exception.s:165
> > #11 0xc0b32da5 in bus_dmamap_load (dmat=0xc29a4e80, map=0xc0ef2bc0,
> > buf=0x0, buflen=36, callback=0xc077e8b0 <usb2_pc_load_mem_cb>,
> >     callback_arg=0xc2b87f80, flags=0) at pmap.h:282
> > ---Type <return> to continue, or q <return> to quit---
> > #12 0xc077e415 in usb2_pc_load_mem (pc=0xc2b87f80, size=36, sync=0 '\0')
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_busdma.c:635
> > #13 0xc077e705 in usb2_bdma_work_loop (pq=0xc2b86000)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_busdma.c:1318
> > #14 0xc0793076 in usb2_command_wrapper (pq=0xc2b86000, xfer=0xc2b86400)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:2484
> > #15 0xc079434b in usb2_start_hardware (xfer=0xc2b86400)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:1491
> > #16 0xc077c19e in umass_t_cbi_data_read_callback (xfer=0xc2b86400)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/storage/umass2.c:2414
> > #17 0xc07956da in usb2_callback_wrapper (pq=0xc2b86014)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:1911
> > #18 0xc0793076 in usb2_command_wrapper (pq=0xc2b86014, xfer=0x0)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:2484
> > #19 0xc079315b in usb2_callback_proc (_pm=0xc2b86028)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_transfer.c:1785
> > #20 0xc079078e in usb2_process (arg=0xc2b86078)
> >     at /FreeBSD/HEAD/src/sys/dev/usb2/core/usb2_process.c:139
> > #21 0xc082ce48 in fork_exit (callout=0xc07906b0 <usb2_process>,
> >     arg=0xc2b86078, frame=0xcc93ed38)
> >     at /FreeBSD/HEAD/src/sys/kern/kern_fork.c:821
> > #22 0xc0b35be0 in fork_trampoline ()
> >     at /FreeBSD/HEAD/src/sys/i386/i386/exception.s:270
> > (kgdb) quit
> > capricorn#
---
WATANABE Kazuhiro (CQG00620 at nifty.ne.jp)


More information about the freebsd-current mailing list