NetBSD-Bugs archive

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

Re: kern/53066: nearly reproducable softint panic on shutdown



The following reply was made to PR kern/53066; it has been noted by GNATS.

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek%gmail.com@localhost>
To: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%netbsd.org@localhost>
Cc: 
Subject: Re: kern/53066: nearly reproducable softint panic on shutdown
Date: Sat, 21 Apr 2018 18:07:16 +0200

 I have the same issue, for me it happens on every reboot, if I boot
 from USB 2.0 stick. Started to look at it more closely after seeing
 your ub_soft patch.
 
 The interrupt in my case was triggered from scsipi_prevent() via
 sd_lastclose(). At this moment I don't expect the bus to be detached
 yet, so I started to investigated more.
 
 Eventually turned out this patch on xhci.c side resolves my issue -
 use the usb2 bus for scheduling the softint. Of course, this probably
 breaks USB 3.0 devices. But it shows the root problem, in that
 xhci_intr() triggers the softint handling on wrong bus, which is
 already detached by the time.
 
 I may figure what is the right thing to do here, but help would be
 appreciated, as I'm not familiar with how XHCI works. One possible
 solution would be to simply config_detach() in xhci_detach() sc_bus2
 first - seems the underlying usb code seems to not care on which the
 callback is triggered.
 
 Jaromir
 
 Index: xhci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/xhci.c,v
 retrieving revision 1.88
 diff -u -p -r1.88 xhci.c
 --- xhci.c      21 Apr 2018 15:53:24 -0000      1.88
 +++ xhci.c      21 Apr 2018 15:53:50 -0000
 @@ -1236,7 +1236,7 @@ xhci_intr(void *v)
 
         ret = xhci_intr1(sc);
         if (ret) {
 -               usb_schedsoftintr(&sc->sc_bus);
 +               usb_schedsoftintr(&sc->sc_bus2);
         }
  done:
         mutex_spin_exit(&sc->sc_intr_lock);
 
 
 2018-04-21 15:00 GMT+02:00 Martin Husemann <martin%duskware.de@localhost>:
 > The following reply was made to PR kern/53066; it has been noted by GNATS.
 >
 > From: Martin Husemann <martin%duskware.de@localhost>
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc:
 > Subject: Re: kern/53066: nearly reproducable softint panic on shutdown
 > Date: Sat, 21 Apr 2018 14:56:01 +0200
 >
 >  This patch seems to fix it for me. It looks like a good enough compromise
 >  from a layering point of view.
 >
 >  Maybe xhci should mask interrupts earlier (or the intr handler should not
 >  return 1 in this case), but that is something for someone with better
 >  hardware knowledge to decide.
 >
 >  Martin
 


Home | Main Index | Thread Index | Old Index