From owner-freebsd-usb@FreeBSD.ORG Thu Jan 29 19:57:27 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2333F46F for ; Thu, 29 Jan 2015 19:57:27 +0000 (UTC) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD3BFCB for ; Thu, 29 Jan 2015 19:57:25 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id t0TJvFfc003754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 Jan 2015 22:57:15 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id t0TJvEXQ003753; Thu, 29 Jan 2015 22:57:14 +0300 (MSK) (envelope-from dchagin) Date: Thu, 29 Jan 2015 22:57:14 +0300 From: Chagin Dmitry To: Hans Petter Selasky Subject: Re: [Bug?] Control Transfers in xHCI Message-ID: <20150129195714.GA3683@dchagin.static.corbina.net> References: <20150129.212550.434561541001871867.okuno.kohji@jp.panasonic.com> <54CA4BE3.2090706@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <54CA4BE3.2090706@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 19:57:27 -0000 On Thu, Jan 29, 2015 at 04:04:03PM +0100, Hans Petter Selasky wrote: > On 01/29/15 13:25, Kohji Okuno wrote: > > Hi HPS, > > > > I found a bug in xHCI device driver. > > > > Acording to extensible-host-controler-interface-usb-xhci.pdf:"3.2.9 > > Control Transfers"... > > > > A Data Stage TD consists of a Data Stage TRB followed by zero or more > > Normal TRBs. If the data is not physically contiguous, Normal TRBs may > > be chained to the Data Stage TRB. > > > > > > But, in the current imprementation, when two or more TRBs are needed, > > the device driver set XHCI_TRB_TYPE_DATA_STAGE to all TRBs. > > This is the violation of the spec. > > > > In my minor xHCI, I encountered strange bubble error in a control > > transfer. After I changed as the following, I succeeded its control > > transfer. > > > > Would you check the following (****)? > > >=20 > Hi Kohji, >=20 > You are correct there is a bug, but your patch is not correct. >=20 > In FreeBSD we allow SETUP and DATA stages to be done as separate jobs.=20 > That means at the entry of creating a new DATA chain, we need to check=20 > if it is there first DATA packet or not. >=20 > Can you test the attached patch and see if it works for you? >=20 patch is lost somewhere, Hans. --=20 Have fun! chd