From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 7 14:15:18 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 045AB106566C for ; Thu, 7 Aug 2008 14:15:18 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id E69E58FC21 for ; Thu, 7 Aug 2008 14:15:17 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id D226B1CC0B3; Thu, 7 Aug 2008 07:15:17 -0700 (PDT) Date: Thu, 7 Aug 2008 07:15:17 -0700 From: Jeremy Chadwick To: Michel Talon Message-ID: <20080807141517.GA32272@eos.sc1.parodius.com> References: <20080807120122.GA15142@lpthe.jussieu.fr> <20080807125045.GA29669@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080807125045.GA29669@eos.sc1.parodius.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org Subject: Re: USB key && kernel: da0: ... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2008 14:15:18 -0000 On Thu, Aug 07, 2008 at 05:50:45AM -0700, Jeremy Chadwick wrote: > On Thu, Aug 07, 2008 at 02:01:22PM +0200, Michel Talon wrote: > > > Matthias Apitz wrote: > > > Aug 6 10:06:12 rebelion kernel: umass0: on uhub4 > > > Aug 6 10:06:12 rebelion root: Unknown USB device: vendor 0x08ec product 0x0020 bus uhub4 > > > Aug 6 10:06:12 rebelion kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Aug 6 10:06:12 > > > rebelion kernel: da0: Removable Direct Access SCSI-0 device > > > Aug 6 10:06:12 rebelion kernel: da0: 40.000MB/s transfers > > > Aug 6 10:06:12 rebelion kernel: da0: Attempt to query device size failed: UNIT ATTENTION, Medium not present > > > > Here is another example: > > > > Aug 5 14:48:59 niobe kernel: umass0: on uhub3 > > Aug 5 14:48:59 niobe root: Unknown USB device: vendor 0x0951 product 0x1603 bus uhub3 > > Aug 5 14:48:59 niobe kernel: da1 at umass-sim0 bus 0 target 0 lun 0 > > Aug 5 14:48:59 niobe kernel: da1: Removable Direct Access SCSI-2 device > > Aug 5 14:48:59 niobe kernel: da1: 40.000MB/s transfers > > Aug 5 14:48:59 niobe kernel: da1: 1905MB (3902464 512 byte sectors: 255H 63S/T 242C) > > Aug 5 14:49:25 niobe kernel: umass0: BBB reset failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-in clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-out clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB reset failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-in clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-out clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB reset failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-in clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-out clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB reset failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-in clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-out clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB reset failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-in clear stall failed, IOERROR > > Aug 5 14:49:25 niobe kernel: umass0: BBB bulk-out clear stall failed, IOERROR > > Aug 5 14:55:57 niobe kernel: umass0: at uhub3 port 5 (addr 2) disconnected > > Aug 5 14:55:57 niobe kernel: (da1:umass-sim0:0:0:0): lost device > > Aug 5 14:55:57 niobe kernel: (da1:umass-sim0:0:0:0): removing device entry > > Aug 5 14:55:57 niobe kernel: umass0: detached > > > > Needless to say, this stick works perfectly OK under Windows and Linux. > > I have the 4GB model of this USB stick/drive. I'll give it a try on my > FreeBSD RELENG_7 box when I get home in about an hour. > > If I can reproduce the issue, I will be more than happy to send it to > someone who wants to debug it (and they can keep it as my way of saying > thanks). As promised, when I got home I inserted the Kingston I have. I should note this disk was formatted as FAT32 on a Windows machine, and was also made bootable via a Windows utility made by Hewlett Packard. This is what I got upon inserting the device: umass0: on uhub4 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-2 device da0: 40.000MB/s transfers da0: 3836MB (7856128 512 byte sectors: 255H 63S/T 489C) GEOM_LABEL: Label for provider da0s1 is msdosfs/KINGSTON. icarus# camcontrol devlist at scbus0 target 0 lun 0 (da0,pass0) icarus# camcontrol inquiry da0 pass0: Removable Direct Access SCSI-2 device pass0: Serial Number 40.000MB/s transfers icarus# mount_msdosfs /dev/da0s1 /mnt icarus# df -k /mnt Filesystem 1024-blocks Used Avail Capacity Mounted on /dev/da0s1 3920364 12 3920352 0% /mnt This looks correct (there is no data on the FAT32 filesystem). icarus# umount /mnt icarus# I then removed the stick, and got this: umass0: at uhub4 port 6 (addr 2) disconnected (da0:umass-sim0:0:0:0): lost deviceGEOM_LABEL (da0:umass-sim0:0:: 0:Label 0): msdosfs/KINGSTON removeremoving device entryd. umass0: detached Kernel messages are being printed atop one another is a known bug (it really needs to get fixed already, since increasing PRINTF_BUFR_SIZE to 256 only makes the problem slightly better), but as you can see, it worked fine. I'm thinking this may boil down to a problem with udbp(4) getting in the way, since it's responsible for the bulk (BBB) stuff. I yank udbp(4) out of my kernel because I don't see the point in including support for something I'll never use. (And are "bulk pipes" even part of the USB standard? I don't remember reading about them as part of the USB 1.0 specification, but that was a long time ago.) Here's the relevant portion of my kernel configuration: # SCSI peripherals device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct SCSI access) device ses # SCSI Environmental Services (and SAF-TE) # USB support device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices device ugen # Generic device uhid # "Human Interface Devices" device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da device ums # Mouse I can provide full dmesg output if need be. Chipset is an Intel ICH7. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |