Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Aug 2008 07:15:17 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Michel Talon <michel@lpthe.jussieu.fr>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: USB key && kernel: da0: ...
Message-ID:  <20080807141517.GA32272@eos.sc1.parodius.com>
In-Reply-To: <20080807125045.GA29669@eos.sc1.parodius.com>
References:  <20080807120122.GA15142@lpthe.jussieu.fr> <20080807125045.GA29669@eos.sc1.parodius.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <Verbatim Store'n'go, class 0/0, rev 2.00/2.00, addr 2> 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: <VBTM Store'n'go 6.51> 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: <KINGSTON DataTraveler 2.0, class 0/0, rev 2.00/2.00, addr 2> 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: <KINGSTON DataTraveler 2.0 1.00> 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: <Kingston DataTraveler 2.0, class 0/0, rev 2.00/2.00, addr 2> on uhub4
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Kingston DataTraveler 2.0 1.00> 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
<Kingston DataTraveler 2.0 1.00>   at scbus0 target 0 lun 0 (da0,pass0)

icarus# camcontrol inquiry da0
pass0: <Kingston DataTraveler 2.0 1.00> 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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080807141517.GA32272>