From owner-p4-projects@FreeBSD.ORG Tue May 12 14:46:00 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C4DB11065674; Tue, 12 May 2009 14:45:59 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 769A8106566B; Tue, 12 May 2009 14:45:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 361C78FC08; Tue, 12 May 2009 14:45:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 9074EFF4D; Wed, 13 May 2009 02:27:23 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IZBDVXuyb5jd; Wed, 13 May 2009 02:27:18 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Wed, 13 May 2009 02:27:18 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 53E8711432; Wed, 13 May 2009 02:27:18 +1200 (NZST) Date: Tue, 12 May 2009 07:27:18 -0700 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090512142718.GI45375@citylink.fud.org.nz> References: <200905120639.n4C6drRs026284@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200905120639.n4C6drRs026284@repoman.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Perforce Change Reviews Subject: Re: PERFORCE change 161961 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2009 14:46:00 -0000 On Tue, May 12, 2009 at 06:39:53AM +0000, Hans Petter Selasky wrote: > http://perforce.freebsd.org/chv.cgi?CH=161961 > > Change 161961 by hselasky@hselasky_laptop001 on 2009/05/12 06:38:57 > > > USB CORE: > - Cancelled error code must be returned in special > case, else device drivers might end up in infinite loop. > - The special case code was introduced by a recent commit. > > Bug report by: Andrey > > Affected files ... > > .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#144 edit > > Differences ... > > ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#144 (text+ko) ==== > > @@ -1439,7 +1439,11 @@ > /* Check if the device is still alive */ > if (info->udev->state < USB_STATE_POWERED) { > USB_BUS_LOCK(bus); > - usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED); > + /* > + * Must return cancelled error code else > + * device drivers can hang. > + */ > + usb2_transfer_done(xfer, USB_ERR_CANCELLED); > USB_BUS_UNLOCK(bus); > return; > } I rather think this is a bug in the drivers, they blindly resubmit the transfer without knowing if the error is restartable. Andew