Skip to contentSkip to conversation

Unit attention in USB storage

DISCUSSION [email protected] 1 participant 1 message Jun 5, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 5 lines
Quoted 2 lines

[things work better when "Unit Attention: not ready to ready transition" is not regarded as an error]

I suggest trying this with 2.4.5 -- several people report that kernel works much better than previous ones with usb-storage.

The details of the behaviour are a bit different, but the essence is unchanged: with the same .config as the 2.4.3 I reported on, 2.4.5 failed. (With a different one it was successful. It is a matter of timing.) Again adding the patch:

drivers/usb/storage/debug.c Tue Jun 5 05:23:46 2001 renamed from linux-2.4.5/linux/drivers/usb/storage/debug.c Sat Sep 9 01:39:12 2000 +2 -0
diff -r -u ../linux-2.4.5/linux/drivers/usb/storage/debug.c linux/drivers/usb/storage/debug.c
@@ -302,6 +302,8 @@
        case 0x1C00: what="defect list not found"; break;
        case 0x2400: what="invalid field in CDB"; break;
        case 0x2703: what="associated write protect"; break;
+       case 0x2800: what="not ready to ready transtion (media change?)";
+               break;
        case 0x2903: what="bus device reset function occurred"; break;
        case 0x2904: what="device internal reset"; break;
        case 0x2B00: what="copy can't execute since host can't disconnect"; 
drivers/usb/storage/transport.c Tue Jun 5 05:23:13 2001 renamed from linux-2.4.5/linux/drivers/usb/storage/transport.c Wed Apr 18 20:49:12 2001 +9 -0
diff -r -u ../linux-2.4.5/linux/drivers/usb/storage/transport.c linux/drivers/usb/storage/transport.c
@@ -793,6 +793,15 @@
                /* If things are really okay, then let's show that */
                if ((srb->sense_buffer[2] & 0xf) == 0x0)
                        srb->result = GOOD << 1;
+
+               /* A transition from non-ready to ready sounds OK. */
+               if ((srb->sense_buffer[2] & 0xf) == 0x6 /* unit attention */
+                   && srb->sense_buffer[12] == 0x28
+                   && srb->sense_buffer[13] == 0 /* not ready -> ready */) {
+                       srb->result = GOOD << 1;
+                       srb->sense_buffer[0] = 0;
+               }
+
        } else /* if (need_auto_sense) */
                srb->result = GOOD << 1;
 

makes things work.

Andries