From owner-freebsd-current@FreeBSD.ORG Wed Dec 11 10:55:18 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F16A128; Wed, 11 Dec 2013 10:55:18 +0000 (UTC) Received: from mta04.bitpro.no (mta04.bitpro.no [92.42.64.203]) by mx1.freebsd.org (Postfix) with ESMTP id 56FF417ED; Wed, 11 Dec 2013 10:55:18 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta04.bitpro.no (Postfix) with ESMTPS id 1876D10058D; Wed, 11 Dec 2013 11:55:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 8BDE08FEA03; Wed, 11 Dec 2013 11:55:54 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5zmjYes+Hnhr; Wed, 11 Dec 2013 11:55:53 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 3F6C68FEA04; Wed, 11 Dec 2013 11:55:53 +0100 (CET) Message-ID: <52A844D6.7050203@bitfrost.no> Date: Wed, 11 Dec 2013 11:56:22 +0100 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Kohji Okuno , freebsd-current@FreeBSD.org, freebsd-usb@freebsd.org Subject: Re: spec violation of xHCI? References: <20131211.191212.1888965979017331164.okuno.kohji@jp.panasonic.com> In-Reply-To: <20131211.191212.1888965979017331164.okuno.kohji@jp.panasonic.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 10:55:18 -0000 On 12/11/13 11:12, Kohji Okuno wrote: > Hi, > > I think the xHCI host controller driver has a spec violation. > > Could you refer to > ``Table 126: Offset 0Ch – Link TRB Field Definitions'' > in xHCI_Specification_for_USB.pdf(Revision 1.0)? > > The following is an excerpt about the CHAIN ​​BIT. > > Chain bit (CH). Set to ‘1’ by software to associate this TRB with > the next TRB on the Ring. A Transfer Descriptor (TD) is defined as > one or more TRBs. The Chain bit is used to identify the TRBs that > comprise a TD. Refer to section 4.11.7 for more information on Link > TRB placement within a TD. On a Command Ring this bit is ignored by > the xHC. > > > I think that we should add XHCI_TRB_3_CHAIN_BIT to line 1895. > How do you think? > Hi Kohji, The double word written at line 1895 does not set the "chain bit" because this is the end of a transfer descriptor, TD. I'm unsure how hardware interprets this bit, if setting the bit on the previous TRB makes the next one connect to the previous one, or the other way around. If setting this bit makes the TRB connect to the previous one, you are correct. Else the current code is correct. Thank you! --HPS > > src/sys/dev/usb/controller/xhci.c: > 1879 /* fill out link TRB */ > 1880 > 1881 if (td_next != NULL) { > 1882 /* link the current TD with the next one */ > 1883 td->td_trb[x].qwTrb0 = htole64((uint64_t)td_next->td_self); > 1884 DPRINTF("LINK=0x%08llx\n", (long long)td_next->td_self); > 1885 } else { > 1886 /* this field will get updated later */ > 1887 DPRINTF("NOLINK\n"); > 1888 } > 1889 > 1890 dword = XHCI_TRB_2_IRQ_SET(0); > 1891 > 1892 td->td_trb[x].dwTrb2 = htole32(dword); > 1893 > 1894 dword = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) | > 1895 XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT; > 1896 > 1897 td->td_trb[x].dwTrb3 = htole32(dword); > 1898 > 1899 td->alt_next = td_alt_next; > > -- > Best regards, > Kohji Okuno > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" >