From owner-freebsd-stable@FreeBSD.ORG Sun Sep 3 19:30:38 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDC5216A500 for ; Sun, 3 Sep 2006 19:30:38 +0000 (UTC) (envelope-from oberman@es.net) Received: from postal3.es.net (postal3.es.net [198.128.3.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88EF643D53 for ; Sun, 3 Sep 2006 19:30:38 +0000 (GMT) (envelope-from oberman@es.net) Received: from ptavv.es.net (ptavv.es.net [198.128.4.29]) by postal3.es.net (Postal Node 3) with ESMTP (SSL) id HCH09509; Sun, 03 Sep 2006 12:30:09 -0700 Received: from ptavv.es.net (localhost [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id BD4DB45042; Sun, 3 Sep 2006 12:30:08 -0700 (PDT) To: Michael Abbott In-Reply-To: Your message of "Sun, 03 Sep 2006 15:29:06 -0000." <20060903145054.M39827@saturn.araneidae.co.uk> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1157311808_55298P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Sun, 03 Sep 2006 12:30:08 -0700 From: "Kevin Oberman" Message-Id: <20060903193008.BD4DB45042@ptavv.es.net> Cc: freebsd-stable@freebsd.org Subject: Re: FreeBSD bemused by USB card reader X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Sep 2006 19:30:38 -0000 --==_Exmh_1157311808_55298P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > Date: Sun, 3 Sep 2006 15:29:06 +0000 (GMT) > From: Michael Abbott > Sender: owner-freebsd-stable@freebsd.org > > This message is in MIME format. The first part should be readable text, > while the remaining parts are likely unreadable without MIME-aware tools. > > --0-817021360-1157297346=:39827 > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > I was playing with a USB card reader and FreeBSD, and I've discovered some > quirks that I imagine need attention. The driver involved is umass(4). > > The card reader itself has four slots in which various formats of flash > card can be inserted, and is a USB device. The quirks are as follows: > > 1. If the card reader is plugged in to the USB with no cards inserted, > the result is a storm of messages, one for each of the four slots, saying > in effect "Medium not present; Unretryable error". Ok, kindof, but given > how hard it tries (more than 80 lines of dmesg output are generated!), I > think BSD is missing the point (ie, the media may come later...). > > 2. Device entry points da0, da1, da2 and da3 are created in /dev without > any slice or partition subdevices (can somebody please point me to > documentation which explains when and why I get da0s1 or da0a or da0s1a: > I'd really like to know at the block device level what's going on there). > > 3. When I insert a card into the card reader: no messages are generated, > and no new devices are generated (so I have to mount the device as da0, > and can't mount any slices or partitions). > Of course, there is a workaround here: plugging the card into the card > reader *before* plugging it into the USB port works, but FreeBSD is > underperforming here. For example, OSX has no problem in recognising a > card being inserted or removed. > Similarly, removing a card from the reader is also not noticed. > > I've tried `camcontrol rescan 0` (or all), as suggested in umass(4), but > it doesn't change the devices present in /dev, so is clearly *not* > recognising insertion or removal of cards. > > I don't know if this is an issue or not, but `usbdevs` never shows the > cards, only the card reader. > > 4. This one is quite interesting: if I reboot with the card reader > installed with a card in one slot (I was trying to boot off the card; no > luck) and then remove it: it fails to remove da1, da2 and da3 from /dev. > When I re-insert the card reader... I get two copies of da1! Look: > # ls /dev/da1* > /dev/da1 /dev/da1 > Looks well dodgy to me. > Ok, tried again (with the card removed), and this time I get two > copies of da2 and da3 also: > # ls /dev/da* > /dev/da0 /dev/da1 /dev/da1 /dev/da2 /dev/da2 /dev/da3 /dev/da3 > How very very strange. Strange, yes. Surprising, no. umass (and USB support is not in the best of shape in FreeBSD. But there is hope. A re-written USB driver set is currently in development. It's not even in -current, but the word from a limited number of testers is that it's a BIG improvement. (Giant free!) On the down side, umass is not one of the drivers that has been re-written last I checked. It is by far the most heavily utilized of the remaining drivers, but is also one of the more complex because of the huge number of different devices it must work with. I suspect that little work will be done on fixing the existing driver unless someone spots an easy bug to fix. (One or two of your problems MAY fit that category, but I am not familiar enough with the driver to really have an opinion worth listening to. I suspect that the new drivers are still a month or two from hitting -current and I don't know if they will be such that they can be merged into 6-stable or not. (If they require API or ABI changes, they can't go into V6.) If you want to follow this more closely (and maybe get some of your concerns addressed), you might try subscribing to the freebsd-usb list and sending details there and sending in a PR on what you've seen. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634 Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751 --==_Exmh_1157311808_55298P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) Comment: Exmh version 2.5 06/03/2002 iD8DBQFE+y1Akn3rs5h7N1ERAgoHAKCuVqXrLsfOafj47kKzjrr/BEhS5QCfb30M tet3BdjKMbc+1eATgBrNgJo= =oqIu -----END PGP SIGNATURE----- --==_Exmh_1157311808_55298P--