NetBSD Problem Report #28731

From dan@uboat.geek.com.au  Tue Dec 21 05:10:39 2004
Return-Path: <dan@uboat.geek.com.au>
Received: from uboat.geek.com.au (IP-1-62.e-Secure.com.au [203.16.201.62])
	by narn.netbsd.org (Postfix) with ESMTP id BA58363B843
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 21 Dec 2004 05:10:38 +0000 (UTC)
Message-Id: <20041221051036.A4688D702@uboat.geek.com.au>
Date: Tue, 21 Dec 2004 16:10:36 +1100 (EST)
From: dan@uboat.geek.com.au
Reply-To: dan@uboat.geek.com.au
To: gnats-bugs@netbsd.org
Subject: problematic umass via ehci
X-Send-Pr-Version: 3.95

>Number:         28731
>Category:       kern
>Synopsis:       ehci behaves oddly with some umass controllers
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 21 05:12:00 +0000 2004
>Last-Modified:  Wed Dec 22 11:09:00 +0000 2004
>Originator:     Daniel Carosone
>Release:        NetBSD 2.99.11
>Organization:
very little
>Environment:
System: NetBSD uboat 2.99.11 NetBSD 2.99.11 (_uboat_) #220: Wed Dec 8 21:18:31 EST 2004 dan@uboat:/home/NetBSD/obj/p3/home/NetBSD/HEAD/src/sys/arch/i386/compile/_uboat_ i386
Architecture: i386
Machine: i386

     $NetBSD: ehci.c,v 1.89 2004/12/03 08:51:31 augustss Exp $
     $NetBSD: ehci_cardbus.c,v 1.10 2004/08/02 19:14:28 mycroft Exp $
     $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $
     $NetBSD: umass_isdata.c,v 1.13 2004/08/20 23:26:54 thorpej Exp $
     $NetBSD: umass_quirks.c,v 1.67 2004/06/28 07:49:16 mycroft Exp $
     $NetBSD: umass_scsipi.c,v 1.21 2004/10/28 07:07:46 yamt Exp $
>Description:

I have some slightly odd results with a cardbus ehci(4) and various
umass devices.  In particular, I have one umass controller that seems
to work differently depending on what is plugged in the *other* usb
port.

First, the controller and ports:

ohci0 at cardbus1 dev 0 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at 11
ohci0: OHCI version 1.0
usb1 at ohci0: USB revision 1.0
uhub2 at usb1
uhub2: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 1 port with 1 removable, self powered
ohci1 at cardbus1 dev 0 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at 11
ohci1: OHCI version 1.0
usb2 at ohci1: USB revision 1.0
uhub3 at usb2
uhub3: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 1 port with 1 removable, self powered
ehci0 at cardbus1 dev 0 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at 11
ehci0: EHCI version 1.0
ehci0: companion controllers, 1 port each: ohci0 ohci1
usb3 at ehci0: USB revision 2.0
uhub4 at usb3
uhub4: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: single transaction translator
uhub4: 2 ports with 2 removable, self powered

The controller works fine with a couple of usb2 umass devices I have,
a laptop-size disk enclosure, and a multi-card reader:

umass0 at uhub4 port 1 configuration 2 interface 0
umass0: In-System Design USB Storage Adapter, rev 2.00/11.05, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <IBM-DJSA, -210, JS2O> disk fixed
sd0: fabricating a geometry
sd0: 9590 MB, 9590 cyl, 64 head, 32 sec, 512 bytes/sect x 19640880 sectors

umass1 at uhub4 port 2 configuration 1 interface 0
umass1: GENERIC Flash Reader, rev 2.00/1.19, addr 3
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, 4 luns per target
sd1 at scsibus1 target 0 lun 0: <Generic, STORAGE DEVICE, 0119> disk removable
sd1: fabricating a geometry
sd1: 62720 KB, 61 cyl, 64 head, 32 sec, 512 bytes/sect x 125440 sectors
sd2 at scsibus1 target 0 lun 1: <Generic, STORAGE DEVICE, 0119> disk removable
sd2: drive offline
sd3 at scsibus1 target 0 lun 2: <Generic, STORAGE DEVICE, 0119> disk removable
sd3: drive offline
sd4 at scsibus1 target 0 lun 3: <Generic, STORAGE DEVICE, 0119> disk removable
sd4: drive offline

However, a third umass device, a usb-to-IDE cable, gives me odd
results.

If I plug it in by itself, I just get an endless loop of the
following, about 1 per second:

uhub4: port 2 reset failed

However, if I have the above laptop disk enclosure plugged already to
the other port, this device works fine:

umass1 at uhub4 port 2 configuration 1 interface 0
umass1: Genesys Logic USB TO IDE, rev 2.00/0.33, addr 3
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, 1 lun per target
cd1 at scsibus1 target 0 lun 0: <LITEON, CD-ROM LTN526S, YS0A> cdrom removable

umass1 at uhub4 port 2 configuration 1 interface 0
umass1: Genesys Logic USB TO IDE, rev 2.00/0.33, addr 3
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, 1 lun per target
sd1 at scsibus1 target 0 lun 0: <Maxtor 6, B200P0, 0811> disk fixed
sd1: fabricating a geometry
sd1: 189 GB, 194481 cyl, 64 head, 32 sec, 512 bytes/sect x 398297088 sectors

although it does seem to take a second or two to probe, unlike other devices.

Then when I unplug umass0, umass1 also detaches and I go back to the
port reset loop.  (The converse happens if I swap ports for
everything, too.)

However, this only works with the laptop disk enclosure in the other
port - the card reader gadget somehow isn't 'helpful' enough in this
way.

The same umass device works fine by itself on another machine with a
different ehci:

ehci0 at pci0 dev 29 function 7: Intel 82801DB USB EHCI Controller (rev. 0x01)

and also via a usb1.1 controller.

I will gather some additional usbdebug output when I next have a
chance to use a serial console on this machine.

>How-To-Repeat:

>Fix:


>Audit-Trail:
From: "Charles M. Hannum" <abuse@spamalicious.com>
To: dan@uboat.geek.com.au
Cc: kern-bug-people@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: kern/28731: problematic umass via ehci
Date: Tue, 21 Dec 2004 05:49:16 +0000

 Which, if any, of these three devices is being powered from USB?  I could 
 easily see one device backfeeding power to another device, for example.

From: Daniel Carosone <dan@geek.com.au>
To: "Charles M. Hannum" <abuse@spamalicious.com>
Cc: dan@geek.com.au, kern-bug-people@netbsd.org,
	gnats-bugs@netbsd.org
Subject: Re: kern/28731: problematic umass via ehci
Date: Tue, 21 Dec 2004 17:08:21 +1100

 --1nR+rbHAiJEL631A
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 On Tue, Dec 21, 2004 at 05:49:16AM +0000, Charles M. Hannum wrote:
 > Which, if any, of these three devices is being powered from USB?  I could=
 =20
 > easily see one device backfeeding power to another device, for example.

 I wondered about something like that.

 The problematic usb-ide cable has its own power supply (to the molex
 connector on the external drive, not to the usb widget).  So I don't
 imagine it needs much power, since it's not powering the drive, just
 the interface.

 The flash widget is usb-powered.

 The laptop disk case is also usb powered, and works that way directly
 from my laptop's usb port, or from a powered hub.  It also has an
 additional power plug, and a passthrough cable that draws power from
 another usb port, if the data cable is on an unpowered hub.  Normally,
 I connect that inline between the onboard usb1 port and the unpowered
 hub, and that's how I was using it when I did the testing in this PR.

 So perhaps it was feeding a little extra power to the usb2 port, via
 the data cable.

 The cardbus card has a socket for an external power supply (but didn't
 come with one, nor even specs for one, natch) to make it a powered
 hub.  I'll see if I can find pinout details and a suitable supply, and
 try with that.

 --
 Dan.
 --1nR+rbHAiJEL631A
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (NetBSD)

 iD8DBQFBx73UEAVxvV4N66cRAiniAKCFs8fOq/NqGXbhCNlehxwgOd5EDwCePxgc
 KwcOTuBwBvQKIXQLB+cvOcY=
 =NOhi
 -----END PGP SIGNATURE-----

 --1nR+rbHAiJEL631A--

From: Daniel Carosone <dan@geek.com.au>
To: Daniel Carosone <dan@geek.com.au>
Cc: "Charles M. Hannum" <abuse@spamalicious.com>,
	kern-bug-people@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: kern/28731: problematic umass via ehci
Date: Wed, 22 Dec 2004 20:30:50 +1100

 --MAH+hnPXVZWQ5cD/
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 Ok, some further testing, mostly along the power theory.  It doesn't
 look like it's quite that simple, alas.

 I found an apprpriate wall-wart to feed the cardbus card with external
 power.  It makes no difference to the previous results, and the
 usb-ide cable doesn't work on its own.

 However, it clearly has at least some effect on the usb ports and
 their power supply, because a wireless usb mouse I have works when the
 receiver is plugged into the card-with-power, but doesn't trigger any
 response at all without. (oddly enough, the mouse continues to work if
 the external power is yanked after it has probed, so I guess it's
 marginal).  A usb keyboard initially showed:

 uhub2: device problem, disabling port 1

 but with the external source the keyboard also works fine.

 Even with the external source, it doesn't seem to feed the laptop hard
 disk with enough power to work off just the data cable, nor with the
 disk's piggyback power lead from the other port, which is a little
 odd.

 I then used the wall-wart to power the laptop hard disk directly, and
 in these conditions the previous results are also upheld: the laptop
 hard disk magically helps the usb-ide cable work.

 Then I tried an external usb2 hub. I presume this is a powered hub;
 it's built into my LCD monitor, and the whole uhub disappears when I
 switch off the monitor. Anyway, there, the usb-ide cable works
 properly too, though still with the 1 second or so delay in probing
 that I don't see with other devices.

 For whatever its worth, the laptop disk also works fine off the
 monitor's hub, but doesn't get enough power over just the data cable
 to do so. I think the only places I've ever seen it work that way were
 directly on motherboard ports, and perhaps not even all of those.

 At about this point in all the plugging and unplugging, the ehci ports
 stopped responding completely, and I eventually powercycled the laptop
 to continue.

 I wanted to try one more test, to see if the external laptop case was
 feeding enough power back into the cardbus card to make the RF mouse
 receiver work. It does, even if that isn't much.

 So I'm still not entirely sure what conclusions to draw from all this.
 I think there is a power issue with the ports on this thing, which
 doesn't really surprise me since I doubt cardbus will supply all that
 much.  However, clearly that's not the entirety of the problem either,
 unless somehow the usb-ide cable wants much more power than any of the
 other things that needed more that it would provide on its own.

 Next steps:
 =20
 * I guess I need some more reliable way to determine whether the ports
   have sufficient power, and see how much difference feeding the card
   from external power actually makes.  Any suggestions on what to try,
   or what I should expect to see with a multimeter?

 * I'll try to find a small usb2 external hub, sans superfluous 19" LCD
   and mandatory power supply, and try the usb-ide cable in that with
   and without external power.

 * Serial console and various *debug flags. Suggestions for specific
   useful values welcome.

 * Get another of these things and post it to Charles, at which point
   he can also make ehci detachment work.  Actually, I'm more than
   tempted to start here :)

 --
 Dan.

 --MAH+hnPXVZWQ5cD/
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (NetBSD)

 iD8DBQFByT7KEAVxvV4N66cRArgBAJ0ScZqr582w+TlOt9phCpazRaCE9QCg7fv0
 clpBsLzgiS2sLijx4d+Z9L8=
 =pSLM
 -----END PGP SIGNATURE-----

 --MAH+hnPXVZWQ5cD/--

From: Daniel Carosone <dan@geek.com.au>
To: Daniel Carosone <dan@geek.com.au>
Cc: "Charles M. Hannum" <abuse@spamalicious.com>,
	kern-bug-people@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: kern/28731: problematic umass via ehci
Date: Wed, 22 Dec 2004 22:07:14 +1100

 --7LkOrbQMr4cezO2T
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 I tried a tiny usb1 unpowered hub into the ehci ports. Hub probes
 ok. Without power into the echi root, when I plug the usb-ide cable
 into the hub, nothing happens.  Add power to the ehci, the hub led
 glows brighter, and the umass and disk is probed (again after a second
 or two) and works (obviously only at the lower 'full' speed).

 Could it need much more power at 'high' speed directly than the hub
 draws at 'full'?  Remember, it's just powering the IDE interface, not
 the drive.

 I don't see an unpowered usb2 hub here.

 --
 Dan.

 --7LkOrbQMr4cezO2T
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (NetBSD)

 iD8DBQFByVViEAVxvV4N66cRArnCAKDk2+lSSDkmanQ2hSMrk+lCH5wUqQCgnHFt
 r8A0zeTjrT7knmmdfUYYJc4=
 =0x9K
 -----END PGP SIGNATURE-----

 --7LkOrbQMr4cezO2T--

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.