From nobody@FreeBSD.org Tue Apr 26 13:03:38 2005 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EDC716A4CE for ; Tue, 26 Apr 2005 13:03:38 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8FED43D39 for ; Tue, 26 Apr 2005 13:03:37 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j3QD3baX071152 for ; Tue, 26 Apr 2005 13:03:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j3QD3bnd071151; Tue, 26 Apr 2005 13:03:37 GMT (envelope-from nobody) Message-Id: <200504261303.j3QD3bnd071151@www.freebsd.org> Date: Tue, 26 Apr 2005 13:03:37 GMT From: Fridtjof Busse To: freebsd-gnats-submit@FreeBSD.org Subject: mounting of usb-stick fails X-Send-Pr-Version: www-2.3 >Number: 80361 >Category: usb >Synopsis: [umass] [patch] mounting of Dell usb-stick fails >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 26 13:10:21 GMT 2005 >Closed-Date: >Last-Modified: Mon Nov 22 22:36:14 UTC 2010 >Originator: Fridtjof Busse >Release: 5.4-RC3 >Organization: >Environment: >Description: If I try to mount my Dell Memory Stick 256 MB, I only get /dev/da0 (and not /dev/da0s1) and this appears in dmesg: umass0: M-SysT5 Dell Memory Key, rev 2.00/2.00, addr 2 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 1.000MB/s transfers da0: Attempt to query device size failed: UNIT ATTENTION, Medium not present (da0:umass-sim0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (da0:umass-sim0:0:0:0): SCSI Status: Check Condition (da0:umass-sim0:0:0:0): UNIT ATTENTION asc:3a,0 (da0:umass-sim0:0:0:0): Medium not present The "Medium not present" error is displayed multiple times until it fails with: (da0:umass-sim0:0:0:0): Retries Exhausted Opened disk da0 -> 6 The only way to get /dev/da0s1 is to do the following: cat /dev/null > /dev/da0s1 Then I get da0s1 and everything works fine, filesystem ist FAT32. But I'd like to be able to mount the stick without this "workaround", it works under Linux-2.6 without any problems at all. The dmesg during the "cat" is: (da0:umass-sim0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (da0:umass-sim0:0:0:0): SCSI Status: Check Condition (da0:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0 (da0:umass-sim0:0:0:0): Not ready to ready change, medium may have changed (da0:umass-sim0:0:0:0): Retrying Command (per Sense Data) >How-To-Repeat: Try to mount a current Dell Memory Stick. There's been a report on questions@ about the same behavior with a Kingston Elite >Fix: >Release-Note: >Audit-Trail: From: Marc Olzheim To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Marc Olzheim Subject: Re: usb/80361: mounting of usb-stick fails Date: Tue, 26 Apr 2005 18:12:09 +0200 I can confirm this for my Kingston Elite. dd if=/dev/da0 of=/dev/null bs=100k count=1 does the trick of making da0s1 known for me. It seems as though the geom auto detection doesn't run anymore. It stil worked a few weeks ago. Marc From: Marc Olzheim To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Wed, 4 May 2005 01:05:31 +0200 On today's stable it works again on my amd64 (with a Kingston DataTraveler Elite). Marc From: Fridtjof Busse To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Wed, 4 May 2005 08:05:53 +0200 My Dell still fails to mount without the workaround on 5.4-RC4/x86. From: Dan Olson To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Tue, 10 May 2005 17:01:02 -0500 I may have access to a patch that will fix this. As root with the usb stick in, run usbdev -v. This shows the vendor and product id. A reference email to freebsd-current is at: http://lists.freebsd.org/pipermail/freebsd-current/2005-March/047827.html Thanks Dan From: Fridtjof Busse To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Sat, 14 May 2005 18:04:39 +0200 This patch fixes the problem at least for me (Dell Memory Stick). The USB_PORT_POWERUP_DELAY didn't help me, but the patch works just fine. Any chance to get this into stable? State-Changed-From-To: open->feedback State-Changed-By: linimon State-Changed-When: Sat Jun 30 06:29:06 UTC 2007 State-Changed-Why: Unfortunately, the mailing list stripped the patch. Does anyone have a copy of the patch still? Responsible-Changed-From-To: freebsd-usb->linimon Responsible-Changed-By: linimon Responsible-Changed-When: Sat Jun 30 06:29:06 UTC 2007 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=80361 From: linimon@lonesome.com (Mark Linimon) To: bug-followup@FreeBSD.org Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Mon, 2 Jul 2007 02:51:50 -0500 ----- Forwarded message from Michal Mertl ----- From: Michal Mertl Hello. Unfortunatley I do not remember all the details anymore but I have found the old emails and the patch (attached). HTH Index: umass.c =================================================================== RCS file: /home/fcvs/cvs/src/sys/dev/usb/umass.c,v retrieving revision 1.119 diff -u -3 -r1.119 umass.c --- umass.c 14 Feb 2005 02:17:53 -0000 1.119 +++ umass.c 24 Mar 2005 23:17:55 -0000 @@ -314,6 +314,8 @@ # define NO_INQUIRY 0x0400 /* Device cannot handle INQUIRY EVPD, return CHECK CONDITION */ # define NO_INQUIRY_EVPD 0x0800 + /* Device needs time to settle down /2s/ XXX */ +# define UMASS_ADD_DELAY 0x1000 }; Static struct umass_devdescr_t umass_devdescrs[] = { @@ -387,6 +389,10 @@ UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, NO_QUIRKS }, + { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DELLMEMKEY, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + UMASS_ADD_DELAY + }, { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY @@ -891,6 +897,7 @@ (void) umass_match_proto(sc, sc->iface, uaa->device); id = usbd_get_interface_descriptor(sc->iface); + #ifdef USB_DEBUG printf("%s: ", USBDEVNAME(sc->sc_dev)); switch (sc->proto&UMASS_PROTO_COMMAND) { @@ -2262,6 +2269,7 @@ Static int umass_cam_attach(struct umass_softc *sc) { + int delay_len; #ifndef USB_DEBUG if (bootverbose) #endif @@ -2278,7 +2286,11 @@ * completed, when interrupts have been enabled. */ - usb_callout(sc->cam_scsi_rescan_ch, MS_TO_TICKS(200), + if (sc->quirks && UMASS_ADD_DELAY) + delay_len = 2000; + else + delay_len = 200; + usb_callout(sc->cam_scsi_rescan_ch, MS_TO_TICKS(delay_len), umass_cam_rescan, sc); } Index: usbdevs =================================================================== RCS file: /home/fcvs/cvs/src/sys/dev/usb/usbdevs,v retrieving revision 1.226 diff -u -3 -r1.226 usbdevs --- usbdevs 21 Mar 2005 08:43:54 -0000 1.226 +++ usbdevs 24 Mar 2005 22:39:48 -0000 @@ -1188,6 +1188,7 @@ /* M-Systems products */ product MSYSTEMS DISKONKEY 0x0010 DiskOnKey product MSYSTEMS DISKONKEY2 0x0011 DiskOnKey +product MSYSTEMS DELLMEMKEY 0x0015 Dell Memory Key /* National Semiconductor */ product NATIONAL BEARPAW1200 0x1000 BearPaw 1200 ----- End forwarded message ----- State-Changed-From-To: feedback->open State-Changed-By: linimon State-Changed-When: Tue Jul 3 06:32:04 UTC 2007 State-Changed-Why: Patch retrieved. http://www.freebsd.org/cgi/query-pr.cgi?pr=80361 Responsible-Changed-From-To: linimon->freebsd-usb Responsible-Changed-By: linimon Responsible-Changed-When: Fri Jul 6 08:46:24 UTC 2007 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=80361 From: Matthias Apitz To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: [umass] [patch] mounting of Dell usb-stick fails Date: Wed, 6 Aug 2008 11:30:54 +0200 I have the same problem in FreeBSD 7.0-REL with the following USB key: $ usbdevs -v ... port 2 addr 2: high speed, power 94 mA, config 1, Store'n'go(0x0020), Verbatim(0x08ec), rev 2.00 which only works (fine) when plug'ed in at boot time: da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: 3812MB (7807999 512 byte sectors: 255H 63S/T 486C) if you plug it in later you will get: Aug 6 10:19:36 rebelion kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Aug 6 10:19:36 rebelion kernel: da0: Removable Direct Access SCSI-0 device Aug 6 10:19:36 rebelion kernel: da0: 40.000MB/s transfers Aug 6 10:19:36 rebelion kernel: da0: Attempt to query device size failed: UNIT ATTENTION, Medium not present and the devices /dev/da0s* does not show up; you only may access /dev/da0 with fdisk(8) or even with dd(1); -- Matthias Apitz From: Stephan Eisvogel To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Matthias Apitz Subject: Re: usb/80361: [umass] [patch] mounting of Dell usb-stick fails Date: Thu, 7 Aug 2008 21:58:47 +0200 I just fished this device port 1 addr 2: high speed, power 140 mA, config 1, DT Elite HS 2.0(0x0015), Kingston(0x08ec), rev 2.00 out of my electronic devices dumpster and got it working with USB hot plugging using an adapted version of the patch by Mark Linimon. This is a 7-STABLE kernel. I tweaked the new quirk to cause a delay before bus rescan of 5000ms. As you can see its a Kingston brand outside, yet the vendor id points to M-Systems. I guess Kingston OEMed those using their own casing. What is interesting is the blue/red dual color LED on this stick, it will blink for a few seconds when you plug the device in and only then begin the idle "glowing" routine (after it has initialized?). My guess is that this particular device takes its time after power on in the order of a handful of seconds before becoming ready. Maybe it is scanning its flash banks or something instead of accepting commands right away. Other operating systems appear to have a retry mechanism (WinXP, Linux) whereas in BSD its all or nothing after 200ms of device attach. Regards, Stephan State-Changed-From-To: open->feedback State-Changed-By: remko State-Changed-When: Wed Jul 14 16:19:03 UTC 2010 State-Changed-Why: Is this still seen on 8.x? That had been completely rewritten and might no longer suffer from this problem. http://www.freebsd.org/cgi/query-pr.cgi?pr=80361 From: Derrick Edwards To: bug-followup@freebsd.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: [umass] [patch] mounting of Dell usb-stick fails Date: Sun, 21 Nov 2010 09:26:09 -0500 I am using 8.1-STABLE and I continue to have this problem. At boot time if my Android phone is attached to system I get a device entry /dev/da0s1 however, if I detach and attempt to reattach I can not get an device entry. An cat /dev/null > /dev/da0 produces an /dev/da0s1 entry however, that is not optimal. Any help would be great. ugen6.3: at usbus6, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON Derrick State-Changed-From-To: feedback->open State-Changed-By: arundel State-Changed-When: Mon Nov 22 22:35:21 UTC 2010 State-Changed-Why: Feedback received. This problem still exists in the new USB stack. http://www.freebsd.org/cgi/query-pr.cgi?pr=80361 >Unformatted: