From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@hansenpartnership.com,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Nagalakshmi.Nandigama@lsi.com, Eric.Moore@lsi.com
Subject: [PATCH 4/5] mpt2sas: Return the correct sense key for DIF errors
Date: Tue, 28 Aug 2012 14:29:36 -0400 [thread overview]
Message-ID: <1346178577-28628-4-git-send-email-martin.petersen@oracle.com> (raw)
In-Reply-To: <1346178577-28628-1-git-send-email-martin.petersen@oracle.com>
From: "Martin K. Petersen" <martin.petersen@oracle.com>
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>
Cc: Nagalakshmi.Nandigama@lsi.com
Cc: Eric.Moore@lsi.com
---
drivers/scsi/mpt2sas/mpt2sas_scsih.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 7d774c5..bfda0ec 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3772,8 +3772,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:
@@ -3790,16 +3788,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;
}
--
1.7.7.6
next prev parent reply other threads:[~2012-08-28 18:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-28 18:29 [PATCH 1/5] sd: Avoid remapping bad reference tags Martin K. Petersen
2012-08-28 18:29 ` [PATCH 2/5] sd: Allow protection_type to be overridden Martin K. Petersen
2012-08-28 18:29 ` [PATCH 3/5] scsi: Disable DIF on Hitachi Ultrastar 15K300 Martin K. Petersen
2012-08-28 18:29 ` Martin K. Petersen [this message]
2012-08-29 10:25 ` [PATCH 4/5] mpt2sas: Return the correct sense key for DIF errors Reddy, Sreekanth
2012-08-28 18:29 ` [PATCH 5/5] mpt2sas: Add a module parameter that permits overriding protection capabilities Martin K. Petersen
2012-08-29 10:13 ` Reddy, Sreekanth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346178577-28628-4-git-send-email-martin.petersen@oracle.com \
--to=martin.petersen@oracle.com \
--cc=Eric.Moore@lsi.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=Nagalakshmi.Nandigama@lsi.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).