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]

 



All,

> > Can you try adding delays before, after, and inbetween the calls to 
> > sd_read_capacity, sd_read_write_protect_flag, and 
> sd_read_cache_type, 
> > all near the end of sd_revalidate_disk?
> 
> Yes, will do this and post results.

OK, it turns out that for this particular key, a two second pause after
"sd_spinup_disk" is called and before "sd_read_capacity" will make it work.
The 'dmesg' (or syslog) output is still ugly, however; but once I realised
that it was "sd_spinup_disk" that:

A) needed the delay, and 
B) causes the first ugly message to be printed in the first place, then a
better patch came to mind.

So, after combining Alan's suggestion to use "msleep" rather than my
previous convoluted method, and moving the location of the pause to inside
sd_spinup_disk (and targeting it to remove the first "ugly"), I came up with
a better patch, which is attached.

This patch adds the module parameter 'firmware_delay', and will cause a
pause for "firmware_delay" seconds inside sd_spinup_disk when the first SCSI
command returns UNIT_ATTENTION as the sense key.

Again, I have deliberately made the default value for this parameter 0,
which means that the end-user will need to ensure insmod or modprobe
supplies a >0 value to firmware_delay before the patch takes effect.

I'm not sure what the procedure is for getting this patch officially
recognised for inclusion into the kernel - Alan, are you able to "sponsor"
this patch for inclusion?

Thanks,

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-v2.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