linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 1/3] mpt2sas: Return the correct sense key for DIF errors
Date: Mon, 20 Feb 2012 20:36:22 -0500	[thread overview]
Message-ID: <1329788184-6477-2-git-send-email-martin.petersen@oracle.com> (raw)
In-Reply-To: <1329788184-6477-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 d953a57..9085d3e 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3736,8 +3736,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:
@@ -3754,16 +3752,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.8.3.21.gab8a7


  reply	other threads:[~2012-02-21  1:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21  1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
2012-02-21  1:36 ` Martin K. Petersen [this message]
2012-02-21  1:36 ` [PATCH 2/3] mpt2sas: Add a module parameter that permits overriding protection capabilities Martin K. Petersen
2012-02-21  1:36 ` [PATCH 3/3] mpt2sas: Do not check DIF for unwritten blocks Martin K. Petersen
2012-08-09  8:14 ` [SCSI] mpt2sas T10 DIF fixes Ankit Jain
2012-08-17 16:00   ` Martin K. Petersen
2012-08-19 14:49     ` Pasi Kärkkäinen
2012-08-19 15:18       ` Martin K. Petersen
2012-08-19 15:30         ` Pasi Kärkkäinen
2012-08-19 16:38           ` Martin K. Petersen
2012-08-19 20:19             ` Pasi Kärkkäinen
2012-08-20 10:48             ` Pasi Kärkkäinen
2012-08-20 11:06               ` Pasi Kärkkäinen
2012-08-21  0:43                 ` Martin K. Petersen
2012-08-21  6:13                   ` Pasi Kärkkäinen
2012-08-21  0:40               ` Martin K. Petersen
2012-08-21  6:12                 ` Pasi Kärkkäinen
2012-08-21 15:50                 ` Jiang, Dave
2012-08-22 18:36                   ` Martin K. Petersen
2012-10-01  9:17     ` Pasi Kärkkäinen
2012-10-02 22:24       ` Martin K. Petersen

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=1329788184-6477-2-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).