Re: Reattach/redetect allways connected umass device - is it possible ?

From: Vladimir Grebenschikov <vova_at_fbsd.ru>
Date: Wed, 23 Mar 2005 23:33:45 +0300
В ср, 23/03/2005 в 14:11 -0500, John Baldwin пишет:
> On Monday 14 March 2005 06:45 am, Vladimir Grebenschikov wrote:
> > Hi
> >
> > I have SONY notebook with integrated memory stick card reader. It
> > appears as USB umass device and works well.
> >
> > Usbdevs output is here:
> > Controller /dev/usb3:
> > addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
> > Intel(0x0000), rev 1.00, device uhub4 port 1 powered
> >  port 2 powered
> >  port 3 powered
> >  port 4 powered
> >  port 5 addr 2: high speed, self powered, config 1, USB Memory Stick
> > Slot(0x014d), Sony(0x054c), rev 1.10, device umass1 port 6 powered
> >
> > Only problem is that card-reader itself toes not detach USB device on flash
> > removal. So if I change card to another card of different size it is not
> > detected and da0 device still has old geometry.
> >
> > 'camcontrol rescan' does not helps.
> >
> > For previous Sony notebook stick reader was attached to ATA bus and I
> > workaround this problem with atacontrol detach/attach.
> >
> > How to do same with USB-attached umass device, I mean how to rescan this
> > device for physical geometry.
> >
> > I found only solution - kldunload umass && kldload umass, but it is ugly.
> > And can be problem in case when another umass device connected.
> 
> Have you tried doing a 'camcontrol eject da0', swapping out the sticks and 
> then seeing if da0 comes back with new geometry?  Possibly doing a 
> 'camcontrol rescan' to force it to see the new stick?

No, not it does not, it actually prevents memory stick from working.

# camcontrol devlist
<Sony MSC-U04 3.00>                at scbus1 target 0 lun 0 (pass0,da0)
<MATSHITA UJDA755 DVD/CDRW 1.00>   at scbus3 target 0 lun 0 (pass1,cd0)
# camcontrol eject da0
Error received from stop unit command
# camcontrol eject da0
Unit stopped successfully, Media ejected
# mount /m/stick
msdosfs: /dev/da0s1: Device not configured
# camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
Re-scan of bus 2 was successful
Re-scan of bus 3 was successful
# mount /m/stick
msdosfs: /dev/da0s1: No such file or directory
# mount -t msdosfs /dev/da0 /m/stick
msdosfs: /dev/da0: Invalid argument
# dmesg
...
(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): NOT READY asc:3a,0
(da0:umass-sim0:0:0:0): Medium not present
(da0:umass-sim0:0:0:0): Unretryable error
Opened disk da0 -> 6
...

-- 
Vladimir B. Grebenchikov
vova_at_fbsd.ru
Received on Wed Mar 23 2005 - 19:34:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:30 UTC