NetBSD-Bugs archive

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

Re: kern/22646 (Panic in ohci_add_done())



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

From: Nick Hudson <nick.hudson%gmx.co.uk@localhost>
To: Andreas Gustafsson <gson%gson.org@localhost>
Cc: gnats-bugs%NetBSD.org@localhost
Subject: Re: kern/22646 (Panic in ohci_add_done())
Date: Mon, 25 Apr 2016 08:30:46 +0100

 This is a multi-part message in MIME format.
 --------------020300030403000900070201
 Content-Type: text/plain; charset=windows-1252; format=flowed
 Content-Transfer-Encoding: 7bit
 
 On 04/24/16 16:54, Andreas Gustafsson wrote:
 > Nick Hudson wrote:
 >>>> Can you increase USBHIST_SIZE
 >>> To how much?  500000?
 >> That should do it. :)
 > Actually, it didn't: with USBHIST_SIZE=500000, the kernel failed to
 > boot.  I reduced it to 100000, and it booted again.
 >
 > With your patch, the system no longer locks up, presumably due to the
 > added "break" statements.
 
 Right.
 
 Can you do the test again with the modified patch attached and also 
 provide UGEN_DEBUG/ugendebug=10 output?
 
 vmstat -u usbhist as well
 
 Thanks,
 Nick
 
 
 --------------020300030403000900070201
 Content-Type: text/x-patch;
  name="ohci.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="ohci.c.diff"
 
 Index: sys/dev/usb/ohci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/ohci.c,v
 retrieving revision 1.254.2.72
 diff -u -p -r1.254.2.72 ohci.c
 --- sys/dev/usb/ohci.c	16 Apr 2016 16:02:42 -0000	1.254.2.72
 +++ sys/dev/usb/ohci.c	25 Apr 2016 07:30:28 -0000
 @@ -1381,6 +1381,12 @@ ohci_softintr(void *v)
  	int len, cc;
  	int i, j, actlen, iframes, uedir;
  	ohci_physaddr_t done;
 +#ifdef OHCI_DEBUG
 +	extern int usbdebug;
 +	ohci_physaddr_t seen[2] = {0, 0};
 +	bool debugdone = false;
 +	int s = 0;
 +#endif
  
  	KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
  
 @@ -1402,22 +1408,40 @@ ohci_softintr(void *v)
  	for (sdone = NULL, sidone = NULL; done != 0; ) {
  		std = ohci_hash_find_td(sc, done);
  		if (std != NULL) {
 +#ifdef OHCI_DEBUG
 +			seen[(s++) & 1] = done;
 +#endif
  			usb_syncmem(&std->dma, std->offs, sizeof(std->td),
  			    BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
  			std->dnext = sdone;
  			done = O32TOH(std->td.td_nexttd);
  			sdone = std;
  			DPRINTFN(10, "add TD %p", std, 0, 0, 0);
 +#ifdef OHCI_DEBUG
 +			if (done != 0 && (done == seen[0] || done == seen[1])) {
 +				debugdone = true;
 +				break;
 +			}
 +#endif
  			continue;
  		}
  		sitd = ohci_hash_find_itd(sc, done);
  		if (sitd != NULL) {
 +#ifdef OHCI_DEBUG
 +			seen[(s++) & 1] = done;
 +#endif
  			usb_syncmem(&sitd->dma, sitd->offs, sizeof(sitd->itd),
  			    BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
  			sitd->dnext = sidone;
  			done = O32TOH(sitd->itd.itd_nextitd);
  			sidone = sitd;
  			DPRINTFN(5, "add ITD %p", sitd, 0, 0, 0);
 +#ifdef OHCI_DEBUG
 +			if (done != 0 && (done == seen[0] || done == seen[1])) {
 +				debugdone = true;
 +				break;
 +			}
 +#endif
  			continue;
  		}
  		DPRINTFN(10, "addr %p not found", done, 0, 0, 0);
 @@ -1584,6 +1608,12 @@ ohci_softintr(void *v)
  			usb_transfer_complete(xfer);
  		}
  	}
 +#ifdef OHCI_DEBUG
 +	if (debugdone) {
 +		usbdebug = 0;
 +		ohcidebug = 0;
 +	}
 +#endif
  
  	if (sc->sc_softwake) {
  		sc->sc_softwake = 0;
 
 --------------020300030403000900070201--
 


Home | Main Index | Thread Index | Old Index