From owner-cvs-all Mon Dec 9 14:42:51 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5772D37B401; Mon, 9 Dec 2002 14:42:50 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2053543EC5; Mon, 9 Dec 2002 14:42:49 -0800 (PST) (envelope-from ticso@cicely8.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) by srv1.cosmo-project.de (8.12.5/8.12.5) with ESMTP id gB9Mggwd066355 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 9 Dec 2002 23:42:46 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: from cicely8.cicely.de (cicely8.cicely.de [10.1.1.10]) by cicely5.cicely.de (8.12.6/8.12.6) with ESMTP id gB9MgefQ047204 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 9 Dec 2002 23:42:41 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: from cicely8.cicely.de (localhost [127.0.0.1]) by cicely8.cicely.de (8.12.6/8.12.6) with ESMTP id gB9MgegV014981; Mon, 9 Dec 2002 23:42:40 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: (from ticso@localhost) by cicely8.cicely.de (8.12.6/8.12.6/Submit) id gB9Mgc4l014980; Mon, 9 Dec 2002 23:42:38 +0100 (CET) Date: Mon, 9 Dec 2002 23:42:37 +0100 From: Bernd Walter To: Ian Dowse Cc: Josef Karthauser , Nate Lawson , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/usb ohci.c Message-ID: <20021209224236.GF14089@cicely8.cicely.de> Reply-To: ticso@cicely.de References: <20021209202103.GA658@genius.tao.org.uk> <200212092048.aa11342@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200212092048.aa11342@salmon.maths.tcd.ie> X-Operating-System: FreeBSD cicely8.cicely.de 5.0-CURRENT i386 User-Agent: Mutt/1.5.1i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Dec 09, 2002 at 08:48:55PM +0000, Ian Dowse wrote: > In message <20021209202103.GA658@genius.tao.org.uk>, Josef Karthauser writes: > >On Mon, Dec 09, 2002 at 11:58:09AM -0800, Nate Lawson wrote: > >> On Sun, 8 Dec 2002, Josef Karthauser wrote: > >> > MFNetBSD: (partial 1.133) > >> > - In ohci_close_pipe, wait 1ms after removing an ED to avoid possible > >> > race > >> > condition. > >> > Approved by: re (rwatson) > >> > >> Wouldn't it be better to use a mtx or tsleep/wakeup? A delay leaves the > >> race, only making it non-deterministic. > > >Probably, got a patch :)? > > I haven't looked at the code, but I suspect it is to avoid a race > with the USB hardware, since each usb frame lasts for 1ms. Exactly. It waits for the hardware to finish using the ED before it is freed. The right way would be to wait for the next start of frame, but it's difficult to do correct. With just the wait the only risc is to wait a bit longer than required. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message