From e869f8ea6a643103faad8949ae7153cab6bfa702 Mon Sep 17 00:00:00 2001 From: Sreekanth Reddy Date: Tue, 28 Apr 2020 05:25:02 -0400 Subject: scsi: mpt3sas: Disable DIF when prot_mask set to zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default DIF Type 1, DIF Type 2 & DIF Type 3 will be enabled. Also, users can enable either DIF Type 1 or DIF Type 2 or DIF Type 3 or in any combination using the prot_mask module parameter. However, when the user provides a prot_mask module parameter value of zero, then the driverĀ is not disabling the DIF. Instead it enables all three types. Modify the driver to disable the DIF support if the user provides a prot_mask module parameter value of zero. Link: https://lore.kernel.org/r/1588065902-2726-1-git-send-email-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 6b84a83f1720..08fc4b381056 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -10764,8 +10764,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) } } /* register EEDP capabilities with SCSI layer */ - if (prot_mask > 0) - scsi_host_set_prot(shost, prot_mask); + if (prot_mask >= 0) + scsi_host_set_prot(shost, (prot_mask & 0x07)); else scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION | SHOST_DIF_TYPE2_PROTECTION -- cgit v1.2.3