RE: [linux-usb-devel] Kernel unable to read partition table on US B Memory Key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan,
 
> Try putting delays at various spots in sd_revalidate_disk: 
> the beginning, the middle, and the end.

OK, the attached patch works for me when sd_mod was loaded with delay_use=1.

Now I'm quite prepared to be told that this is a really horrible and
inapproprate hack (given that I am not a kernel developer, I don't really
know the "correct" way to solve this problem); and I'll cheerfully admit
that it doesn't really solve the problem cleanly as can be seen below:

Jul  6 14:44:50 pc196344 kernel: usb 1-6: new high speed USB device using
ehci_hcd and address 6
Jul  6 14:44:50 pc196344 kernel: Initializing USB Mass Storage driver...
Jul  6 14:44:50 pc196344 kernel: scsi5 : SCSI emulation for USB Mass Storage
devices
Jul  6 14:44:50 pc196344 kernel: usbcore: registered new driver usb-storage
Jul  6 14:44:50 pc196344 kernel: USB Mass Storage support registered.
Jul  6 14:44:50 pc196344 kernel: usb-storage: device found at 6
Jul  6 14:44:50 pc196344 kernel: usb-storage: waiting for device to settle
before scanning
Jul  6 14:44:52 pc196344 kernel:   Vendor: OTi       Model: Flash Disk
Rev: 2.00
Jul  6 14:44:52 pc196344 kernel:   Type:   Direct-Access
ANSI SCSI revision: 02
Jul  6 14:44:52 pc196344 kernel: Attached scsi generic sg1 at scsi5, channel
0, id 0, lun 0,  type 0
Jul  6 14:44:52 pc196344 kernel: usb-storage: device scan complete
Jul  6 14:44:52 pc196344 scsi.agent[27245]: disk at
/devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host5/target5:0:0/5:0:0:0
Jul  6 14:44:52 pc196344 kernel: sd: waiting for device to get ready.
Jul  6 14:44:53 pc196344 kernel: sda: Unit Not Ready, sense:
Jul  6 14:44:53 pc196344 kernel: : Current: sense key: Unit Attention
Jul  6 14:44:53 pc196344 kernel:     Additional sense: Not ready to ready
change, medium may have changed
Jul  6 14:44:53 pc196344 kernel: sda : READ CAPACITY failed.
Jul  6 14:44:53 pc196344 kernel: sda : status=1, message=00, host=0,
driver=08
Jul  6 14:44:53 pc196344 kernel: sd: Current: sense key: Unit Attention
Jul  6 14:44:53 pc196344 kernel:     Additional sense: Not ready to ready
change, medium may have changed
Jul  6 14:44:53 pc196344 kernel: sda: test WP failed, assume Write Enabled
Jul  6 14:44:53 pc196344 kernel: sda: assuming drive cache: write through
Jul  6 14:44:53 pc196344 kernel: sd: waiting for device to get ready.
Jul  6 14:44:54 pc196344 kernel: sda: Unit Not Ready, sense:
Jul  6 14:44:54 pc196344 kernel: : Current: sense key: Unit Attention
Jul  6 14:44:54 pc196344 kernel:     Additional sense: Not ready to ready
change, medium may have changed
Jul  6 14:44:54 pc196344 kernel: sda : READ CAPACITY failed.
Jul  6 14:44:54 pc196344 kernel: sda : status=1, message=00, host=0,
driver=08
Jul  6 14:44:54 pc196344 kernel: sd: Current: sense key: Unit Attention
Jul  6 14:44:54 pc196344 kernel:     Additional sense: Not ready to ready
change, medium may have changed
Jul  6 14:44:54 pc196344 kernel: sda: test WP failed, assume Write Enabled
Jul  6 14:44:54 pc196344 kernel: sda: assuming drive cache: write through
Jul  6 14:44:54 pc196344 kernel: sd: waiting for device to get ready.
Jul  6 14:44:55 pc196344 kernel: SCSI device sda: 255488 512-byte hdwr
sectors (131 MB)
Jul  6 14:44:55 pc196344 kernel: sda: Write Protect is off
Jul  6 14:44:55 pc196344 kernel: sda: Mode Sense: 03 00 00 00
Jul  6 14:44:55 pc196344 kernel: sda: assuming drive cache: write through
Jul  6 14:44:55 pc196344 kernel:  /dev/scsi/host5/bus0/target0/lun0: p1
Jul  6 14:44:55 pc196344 kernel: Attached scsi removable disk sda at scsi5,
channel 0, id 0, lun 0

There are three delays from my patch in the above list, and increasing the
delay to 3 seconds didn't help, as I got three one-second delays.  

However, if someone with the appropriate knowledge could transform my kludge
into a proper fix, then I would be very happy.

Alan, thanks very much for your help - I really appreciate the quick
responses you have given me.

Note that I now have the output from the USB Snoop tool under Windows if
anyone wants it - please ask if needed to help solve the issue "correctly".

James Roberts-Thomson
----------
Hardware:  The parts of a computer system that can be kicked.

Mailing list Readers:  Please ignore the following disclaimer - this email
is explicitly declared to be non confidential and does not contain
privileged information.


This communication is confidential and may contain privileged material.
If you are not the intended recipient you must not use, disclose, copy or retain it.
If you have received it in error please immediately notify me by return email
and delete the emails.
Thank you.

Attachment: oti-usb-key.patch
Description: Binary data


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux