From: "Ewan D. Milne" <emi...@redhat.com>

If a device does not report a unit attention as expected,
clear the expecting_cc_ua flag so that we will not suppress
a future unit attention condition that is *not* expected.
INQUIRY and REPORT LUNS commands should not do this, however,
because they do not report pending unit attention conditions.

Signed-off-by: Ewan D. Milne <emi...@redhat.com>
---
 drivers/scsi/scsi_error.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index d0f71e5..96707a6 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1540,6 +1540,13 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
                 */
                return ADD_TO_MLQUEUE;
        case GOOD:
+               /*
+                * Reset expecting_cc_ua for all commands except INQUIRY and
+                * REPORT LUNS, because if we didn't get a UA on this command
+                * as expected, then we don't want to suppress a subsequent one.
+                */
+               if (scmd->cmnd[0] != INQUIRY && scmd->cmnd[0] != REPORT_LUNS)
+                       scmd->device->expecting_cc_ua = 0;
                scsi_handle_queue_ramp_up(scmd->device);
        case COMMAND_TERMINATED:
                return SUCCESS;
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to