From owner-freebsd-usb@FreeBSD.ORG Thu Jan 29 15:03:23 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 D3343BE5 for ; Thu, 29 Jan 2015 15:03:23 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B195797 for ; Thu, 29 Jan 2015 15:03:22 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3543A1FE023; Thu, 29 Jan 2015 16:03:13 +0100 (CET) Message-ID: <54CA4BE3.2090706@selasky.org> Date: Thu, 29 Jan 2015 16:04:03 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Kohji Okuno , freebsd-usb@freebsd.org Subject: Re: [Bug?] Control Transfers in xHCI References: <20150129.212550.434561541001871867.okuno.kohji@jp.panasonic.com> In-Reply-To: <20150129.212550.434561541001871867.okuno.kohji@jp.panasonic.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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 15:03:23 -0000 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 (****)? > Hi Kohji, You are correct there is a bug, but your patch is not correct. In FreeBSD we allow SETUP and DATA stages to be done as separate jobs. That means at the entry of creating a new DATA chain, we need to check if it is there first DATA packet or not. Can you test the attached patch and see if it works for you? Thank you! --HPS