Merge branch 'next/fixes' of git://git.linaro.org/people/arnd/arm-soc
[deliverable/linux.git] / drivers / scsi / scsi_error.c
index a4b9cdbaaa0b99d321a37e2fa1db8bf4063e2c86..dc6131e6a1ba2d40fe32504f1cb0e0f8d8b41def 100644 (file)
@@ -293,8 +293,16 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
                 * so that we can deal with it there.
                 */
                if (scmd->device->expecting_cc_ua) {
-                       scmd->device->expecting_cc_ua = 0;
-                       return NEEDS_RETRY;
+                       /*
+                        * Because some device does not queue unit
+                        * attentions correctly, we carefully check
+                        * additional sense code and qualifier so as
+                        * not to squash media change unit attention.
+                        */
+                       if (sshdr.asc != 0x28 || sshdr.ascq != 0x00) {
+                               scmd->device->expecting_cc_ua = 0;
+                               return NEEDS_RETRY;
+                       }
                }
                /*
                 * if the device is in the process of becoming ready, we
This page took 0.02706 seconds and 5 git commands to generate.