]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mpt2sas: Return the correct sense key for DIF errors
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Sep 2011 19:18:28 +0000 (15:18 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Sep 2011 19:18:28 +0000 (15:18 -0400)
Only a target device should return ABORTED COMMAND when a PI error is
discovered. The HBA should always set the sense key to ILLEGAL REQUEST.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt2sas/mpt2sas_scsih.c

index 2727947971f059e24322f9c96ce2dfa12a19ef9a..87be63cda58f1e049325bd8257ec862f90f79139 100644 (file)
@@ -3543,8 +3543,6 @@ static void
 _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
 {
        u8 ascq;
-       u8 sk;
-       u8 host_byte;
 
        switch (ioc_status) {
        case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
@@ -3561,16 +3559,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
                break;
        }
 
-       if (scmd->sc_data_direction == DMA_TO_DEVICE) {
-               sk = ILLEGAL_REQUEST;
-               host_byte = DID_ABORT;
-       } else {
-               sk = ABORTED_COMMAND;
-               host_byte = DID_OK;
-       }
-
-       scsi_build_sense_buffer(0, scmd->sense_buffer, sk, 0x10, ascq);
-       scmd->result = DRIVER_SENSE << 24 | (host_byte << 16) |
+       scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq);
+       scmd->result = DRIVER_SENSE << 24 | (DID_ABORT << 16) |
            SAM_STAT_CHECK_CONDITION;
 }