From: Suganath Prabu Subramani Date: Wed, 26 Oct 2016 08:04:39 +0000 (+0530) Subject: scsi: mpt3sas: set EEDP-escape-flags for SAS35 devices. X-Git-Tag: v4.1.12-93~2^2~73 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bd6b792eb8dfbd2d9a33f8c9f1dd52fbae4d288f;p=users%2Fjedix%2Flinux-maple.git scsi: mpt3sas: set EEDP-escape-flags for SAS35 devices. Orabug: 25639713 An UNMAP command on a PI formatted device will leave the Logical Block Application Tag and Logical Block Reference Tag as all F's (for those LBAs that are unmapped). To avoid IO errors if those LBAs are subsequently read before they are written with valid tag fields, the MPI SCSI IO requests need to set the EEDPFlags element EEDP Escape Mode field, Bits [7:6] appropriately. A value of 2 should be set to disable all PI checks if the Logical Block Application Tag is 0xFFFF for PI types 1 and 2. A value of 3 should be set to disable all PI checks if the Logical Block Application Tag is 0xFFFF and the Logical Block Reference Tag is 0xFFFFFFFF for PI type 3. Signed-off-by: Chaitra P B Signed-off-by: Sathya Prakash Signed-off-by: Suganath Prabu S Reviewed-by: Hannes Reinecke Reviewed-by: Tomas Henzl Signed-off-by: Martin K. Petersen (cherry picked from commit 186a18e51db08d51011fc4bd2aa773e173f632c9) Signed-off-by: Brian Maly --- diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 8c92df6233e6..1b0210c9c32c 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -4005,6 +4005,9 @@ _scsih_setup_eedp(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, mpi_request_3v->EEDPBlockSize = cpu_to_le16(scmd->device->sector_size); + + if (ioc->is_gen35_ioc) + eedp_flags |= MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE; mpi_request->EEDPFlags = cpu_to_le16(eedp_flags); }