NetBSD Problem Report #18448

Received: (qmail 10674 invoked by uid 605); 28 Sep 2002 17:30:45 -0000
Message-Id: <200209281730.g8SHUhT20361@nyx.tn.catvmics.ne.jp>
Date: Sun, 29 Sep 2002 02:30:43 +0900 (JST)
From: t-nkyma@tcp-ip.or.jp
Sender: gnats-bugs-owner@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: ohci_device_isoc_close calls ohci_rem_ed twice
X-Send-Pr-Version: 3.95

>Number:         18448
>Category:       kern
>Synopsis:       ohci_device_isoc_close calls ohci_rem_ed twice
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 28 17:31:00 +0000 2002
>Closed-Date:    Sun Sep 29 21:08:01 +0000 2002
>Last-Modified:  Mon Jan 27 06:01:25 +0000 2003
>Originator:     Takeshi Nakayama
>Release:        NetBSD 1.6
>Organization:
Private
>Environment:
System: NetBSD nyx 1.6 NetBSD 1.6 (NYX32) #39: Fri Sep 27 18:42:10 JST 2002
 takeshi@nyx:/usr/src/sys/arch/sparc64/compile/NYX32 sparc64
Architecture: sparc
Machine: sparc64
>Description:
	In ohci_device_isoc_close(), we call ohci_rem_ed() then
	call ohci_close_pipe(). But ohci_rem_ed() is called from
	ohci_close_pipe(). Therefore, we should not call
	ohci_rem_ed() directly.
>How-To-Repeat:
	code inspection.
>Fix:

Index: ohci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/ohci.c,v
retrieving revision 1.127
diff -u -d -r1.127 ohci.c
--- ohci.c	2002/08/07 20:03:19	1.127
+++ ohci.c	2002/09/16 03:15:56
@@ -3363,13 +3363,8 @@
 {
 	struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
 	ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
-	int s;

 	DPRINTF(("ohci_device_isoc_close: pipe=%p\n", pipe));
-
-	s = splusb();
-	ohci_rem_ed(opipe->sed, sc->sc_isoc_head);
-	splx(s);
 	ohci_close_pipe(pipe, sc->sc_isoc_head);
 #ifdef DIAGNOSTIC
 	opipe->tail.itd->isdone = 1;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: augustss 
State-Changed-When: Sun Sep 29 14:07:46 PDT 2002 
State-Changed-Why:  
Patch applied. 

From: James Chacon <jmc@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18448 CVS commit: [netbsd-1-6] src/sys/dev/usb
Date: Mon, 27 Jan 2003 08:00:14 +0200 (EET)

 Module Name:	src
 Committed By:	jmc
 Date:		Mon Jan 27 06:00:13 UTC 2003

 Modified Files:
 	src/sys/dev/usb [netbsd-1-6]: ohci.c

 Log Message:
 Pullup lots of revisions: 1.123-1.124,1.126-1.127,1.128-1.131,1.132-1.135
 (requested by bad in ticket #1104)

         Clear done_head in the HCCA *before* acknowledging the interrupt.
         Driver lost some completed transfers under heavy loads.
         Fix some braindead calls to free memory (only encountered under low
           memory conditions).
         Add some spl calls to protect critical regions. From PR#18440
         Remove extra call to ohci_rem_ed().  From PR#18448
         Put some ifdefs around USB_USE_SOFTINTR stuff.
         Fix several nits:
         - Call usbd_transfer_complete at splusb.
         - Fix a botched for loop in ohci_rem_ed.
         - In ohci_close_pipe, wait 1ms after removing an ED to avoid possible
           race condition.
         Update xfer->frlengths for input isoc transfer.
         Also fix error handling for isoc transfer somewhat;
           usb_transfer_complete shouldn't be called for more than once.
         Add a couple of le32toh which were missing in the previous.


 To generate a diff of this commit:
 cvs rdiff -r1.123 -r1.123.2.1 src/sys/dev/usb/ohci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: James Chacon <jmc@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18448 CVS commit: [netbsd-1-6] src/sys/dev/usb
Date: Mon, 27 Jan 2003 08:00:39 +0200 (EET)

 Module Name:	src
 Committed By:	jmc
 Date:		Mon Jan 27 06:00:39 UTC 2003

 Modified Files:
 	src/sys/dev/usb [netbsd-1-6]: ohcivar.h

 Log Message:
 Pullup revisions 1.30-1.31
 (requested by bad in ticket #1104)

         Clear done_head in the HCCA *before* acknowledging the interrupt.
         Driver lost some completed transfers under heavy loads.
         Fix some braindead calls to free memory (only encountered under low
           memory conditions).
         Add some spl calls to protect critical regions. From PR#18440
         Remove extra call to ohci_rem_ed().  From PR#18448
         Put some ifdefs around USB_USE_SOFTINTR stuff.
         Fix several nits:
         - Call usbd_transfer_complete at splusb.
         - Fix a botched for loop in ohci_rem_ed.
         - In ohci_close_pipe, wait 1ms after removing an ED to avoid possible
           race condition.
         Update xfer->frlengths for input isoc transfer.
         Also fix error handling for isoc transfer somewhat;
           usb_transfer_complete shouldn't be called for more than once.
         Add a couple of le32toh which were missing in the previous.


 To generate a diff of this commit:
 cvs rdiff -r1.30 -r1.30.10.1 src/sys/dev/usb/ohcivar.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.