On Fri, Feb 15, 2019 at 10:44:23PM +0900, Rin Okuyama wrote: > On 2019/02/15 21:57, Jonathan A. Kollasch wrote: > > On Wed, Feb 13, 2019 at 06:35:14PM +0900, Rin Okuyama wrote: > > > Hi, > > > > > > On 2019/02/13 3:54, Nick Hudson wrote: > > > > On 12/02/2019 16:02, Rin Okuyama wrote: > > > > > Hi, > > > > > > > > > > The system freezes indefinitely with xhci(4) or ehci(4), when NIC with > > > > > multiple outstanding transfers [axen(4), mue(4), and ure(4)] is > > > > > stopped > > > > > by "ifconfig down" or detached. > > > > > > > > > > As discussed in the previous message, this is due to infinite loop in > > > > > usbd_ar_pipe(); xfers with USBD_NOT_STARTED remain in a queue forever > > > > > because upm_abort [= xhci_device_bulk_abort() etc.] cannot remove > > > > > them. > > > > > > > > > > > > Why not the attached patch instead? > > > > > > > > Nick > > > > > > Thank you so much for your prompt reply! > > > > > > It works if s/ux_state/ux_status/ here: > > > > > > + if (xfer->ux_state == USBD_NOT_STARTED) { > > > > > > Can I commit the revised patch? > > > > > > > The revised patch results in > > https://nxr.netbsd.org/xref/src/sys/dev/usb/ehci.c?r=1.265#1566 > > firing upon `drvctl detach -d bwfm0` on Pinebook. > > > > Jonathan Kollasch > > IMO, this is because NOT_STARTED queues are removed in a way that is > unexpected to ehci. For my old amd64 box, the attached patch fixes > assertion failures when devices are detached from ehci. I would like > to commit it together with the previous patch. >
Works for me; please commit. (I'm not 100% sure it's perfect, but it's better than it was, and we can fix it again later if necessary.) Jonathan Kollasch