NetBSD Problem Report #52154

From www@NetBSD.org  Tue Apr 11 11:12:48 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C8A987A168
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 11 Apr 2017 11:12:47 +0000 (UTC)
Message-Id: <20170411111246.AF8D57A290@mollari.NetBSD.org>
Date: Tue, 11 Apr 2017 11:12:46 +0000 (UTC)
From: swifty_mc_vay@mail.ru
Reply-To: swifty_mc_vay@mail.ru
To: gnats-bugs@NetBSD.org
Subject: xHCI Slot Context Not Include in configure endpoint process
X-Send-Pr-Version: www-1.0

>Number:         52154
>Category:       kern
>Synopsis:       xHCI Slot Context Not Include in configure endpoint process
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    skrll
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 11 11:15:00 +0000 2017
>Closed-Date:    Mon Jun 04 09:49:47 +0000 2018
>Last-Modified:  Mon Jun 04 09:49:47 +0000 2018
>Originator:     Ilya
>Release:        all
>Organization:
Firm ANCUD
>Environment:
>Description:
eXtensible Host Controller Interface Specification(rev 1.1), 4.6.6:

"A0 shall be set to ‘1’ and refer to section 6.2.2.2 for the Slot Context fields
used by the Configure Endpoint Command."

But in function 'xhci_configure_endpoint' or 'xhci_setup_ctx'  A0 not set to '1' state.
On hardware it work normally, but not on qemu emulator.
>How-To-Repeat:
I have seen that when I run netbsd on qemu with the usbhost named nec-usb-xhci.
>Fix:
Enable SLOT Context. A0 shall be set to '1' in xhci_configure_endpoint or xhci_setup_ctx function

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Tue, 11 Apr 2017 16:10:59 +0000
Responsible-Changed-Why:
Take


From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, swifty_mc_vay@mail.ru
Cc: 
Subject: Re: kern/52154 (xHCI Slot Context Not Include in configure endpoint
 process)
Date: Thu, 13 Apr 2017 08:25:34 +0100

 Does this work for you?

 Index: sys/dev/usb/xhci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/xhci.c,v
 retrieving revision 1.70
 diff -u -p -r1.70 xhci.c
 --- sys/dev/usb/xhci.c  21 Jan 2017 07:39:30 -0000      1.70
 +++ sys/dev/usb/xhci.c  13 Apr 2017 07:23:42 -0000
 @@ -2956,7 +2956,9 @@ xhci_setup_ctx(struct usbd_pipe *pipe)
          cp = xhci_slot_get_icv(sc, xs, XHCI_ICI_INPUT_CONTROL);
          cp[0] = htole32(0);
          cp[1] = htole32(XHCI_INCTX_1_ADD_MASK(dci));
 +#if 0
          if (dci == XHCI_DCI_EP_CONTROL)
 +#endif
                  cp[1] |= htole32(XHCI_INCTX_1_ADD_MASK(XHCI_DCI_SLOT));
          cp[7] = htole32(0);

From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/52154: xHCI Slot Context Not Include in configure endpoint
 process
Date: Thu, 13 Apr 2017 07:57:41 -0500

 I read the xHCI 1.0 spec the same.  I believe skrll's patch is correct.

From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52154 CVS commit: src/sys/dev/usb
Date: Thu, 13 Apr 2017 19:54:22 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Thu Apr 13 19:54:22 UTC 2017

 Modified Files:
 	src/sys/dev/usb: xhci.c

 Log Message:
 PR/52154: xHCI Slot Context Not Include in configure endpoint process

 eXtensible Host Controller Interface Specification(rev 1.1), 4.6.6:

 "A0 shall be set to 1 and refer to section 6.2.2.2 for the Slot Context fields
 used by the Configure Endpoint Command."


 To generate a diff of this commit:
 cvs rdiff -u -r1.70 -r1.71 src/sys/dev/usb/xhci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 04 Jun 2018 09:49:47 +0000
State-Changed-Why:
Patch committed, thanks for the report!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.