On Tue, 26 Aug 2003, Uberto Barbini wrote:

> >> I'm a bit tired of blind suggestions, so I'll be grateful if someone gives
> >> me any hint on how usb-storage is supposed to work and I'm glad to do some
> >> debug on c code if necessary.
> 
> BU> Trying configuring usb-storage debugging on, and post a copy of the 
> BU> debugging messages that appear in your system log when you plug in your 
> BU> usb-key.
> 
> Thanks, I append my logs with usbkey and CF reader.
> 
> Note also that I'm having acpi problems with test4 and my rhine net
> card (you can see the interupt conflicts) but CF still works and
> usbkey still don't.

The log you attached doesn't contain any debugging information.  Probably 
you have your /etc/syslog.conf set up only to accept kernel messages with 
higher priority.

Judging from what is in there, my guess is that your usb-key doesn't like 
the MODE_SENSE command to read the cache page.  Try applying the patch 
below and see if it helps.

If it doesn't, change syslog.conf to accept _all_ kernel messages and post 
the resulting kernel log.

Alan Stern


===== sd.c 1.52 vs edited =====
--- 1.52/drivers/scsi/sd.c      Tue Jul  1 17:54:19 2003
+++ edited/drivers/scsi/sd.c    Thu Jul 31 11:05:01 2003
@@ -1080,6 +1080,7 @@
 sd_read_write_protect_flag(struct scsi_disk *sdkp, char *diskname,
                   struct scsi_request *SRpnt, unsigned char *buffer) {
        int res;
+       const int dbd = 0;         /* Some devices don't like DBD */
        struct scsi_mode_data data;
 
        /*
@@ -1087,7 +1088,7 @@
         * We have to start carefully: some devices hang if we ask
         * for more than is available.
         */
-       res = sd_do_mode_sense(SRpnt, 0, 0x3F, buffer, 4, &data);
+       res = sd_do_mode_sense(SRpnt, dbd, 0x3F, buffer, 4, &data);
 
        /*
         * Second attempt: ask for page 0
@@ -1095,13 +1096,13 @@
         * Sense Key 5: Illegal Request, Sense Code 24: Invalid field in CDB.
         */
        if (!scsi_status_is_good(res))
-               res = sd_do_mode_sense(SRpnt, 0, 0, buffer, 4, &data);
+               res = sd_do_mode_sense(SRpnt, dbd, 0, buffer, 4, &data);
 
        /*
         * Third attempt: ask 255 bytes, as we did earlier.
         */
        if (!scsi_status_is_good(res))
-               res = sd_do_mode_sense(SRpnt, 0, 0x3F, buffer, 255, &data);
+               res = sd_do_mode_sense(SRpnt, dbd, 0x3F, buffer, 255, &data);
 
        if (!scsi_status_is_good(res)) {
                printk(KERN_WARNING
@@ -1124,7 +1125,7 @@
                   struct scsi_request *SRpnt, unsigned char *buffer) {
        int len = 0, res;
 
-       const int dbd = 0;         /* DBD */
+       const int dbd = 0;         /* Some devices don't like DBD */
        const int modepage = 0x08; /* current values, cache page */
        struct scsi_mode_data data;
 
@@ -1134,10 +1135,11 @@
 
        if (scsi_status_is_good(res)) {
                /* that went OK, now ask for the proper length */
-               len = data.length;
-               if (len > 128)
-                       len = 128;
-               res = sd_do_mode_sense(SRpnt, dbd, modepage, buffer,
+               len = data.header_length + data.block_descriptor_length + 4;
+               if (len > 512)
+                       res = SAM_STAT_BUSY;
+               else
+                       res = sd_do_mode_sense(SRpnt, dbd, modepage, buffer,
                                       len, &data);
        }
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to