NetBSD-Bugs archive

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

Re: kern/56393: panic in usbd_create_xfer



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

From: Yorick Hardy <yorickhardy%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56393: panic in usbd_create_xfer
Date: Sat, 11 Dec 2021 22:32:43 +0200

 Masking the interrupts earlier seems to solve the problem.
 
 Index: sys/dev/usb/ohci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/ohci.c,v
 retrieving revision 1.317
 diff -u -r1.317 ohci.c
 --- sys/dev/usb/ohci.c	24 Jun 2021 23:01:03 -0000	1.317
 +++ sys/dev/usb/ohci.c	11 Dec 2021 17:34:57 -0000
 @@ -1336,9 +1336,16 @@
  		/* XXX do what */
  		eintrs &= ~OHCI_SO;
  	}
 +	if (eintrs != 0) {
 +		/* Block unprocessed interrupts listed below. */
 +		OWRITE4(sc, OHCI_INTERRUPT_DISABLE, eintrs);
 +		sc->sc_eintrs &= ~eintrs;
 +		DPRINTF("sc %#jx blocking intrs %#jx", (uintptr_t)sc,
 +		    eintrs, 0, 0);
 +	}
  	if (eintrs & OHCI_WDH) {
  		/*
 -		 * We block the interrupt below, and reenable it later from
 +		 * We blocked the interrupt above, and reenable it later from
  		 * ohci_softintr().
  		 */
  		usb_schedsoftintr(&sc->sc_bus);
 @@ -1356,7 +1363,7 @@
  
  		KASSERT(TAILQ_EMPTY(&sc->sc_abortingxfers));
  		DPRINTFN(10, "end SOF %#jx", (uintptr_t)sc, 0, 0, 0);
 -		/* Don't remove OHIC_SF from eintrs so it is blocked below */
 +		/* Don't remove OHIC_SF from eintrs, it is blocked above */
  	}
  	if (eintrs & OHCI_RD) {
  		DPRINTFN(5, "resume detect sc=%#jx", (uintptr_t)sc, 0, 0, 0);
 @@ -1372,19 +1379,12 @@
  	}
  	if (eintrs & OHCI_RHSC) {
  		/*
 -		 * We block the interrupt below, and reenable it later from
 +		 * We blocked the interrupt above, and reenable it later from
  		 * a timeout.
  		 */
  		softint_schedule(sc->sc_rhsc_si);
  	}
  
 -	if (eintrs != 0) {
 -		/* Block unprocessed interrupts. */
 -		OWRITE4(sc, OHCI_INTERRUPT_DISABLE, eintrs);
 -		sc->sc_eintrs &= ~eintrs;
 -		DPRINTF("sc %#jx blocking intrs %#jx", (uintptr_t)sc,
 -		    eintrs, 0, 0);
 -	}
  
  	return 1;
  }
 


Home | Main Index | Thread Index | Old Index