NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50972: unpluging a in-use USB device hangs



On Fri, May 13, 2016 at 10:46:13AM +0100, Nick Hudson wrote:
> On 04/26/16 12:35, Manuel Bouyer wrote:
> 
> >  >  OH, you're on netbsd-7.
> >  Yes, the PR is against netbsd-7.
> >  > spec_vnops.c has other changes that are
> >  >  needed as well, I think
> >  can you provide a patch ?
> 
> 
> netbsd-7 now has the changes I was refering to

I tried a GENERIC.201605170540Z kernel, I still see the hard hang
after unplunging the umass device:
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <Sony, Storage Media, 0100> disk removable
sd0: 1920 MB, 3936 cyl, 16 head, 63 sec, 512 bytes/sect x 3932160 sectors
[ mount, use and unplug without unmount] 
umass0: BBB reset failed, IOERROR
umass0: BBB bulk-in clear stall failed, IOERROR
umass0: BBB bulk-out clear stall failed, IOERROR
umass0: BBB reset failed, IOERROR
umass0: BBB bulk-in clear stall failed, IOERROR
umass0: BBB bulk-out clear stall failed, IOERROR
umass0: BBB reset failed, IOERROR
umass0: BBB bulk-in clear stall failed, IOERROR
umass0: BBB bulk-out clear stall failed, IOERROR
umass0: BBB reset failed, IOERROR
umass0: BBB bulk-in clear stall failed, IOERROR
umass0: BBB bulk-out clear stall failed, IOERROR
umass0: BBB reset failed, IOERROR
umass0: BBB bulk-in clear stall failed, IOERROR
umass0: BBB bulk-out clear stall failed, IOERROR
[hard hang]

from there I get no reaction on (serial) console nor network.
But I can enter ddb:
~fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff8028258d cs 8 rflags 202 cr2 ffff80008e3d2781 ilevel 8 rsp fffffe810000bc50
curlwp 0xfffffe823773d860 pid 0.5 lowest kstack 0xfffffe81000092c0
Stopped in pid 0.5 (system) at  netbsd:breakpoint+0x5:  leave
db{0}> tr
breakpoint() at netbsd:breakpoint+0x5
comintr() at netbsd:comintr+0x524
Xintr_ioapic_edge8() at netbsd:Xintr_ioapic_edge8+0xea
--- interrupt ---
_kernel_lock() at netbsd:_kernel_lock+0x9b
intr_biglock_wrapper() at netbsd:intr_biglock_wrapper+0x12
Xintr_ioapic_level4() at netbsd:Xintr_ioapic_level4+0xf2
--- interrupt ---
x86_pause() at netbsd:x86_pause+0x2
callout_softclock() at netbsd:callout_softclock+0x242
softint_dispatch() at netbsd:softint_dispatch+0x79
DDB lost frame for netbsd:Xsoftintr+0x4f, trying 0xfffffe810000bff0
Xsoftintr() at netbsd:Xsoftintr+0x4f
--- interrupt 
db{0}> mach cpu 1
using CPU 1
db{0}> tr
mutex_enter() at netbsd:mutex_enter+0x11
vrevoke() at netbsd:vrevoke+0x93
genfs_revoke() at netbsd:genfs_revoke+0xd
VOP_REVOKE() at netbsd:VOP_REVOKE+0x32
vdevgone() at netbsd:vdevgone+0x4f
sddetach() at netbsd:sddetach+0xb4
config_detach() at netbsd:config_detach+0x8b
scsipi_target_detach() at netbsd:scsipi_target_detach+0xbc
scsibusdetach() at netbsd:scsibusdetach+0x36
config_detach() at netbsd:config_detach+0x8b
umass_detach() at netbsd:umass_detach+0x8e
config_detach() at netbsd:config_detach+0x8b
usb_disconnect_port() at netbsd:usb_disconnect_port+0xaa
uhub_explore() at netbsd:uhub_explore+0x180
usb_discover.isra.0() at netbsd:usb_discover.isra.0+0x3e
usb_event_thread() at netbsd:usb_event_thread+0x74

db{0}> ps
PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
66       1 3   0        80   fffffe8234129320               tcsh ttyraw
75       1 3   0        80   fffffe82322c4440               tcsh ttyraw
403      1 3   0        80   fffffe8232e8cb80                ksh pause
506      1 3   0        80   fffffe82357d9240               tcsh pause
41       1 3   1        80   fffffe82357d9a80       screen-4.3.1 select
42       1 3   0        80   fffffe8235868680       screen-4.3.1 pause
783      1 3   0        80   fffffe82357d9660               tcsh pause
583      1 3   1        80   fffffe82358f0ac0               sshd select
774      1 3   0        80   fffffe8235868260               sshd select
603      1 3   0        80   fffffe8232e8c760              getty ttyraw
632      1 3   1        80   fffffe822ffe4ba0              getty ttyraw
717      1 3   0        80   fffffe81005d05c0              getty ttyraw
823      1 3   1        80   fffffe8235a12220              getty ttyraw
780      1 3   0        80   fffffe8232a45000               cron nanoslp
665      1 3   1        80   fffffe822ffe4360              inetd kqueue
773      1 3   1        80   fffffe8232a45420               qmgr kqueue
686      1 3   0        80   fffffe82322c4860             pickup kqueue
721      1 3   0        80   fffffe822ffe4780             master kqueue
382      1 3   0        80   fffffe8232e8c340               sshd select
479      1 3   0        80   fffffe8234129740             powerd kqueue
196  >   1 7   0         0   fffffe823463f6e0            syslogd
149      4 3   1        80   fffffe823463fb00           dhclient parked
149      3 3   1        80   fffffe8234d292a0           dhclient kqueue
149      2 3   1        80   fffffe8234d29ae0           dhclient parked
149      1 3   0        80   fffffe82358f0280           dhclient parked
1        1 3   1        80   fffffe8100626a20               init wait
0       65 3   1       200   fffffe8235868aa0           scsibus0 sccomp
0       64 3   0       200   fffffe8235ab8620            physiod physiod
0       63 3   1       200   fffffe8235a12640           aiodoned aiodoned
0       62 2   1       200   fffffe8235a12a60            ioflush
0       61 3   1       200   fffffe8235ab8200           pgdaemon pgdaemon
0       58 3   1       200   fffffe8235ab8a40          atapibus0 sccomp
0       55 2   0       200   fffffe81005d09e0               usb6
0       54 2   0       200   fffffe81005cf180               usb5
0       53 2   0       200   fffffe81005cf5a0               usb4
0       52 2   0       200   fffffe81005cf9c0               usb3
0    >  51 7   1       200   fffffe810059d580               usb2
0       50 2   0       200   fffffe810059d160               usb0
0       49 2   0       200   fffffe81006261e0               usb1
0       48 3   1       200   fffffe8100626600          cryptoret crypto_w
0       47 3   1       200   fffffe81006521c0              unpgc unpgc
0       46 3   0       200   fffffe81005d01a0        vmem_rehash vmem_rehash
0       45 3   1       200   fffffe81006525e0          coretemp1 coretemp1
0       44 3   1       200   fffffe8100652a00          coretemp0 coretemp0
0       35 2   0       200   fffffe810059d9a0               iic0
0       34 3   0       200   fffffe8100507140            atabus6 atath
0       33 3   1       200   fffffe8100507560            atabus5 atath
0       32 3   1       200   fffffe8100507980            atabus4 atath
0       31 3   1       200   fffffe81003bb120            atabus3 atath
0       30 3   0       200   fffffe81003bb540            atabus2 atath
0       29 3   0       200   fffffe81003bb960         usbtask-dr usbtsk
0       28 3   1       200   fffffe810029d100         usbtask-hc usbtsk
0       27 3   0       200   fffffe810029d520            atabus1 atath
0       26 3   1       200   fffffe810029d940            atabus0 atath
0       25 3   0       200   fffffe81000810e0            intelfb intelfb
0       24 3   0       200   fffffe8100081500               i915 i915
0       23 3   0       200   fffffe8100081920           lnxsyswq lnxsyswq
0       22 3   1       200   fffffe81000970c0            xcall/1 xcall
0       21 1   1       200   fffffe81000974e0          softser/1
0       20 1   1       200   fffffe8100097900          softclk/1
0       19 1   1       200   fffffe81000590a0          softbio/1
0       18 1   1       200   fffffe81000594c0          softnet/1
0       17 1   1       201   fffffe81000598e0             idle/1
0       16 3   0       200   fffffe8235b0d080             sysmon smtaskq
0       15 3   0       200   fffffe8235b0d4a0         pmfsuspend pmfsuspend
0       14 3   0       200   fffffe8235b0d8c0           pmfevent pmfevent
0       13 3   0       200   fffffe8236b29060         sopendfree sopendfr
0       12 3   0       200   fffffe8236b29480           nfssilly nfssilly
0       11 3   0       200   fffffe8236b298a0            cachegc cachegc
0       10 2   1       200   fffffe8237731040              vrele
0        9 2   1       200   fffffe8237731460             vdrain
0        8 3   0       200   fffffe8237731880          modunload mod_unld
0        7 3   0       200   fffffe823773d020            xcall/0 xcall
0        6 1   0       200   fffffe823773d440          softser/0
0    >   5 7   0       200   fffffe823773d860          softclk/0
0        4 1   0       200   fffffe8237743000          softbio/0
0        3 1   0       200   fffffe8237743420          softnet/0
0        2 1   0       201   fffffe8237743840             idle/0
0        1 2   1       200   ffffffff81005540            swapper
db{0}> tr/a fffffe823773d860
trace: pid 0 lid 5 at 0xfffffe810052db30
mutex_enter() at netbsd:mutex_enter+0x11
vrevoke() at netbsd:vrevoke+0x93
genfs_revoke() at netbsd:genfs_revoke+0xd
VOP_REVOKE() at netbsd:VOP_REVOKE+0x32
vdevgone() at netbsd:vdevgone+0x4f
sddetach() at netbsd:sddetach+0xb4
config_detach() at netbsd:config_detach+0x8b
scsipi_target_detach() at netbsd:scsipi_target_detach+0xbc
scsibusdetach() at netbsd:scsibusdetach+0x36
config_detach() at netbsd:config_detach+0x8b
umass_detach() at netbsd:umass_detach+0x8e
config_detach() at netbsd:config_detach+0x8b
usb_disconnect_port() at netbsd:usb_disconnect_port+0xaa
uhub_explore() at netbsd:uhub_explore+0x180
usb_discover.isra.0() at netbsd:usb_discover.isra.0+0x3e
usb_event_thread() at netbsd:usb_event_thread+0x74
db{0}> tr/a fffffe810059d580
trace: pid 0 lid 51 at 0xfffffe810052db60
vrevoke() at netbsd:vrevoke+0x93
genfs_revoke() at netbsd:genfs_revoke+0xd
VOP_REVOKE() at netbsd:VOP_REVOKE+0x32
vdevgone() at netbsd:vdevgone+0x4f
sddetach() at netbsd:sddetach+0xb4
config_detach() at netbsd:config_detach+0x8b
scsipi_target_detach() at netbsd:scsipi_target_detach+0xbc
scsibusdetach() at netbsd:scsibusdetach+0x36
config_detach() at netbsd:config_detach+0x8b
umass_detach() at netbsd:umass_detach+0x8e
config_detach() at netbsd:config_detach+0x8b
usb_disconnect_port() at netbsd:usb_disconnect_port+0xaa
uhub_explore() at netbsd:uhub_explore+0x180
usb_discover.isra.0() at netbsd:usb_discover.isra.0+0x3e
usb_event_thread() at netbsd:usb_event_thread+0x74
db{0}> tr/a fffffe823463f6e0
trace: pid 196 lid 1 at 0xfffffe81006ece80
kevent1() at netbsd:kevent1+0x58d
sys___kevent50() at netbsd:sys___kevent50+0x33
syscall() at netbsd:syscall+0x9a
--- syscall (number 435) ---

I'm not sure why we have the same stack trace for LID 5 and 51.
This may be a ddb issue.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index