NetBSD Problem Report #47522

From www@NetBSD.org  Fri Feb  1 23:26:44 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 0C53E63EEC6
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  1 Feb 2013 23:26:44 +0000 (UTC)
Message-Id: <20130201232642.DA8AC63EEC6@www.NetBSD.org>
Date: Fri,  1 Feb 2013 23:26:42 +0000 (UTC)
From: jakllsch@kollasch.net
Reply-To: jakllsch@kollasch.net
To: gnats-bugs@NetBSD.org
Subject: Enumeration of LUFA/Atmel devices on UHCI fails
X-Send-Pr-Version: www-1.0

>Number:         47522
>Category:       kern
>Synopsis:       Enumeration of LUFA/Atmel devices on UHCI fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    skrll
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 01 23:30:01 +0000 2013
>Closed-Date:    Sun Oct 06 16:12:26 +0000 2013
>Last-Modified:  Sun Oct 06 16:12:26 +0000 2013
>Originator:     Jonathan Kollasch
>Release:        6.0
>Organization:
>Environment:
amd64
>Description:
Enumeration of Atmel's AT90USBx2 DFU firmware loader, as well
as any LUFA-based device firmware (at least when running on an AVR8
micro-controller) fail to enumerate when connected to a NetBSD UHCI
root hub.

USB analyzer traces indicate that the request for the initial device
descriptor (the one obtained while the device is at address 0) are
not correctly executed by the host controller.  However most devices
do not trip over this problem.

During this first request to a plugged device, the SETUP and IN phases
happen (apparently) normally, however the final OUT phase does not occur.
This may cause the state machine in the firmware of some devices to not
accept the address assignment.
>How-To-Repeat:
Plugging an Atmel and/or LUFA device into UHCI root hub port
results in "device problem, disabling port" message from kernel.
When plugged into a NetBSD OHCI root hub or a USB 2.0 hub
(via transaction translator), it enumerates as expected.

I have only experienced this problem on Intel (ICH7) UHCI controllers,
however I haven't tried other Intel or VIA UHCIs.
>Fix:

>Release-Note:

>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/47522: Enumeration of LUFA/Atmel devices on UHCI fails
Date: Sat, 2 Feb 2013 13:40:25 -0600

 This issue is due to the Short Packet Detect bit in the Transfer
 Descriptor causing an early completion of the control transfer.

From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/47522: Enumeration of LUFA/Atmel devices on UHCI fails
Date: Wed, 28 Aug 2013 14:49:02 -0500

 This is a bus analyzer capture of the failure on a NetBSD 6.0.2_PATCH amd64 host
 w/ ICH7 UHCI.  Basically it shows what might be expected.

 http://www.netbsd.org/~jakllsch/NetBSD-uhci-AT90USB162-DFU-enumeration-failure.usb

 Windows software to view capture can be found at
 http://www.internationaltestinstruments.com/topic/6-1480a-usb-protocol-analyzer-software-downloads.aspx

Responsible-Changed-From-To: kern-bug-people->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Sat, 31 Aug 2013 11:21:34 +0000
Responsible-Changed-Why:
Take


State-Changed-From-To: open->analyzed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 31 Aug 2013 11:21:34 +0000
State-Changed-Why:
SPD on the data phase of usbd_get_initial_ddesc where 64 bytes are request
would terminate the TD chain as less than 64 bytes were coming back. This
means the status stage never get executed by uhci.

Additionally, setting UHCI_PTR_VF on control transfer TDs executes the stages
too quickly for the device.


From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47522 CVS commit: src/sys/dev/usb
Date: Sat, 7 Sep 2013 16:17:12 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Sat Sep  7 16:17:12 UTC 2013

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

 Log Message:
 Deal with control transfers better by

 	- removing the UHCI_PTR_VF flag for the setup and status stages
 	  which means they are scheduled less aggressively.  Some devices
 	  appear to require this (blymn@ has one).  The flag was
 	  introduced as a performance improvement for bulk transfers.

 	- Checking for short reads and making sure the status stage runs
 	  if they're encountered.

 PR/47522 Enumeration of LUFA/Atmel devices on UHCI fails

 Thanks to jak@ and blymn@ for testing and mlelstv@ for comments.


 To generate a diff of this commit:
 cvs rdiff -u -r1.257 -r1.258 src/sys/dev/usb/uhci.c

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

State-Changed-From-To: analyzed->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 07 Sep 2013 16:52:15 +0000
State-Changed-Why:
OK to close? Thanks, Nick


From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47522 CVS commit: [netbsd-6] src/sys/dev/usb
Date: Thu, 26 Sep 2013 01:51:47 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Thu Sep 26 01:51:47 UTC 2013

 Modified Files:
 	src/sys/dev/usb [netbsd-6]: ehci.c uhci.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #950):
 	sys/dev/usb/uhci.c: revision 1.255
 	sys/dev/usb/uhci.c: revision 1.256
 	sys/dev/usb/ehci.c: revision 1.205
 	sys/dev/usb/uhci.c: revision 1.258
 Add missed byteswap ops for BE machines in block added in rev 1.223.
 Call usb_syncmem() against descriptors more strictly.
 (not sure if the previous ones were fatal though)
 Deal with control transfers better by
 	- removing the UHCI_PTR_VF flag for the setup and status stages
 	  which means they are scheduled less aggressively.  Some devices
 	  appear to require this (blymn@ has one).  The flag was
 	  introduced as a performance improvement for bulk transfers.
 	- Checking for short reads and making sure the status stage runs
 	  if they're encountered.
 PR/47522 Enumeration of LUFA/Atmel devices on UHCI fails
 Thanks to jak@ and blymn@ for testing and mlelstv@ for comments.


 To generate a diff of this commit:
 cvs rdiff -u -r1.183 -r1.183.2.1 src/sys/dev/usb/ehci.c
 cvs rdiff -u -r1.242 -r1.242.2.1 src/sys/dev/usb/uhci.c

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

From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47522 CVS commit: [netbsd-6-0] src/sys/dev/usb
Date: Thu, 26 Sep 2013 01:55:49 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Thu Sep 26 01:55:49 UTC 2013

 Modified Files:
 	src/sys/dev/usb [netbsd-6-0]: ehci.c uhci.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #950):
 	sys/dev/usb/uhci.c: revision 1.255
 	sys/dev/usb/uhci.c: revision 1.256
 	sys/dev/usb/ehci.c: revision 1.205
 	sys/dev/usb/uhci.c: revision 1.258
 Add missed byteswap ops for BE machines in block added in rev 1.223.
 Call usb_syncmem() against descriptors more strictly.
 (not sure if the previous ones were fatal though)
 Deal with control transfers better by
 	- removing the UHCI_PTR_VF flag for the setup and status stages
 	  which means they are scheduled less aggressively.  Some devices
 	  appear to require this (blymn@ has one).  The flag was
 	  introduced as a performance improvement for bulk transfers.
 	- Checking for short reads and making sure the status stage runs
 	  if they're encountered.
 PR/47522 Enumeration of LUFA/Atmel devices on UHCI fails
 Thanks to jak@ and blymn@ for testing and mlelstv@ for comments.


 To generate a diff of this commit:
 cvs rdiff -u -r1.183 -r1.183.6.1 src/sys/dev/usb/ehci.c
 cvs rdiff -u -r1.242 -r1.242.6.1 src/sys/dev/usb/uhci.c

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

From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47522 CVS commit: [netbsd-6-1] src/sys/dev/usb
Date: Thu, 26 Sep 2013 01:57:22 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Thu Sep 26 01:57:22 UTC 2013

 Modified Files:
 	src/sys/dev/usb [netbsd-6-1]: ehci.c uhci.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #950):
 	sys/dev/usb/uhci.c: revision 1.255
 	sys/dev/usb/uhci.c: revision 1.256
 	sys/dev/usb/ehci.c: revision 1.205
 	sys/dev/usb/uhci.c: revision 1.258
 Add missed byteswap ops for BE machines in block added in rev 1.223.
 Call usb_syncmem() against descriptors more strictly.
 (not sure if the previous ones were fatal though)
 Deal with control transfers better by
 	- removing the UHCI_PTR_VF flag for the setup and status stages
 	  which means they are scheduled less aggressively.  Some devices
 	  appear to require this (blymn@ has one).  The flag was
 	  introduced as a performance improvement for bulk transfers.
 	- Checking for short reads and making sure the status stage runs
 	  if they're encountered.
 PR/47522 Enumeration of LUFA/Atmel devices on UHCI fails
 Thanks to jak@ and blymn@ for testing and mlelstv@ for comments.


 To generate a diff of this commit:
 cvs rdiff -u -r1.183 -r1.183.8.1 src/sys/dev/usb/ehci.c
 cvs rdiff -u -r1.242 -r1.242.8.1 src/sys/dev/usb/uhci.c

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

State-Changed-From-To: feedback->closed
State-Changed-By: jakllsch@NetBSD.org
State-Changed-When: Sun, 06 Oct 2013 16:12:26 +0000
State-Changed-Why:
I've confirmed this is fixed in the latest netbsd-6 release as well as -current.



>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.