NetBSD Problem Report #42572

From leo@slug.localdomain  Sun Jan  3 14:41:47 2010
Return-Path: <leo@slug.localdomain>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2551563B844
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  3 Jan 2010 14:41:47 +0000 (UTC)
Message-Id: <20100103144145.58AF168843@slug.localdomain>
Date: Sun,  3 Jan 2010 15:41:45 +0100 (CET)
From: leo@marco.de
Reply-To: leo@marco.de
To: gnats-bugs@gnats.NetBSD.org
Subject: misc usb devices failing to attach
X-Send-Pr-Version: 3.95

>Number:         42572
>Category:       kern
>Synopsis:       misc usb devices failing to attach
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 03 14:45:00 +0000 2010
>Closed-Date:    Sun Apr 25 09:16:35 +0000 2010
>Last-Modified:  Sun Apr 25 09:16:35 +0000 2010
>Originator:     leo@marco.de
>Release:        NetBSD 5.99.23
>Organization:
Matthias Pfaller                            Software Entwicklung
marco Systemanalyse und Entwicklung GmbH    Tel   +49 8131 5161 41
Hans-Böckler-Str. 2, D 85221 Dachau         Fax   +49 8131 5161 66
http://www.marco.de/                        Email leo@marco.de
>Environment:


System: NetBSD slug 5.99.23 NetBSD 5.99.23 (SLUG) #40: Sun Jan 3 14:46:32 CET 2010 leo@slug:/usr/src/sys/arch/i386/compile/SLUG i386
Architecture: i386
Machine: i386
>Description:
	I have a siemens gigaset usb dect bridge which fails to attach
	with
		Jan  3 11:48:02 slug /netbsd: usbd_reset_port: port 2 reset done, error=NORMAL_COMPLETION
		Jan  3 11:48:02 slug /netbsd: usbd_new_device bus=0xcc994004 port=2 depth=1 speed=2
		Jan  3 11:48:02 slug /netbsd: usbd_setup_pipe: dev=0xc2ad6d00 iface=0x0 ep=0xc2ad6d24 pipe=0xc2ad6d04
		Jan  3 11:48:02 slug /netbsd: usbd_get_desc: type=1, index=0, len=8
		Jan  3 11:48:02 slug /netbsd: usbd_new_device: adding unit addr=3, rev=110, class=0, subclass=0, protocol=0, maxpacket=16, len=18, speed=2
		Jan  3 11:48:02 slug /netbsd: usbd_get_device_desc:
		Jan  3 11:48:02 slug /netbsd: usbd_get_desc: type=1, index=0, len=18
		Jan  3 11:48:02 slug /netbsd: usbd_new_device: addr=3, getting full desc failed
		Jan  3 11:48:02 slug /netbsd: usbd_remove_device: 0xc2ad6d00
		Jan  3 11:48:02 slug /netbsd: usbd_ar_pipe: pipe=0xc2abfa00
		Jan  3 11:48:02 slug /netbsd: uhub_explore: usb_new_device failed, error=IOERROR
		Jan  3 11:48:02 slug /netbsd: uhub4: device problem, disabling port 2
	After applying the appended patch (I found an old freebsd pr kern/41243
	from 2004 which does the same thing), I get the following result:
		Jan  3 14:48:01 slug /netbsd: ugen0 at uhub4 port 2
		Jan  3 14:48:01 slug /netbsd: ugen0: Siemens AG USB DECT device, rev 1.10/2.60, addr 3
	I have a couple of usb sticks at work which fail with "device error"
	as well. I hope these will work with this patch as well (can't test
	at the moment).
>How-To-Repeat:
	Plug in a "Siemens AG USB DECT device".
>Fix:
	Apply the following patch:
--- usb_subr.c	12 Nov 2009 20:11:35 -0000	1.167
+++ usb_subr.c	3 Jan 2010 14:33:52 -0000
@@ -1158,14 +1158,6 @@

 	USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize);

-	err = usbd_reload_device_desc(dev);
-	if (err) {
-		DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
-			      "failed\n", addr));
-		usbd_remove_device(dev, up);
-		return (err);
-	}
-
 	/* Set the address */
 	DPRINTFN(5, ("usbd_new_device: setting device address=%d\n", addr));
 	err = usbd_set_address(dev, addr);
@@ -1181,6 +1173,14 @@
 	dev->address = addr;	/* new device address now */
 	bus->devices[addr] = dev;

+	err = usbd_reload_device_desc(dev);
+	if (err) {
+		DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
+			      "failed\n", addr));
+		usbd_remove_device(dev, up);
+		return (err);
+	}
+
 	/* Re-establish the default pipe with the new address. */
 	usbd_kill_pipe(dev->default_pipe);
 	err = usbd_setup_pipe(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL,

>Release-Note:

>Audit-Trail:
From: Matthias Pfaller <leo@marco.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/42572: misc usb devices failing to attach
Date: Sat, 09 Jan 2010 16:53:56 +0100

 I just tried one of the micro-sd adapters which gave me "port disabling 
 ..." error before. Now I get:

 /netbsd: sd4 at scsibus1 target 0 lun 0: <Generic, , 6000> disk removable
 /netbsd: sd4(umass1:0:0:0): generic HBA error
 /netbsd: sd4: drive offline

 While the adapter still doesn't work, it's at least probed correctly.

 usbdevs -v shows:
 port 4 addr 2: high speed, power 500 mA, config 1, USB2.0 Card 
 Reader(0x6000), Generic       ,   .(0x090c), rev 1.00, serial 
 12345678901234567890

 Matthias

From: Matthias Pfaller <matthias@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42572 CVS commit: src/sys/dev/usb
Date: Sun, 25 Apr 2010 09:14:39 +0000

 Module Name:	src
 Committed By:	matthias
 Date:		Sun Apr 25 09:14:39 UTC 2010

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

 Log Message:
 Fix for PR#42572. I was running with this patch for several month without
 any problems.


 To generate a diff of this commit:
 cvs rdiff -u -r1.167 -r1.168 src/sys/dev/usb/usb_subr.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: matthias@NetBSD.org
State-Changed-When: Sun, 25 Apr 2010 09:16:35 +0000
State-Changed-Why:
patch applied.


>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.