Hi,

how does usb-storage remove an unplugged/removed drive from
/proc/scsi/scsi? I tried
http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh
This does not remove the host, it does only clear the values:

smirnow:~ # cat /proc/scsi/scsi 
Attached devices: 
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DNES-309170W     Rev: SAH0
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: TEAC     Model: CD-ROM CD-532S   Rev: 1.0A
  Type:   CD-ROM                           ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM-DTTA Model: -350640          Rev: 0811
  Type:   Direct-Access                    ANSI SCSI revision: 02

smirnow:~ # cat /proc/bus/usb/devices /proc/version 
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=b400
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 11 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0701 Rev= 0.02
S:  Manufacturer=Genesyslogic
S:  Product=USB Mass Storage Device
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  4mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
Linux version 2.4.20-usbtest ([EMAIL PROTECTED]) (gcc version 3.3 (SuSE Linux)) #1 Fri 
Jun 6 17:36:20 UTC 2003

hub.c: new USB device 00:04.2-1, assigned address 11
usb.c: USB device 11 (vend/prod 0x5e3/0x701) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: IBM-DTTA  Model: -350640           Rev: 0811
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0
SCSI device sdb: 12692736 512-byte hdwr sectors (6499 MB)
 sdb: sdb1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 11
USB Mass Storage support registered.

Now, if I remove the disk:

usb.c: USB disconnect on device 00:04.2-1 address 11

smirnow:~ # rescan-scsi-bus.sh -r 1
Scanning for device 1 0 0 0 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 00
      Vendor:          Model:                  Rev:     
      Type:   Direct-Access                    ANSI SCSI revision: 02
0 new device(s) found.               
0 device(s) removed.                 
smirnow:~ # cat /proc/scsi/scsi 
Attached devices: 
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: DNES-309170W     Rev: SAH0
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: TEAC     Model: CD-ROM CD-532S   Rev: 1.0A
  Type:   CD-ROM                           ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor:          Model:                  Rev:     
  Type:   Direct-Access                    ANSI SCSI revision: 02


ieee1394/sbp2 would remove the 'scsi1' entry.
rmmod would be the only option, but that would not work if there is
another usb-storage device connected.
Is this a bug in usb-storage? 
Kernel is 2.4.21-rc7


Gruss Olaf

-- 
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to