aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_scsih.c
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2012-08-28 14:29:36 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 04:11:00 -0400
commit9b5cd13249af3eb023ee7ba9ff63c16c25488d03 (patch)
tree3fc598ed27cc2dde4e76df26364c32f2407a107a /drivers/scsi/mpt2sas/mpt2sas_scsih.c
parentd974e4265dbd35db118c318176727ecb7f469de3 (diff)
[SCSI] mpt2sas: Return the correct sense key for DIF errors
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> Acked-by: "Sreekanth Reddy" <Sreekanth.reddy@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_scsih.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 7d774c5ffcee..bfda0ecd960d 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3772,8 +3772,6 @@ static void
3772_scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) 3772_scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
3773{ 3773{
3774 u8 ascq; 3774 u8 ascq;
3775 u8 sk;
3776 u8 host_byte;
3777 3775
3778 switch (ioc_status) { 3776 switch (ioc_status) {
3779 case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: 3777 case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
@@ -3790,16 +3788,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
3790 break; 3788 break;
3791 } 3789 }
3792 3790
3793 if (scmd->sc_data_direction == DMA_TO_DEVICE) { 3791 scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq);
3794 sk = ILLEGAL_REQUEST; 3792 scmd->result = DRIVER_SENSE << 24 | (DID_ABORT << 16) |
3795 host_byte = DID_ABORT;
3796 } else {
3797 sk = ABORTED_COMMAND;
3798 host_byte = DID_OK;
3799 }
3800
3801 scsi_build_sense_buffer(0, scmd->sense_buffer, sk, 0x10, ascq);
3802 scmd->result = DRIVER_SENSE << 24 | (host_byte << 16) |
3803 SAM_STAT_CHECK_CONDITION; 3793 SAM_STAT_CHECK_CONDITION;
3804} 3794}
3805 3795