NetBSD Problem Report #32838

From www@netbsd.org  Tue Feb 14 16:05:01 2006
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id 86BB763B8A0; Tue, 14 Feb 2006 16:05:01 +0000 (UTC)
Message-Id: <20060214160501.86BB763B8A0@narn.netbsd.org>
Date: Tue, 14 Feb 2006 16:05:01 +0000 (UTC)
From: eau@phear.org
Reply-To: eau@phear.org
To: gnats-bugs@netbsd.org
Subject: USB 2.0 harddrive not recognized.
X-Send-Pr-Version: www-1.0

>Number:         32838
>Category:       kern
>Synopsis:       USB 2.0 harddrive not recognized.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 14 16:10:00 +0000 2006
>Closed-Date:    
>Last-Modified:  Thu Apr 10 02:51:29 +0000 2008
>Originator:     Eric Auge
>Release:        NetBSD 3.0
>Organization:
>Environment:
NetBSD mubutu.no.phear.org 3.0 NetBSD 3.0 (MUBUTU) #28: Tue Feb 14 16:45:29 CET 2006  root@mubutu.no.phear.org:/usr/obj/sys/arch/i386/compile/MUBUTU i386
>Description:
I just bought some USB 2.0 harddrive, and plugging in 
my USB port lead to this :
[...]
Feb 14 16:17:05 mubutu /netbsd: umass0: ITE TECH. INC. USB TO IDE, rev 2.00/2.00, addr 2
Feb 14 16:17:05 mubutu /netbsd: umass0: using SCSI over Bulk-Only
Feb 14 16:17:10 mubutu /netbsd: umass0: Get Max Lun failed: TIMEOUT
Feb 14 16:17:10 mubutu /netbsd: umass0: unable to get Max Lun: TIMEOUT
Feb 14 16:17:11 mubutu /netbsd: umass0: at uhub0 port 1 (addr 2) disconnected
Feb 14 16:17:11 mubutu /netbsd: umass0 detached
Feb 14 16:17:17 mubutu /netbsd: umass0 at uhub1 port 1 configuration 1 interface 0
[...]
Notice that booting while keeping the hardrive plugged make it 
being recognized at boot, then if unplugged it doesn't work anymore

I made a quick and dirty patch (after browsing the web for similar issues) that make USBD_TIMEOUT not fatal.

in usr/src/sys/dev/usb/umass.c 
line 1753 function umass_bbb_get_max_lun() :

[...]
        case USBD_STALLED:
+        case USBD_TIMEOUT:
[...]

I added USBD_TIMEOUT with the same behavior as STALLED since the device seems to not return STALLED correctly and just TIMEOUT.

May be i'm wrong i don't know exactly the whole issue, 
some explaination could be nice so i understand why it is behaving like this, or what need to be done to do a clean fix for this problem.

here is after this patch :
[...]
Feb 14 16:50:44 mubutu /netbsd: umass0: ITE TECH. INC. USB TO IDE, rev 2.00/2.00, addr 2
Feb 14 16:50:44 mubutu /netbsd: umass0: using SCSI over Bulk-Only
Feb 14 16:50:49 mubutu /netbsd: scsibus0 at umass0: 2 targets, 1 lun per target
Feb 14 16:50:55 mubutu /netbsd: sd0 at scsibus0 target 0 lun 0: <, SAMSUNG MP0603H, UD10> disk fixed
Feb 14 16:50:55 mubutu /netbsd: sd0: fabricating a geometry
Feb 14 16:50:55 mubutu /netbsd: sd0: 57231 MB, 57231 cyl, 64 head, 32 sec, 512 bytes/sect x 117210240 sectors
Feb 14 16:51:06 mubutu /netbsd: sd0: fabricating a geometry
[...]

Hope it helps,
Eric.
>How-To-Repeat:
just plug the hard drive while running...
>Fix:
in usr/src/sys/dev/usb/umass.c 
line 1753 function umass_bbb_get_max_lun() :

[...]
        case USBD_STALLED:
+        case USBD_TIMEOUT:
[...]

may be this isn't a fix, waiting for feedback...

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: tsutsui@netbsd.org
State-Changed-When: Sat, 25 Nov 2006 22:56:37 +0900
State-Changed-Why:
Could you try NetBSD 3.1? There are some timeout fixes for VIA ehci:
http://mail-index.netbsd.org/source-changes/2006/01/22/0032.html


From: Eric Auge <eau@phear.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/32838
Date: Mon, 05 Feb 2007 09:31:08 +0100

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig214607345DD2A3A0591EFFCC
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable

 Hello,

 I cant test with netbsd 3.1 i only have my laptop running netbsd 4.0beta
 and the usb is still doing the same error :
 [...]
 umass0 at uhub5 port 4 configuration 1 interface 0
 umass0: ITE TECH. INC. USB TO IDE, rev 2.00/2.00, addr 3
 umass0: using SCSI over Bulk-Only
 umass0: Get Max Lun failed: TIMEOUT
 umass0: unable to get Max Lun: TIMEOUT
 umass0: at uhub5 port 4 (addr 3) disconnected
 umass0 detached
 [...]

 rival@kamehouse:~/tmp $ uname -a
 NetBSD kamehouse.no.phear.org 4.0_BETA2 NetBSD 4.0_BETA2 (KameHouse) #11:=
  Fri
 Jan 12 13:38:36 CET 2007
 root@kamehouse.no.phear.org:/usr/obj/sys/arch/i386/compile/KAMEHOUSE.MPAC=
 PI i386

 Do you need more infos ?

 Best Regards,
 Eric.


 --------------enig214607345DD2A3A0591EFFCC
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

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

 iD8DBQFFxutMSdZNA80H8MYRAoD5AKCPjYL9yHO3Zax+IwYnBrMpwLQvBwCgnHm8
 dIYrHrpccxoHFXszwQM4QMQ=
 =2lQe
 -----END PGP SIGNATURE-----

 --------------enig214607345DD2A3A0591EFFCC--

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 10 Apr 2008 02:51:29 +0000
State-Changed-Why:
feedback received, problem still exist(ed)


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