ignatenkobrain / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
24d93b
From cf10a0af2c72e9972fa436aa6c2420a00ac69e46 Mon Sep 17 00:00:00 2001
24d93b
From: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
24d93b
Date: Wed, 26 Oct 2016 13:34:39 +0530
24d93b
Subject: [PATCH 08/11] scsi: mpt3sas: set EEDP-escape-flags for SAS35 devices.
24d93b
24d93b
An UNMAP command on a PI formatted device will leave the Logical Block
24d93b
Application Tag and Logical Block Reference Tag as all F's (for those LBAs
24d93b
that are unmapped). To avoid IO errors if those LBAs are subsequently read
24d93b
before they are written with valid tag fields, the MPI SCSI IO requests
24d93b
need to set the EEDPFlags element EEDP Escape Mode field, Bits [7:6]
24d93b
appropriately. A value of 2 should be set to disable all PI checks if the
24d93b
Logical Block Application Tag is 0xFFFF for PI types 1 and 2.  A value
24d93b
of 3 should be set to disable all PI checks if the Logical Block
24d93b
Application Tag is 0xFFFF and the Logical Block Reference Tag is
24d93b
0xFFFFFFFF for PI type 3.
24d93b
24d93b
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
24d93b
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
24d93b
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
24d93b
Reviewed-by: Hannes Reinecke <hare@suse.com>
24d93b
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
24d93b
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
24d93b
---
24d93b
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +++
24d93b
 1 file changed, 3 insertions(+)
24d93b
24d93b
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
24d93b
index 980c69d..0ff2ed3 100644
24d93b
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
24d93b
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
24d93b
@@ -4040,6 +4040,9 @@ _scsih_setup_eedp(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
24d93b
 
24d93b
 	mpi_request_3v->EEDPBlockSize =
24d93b
 	    cpu_to_le16(scmd->device->sector_size);
24d93b
+
24d93b
+	if (ioc->is_gen35_ioc)
24d93b
+		eedp_flags |= MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE;
24d93b
 	mpi_request->EEDPFlags = cpu_to_le16(eedp_flags);
24d93b
 }
24d93b
 
24d93b
-- 
24d93b
1.8.3.1
24d93b