diff mbox series

mpt3sas: Disable DIF when prot_mask set to zero

Message ID 1588065902-2726-1-git-send-email-sreekanth.reddy@broadcom.com (mailing list archive)
State Mainlined
Commit e869f8ea6a643103faad8949ae7153cab6bfa702
Headers show
Series mpt3sas: Disable DIF when prot_mask set to zero | expand

Commit Message

Sreekanth Reddy April 28, 2020, 9:25 a.m. UTC
By default DIF Type1, DIF Type2 & DIF Type3 will be enabled.
Also users can enable either DIF Type 1 or DIF Type2 or DIF Type3
or in any combination using the prot_mask module parameter.

But when the user provides the prot_mask module parameter
value as zero then the driverĀ is not disabling the DIF,
instead it enables all three typesof DIF's.

So modified the driver to disable the DIF support if the user
provides the prot_mask module parameter value as zero.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin K. Petersen May 8, 2020, 2:54 a.m. UTC | #1
On Tue, 28 Apr 2020 05:25:02 -0400, Sreekanth Reddy wrote:

> By default DIF Type1, DIF Type2 & DIF Type3 will be enabled.
> Also users can enable either DIF Type 1 or DIF Type2 or DIF Type3
> or in any combination using the prot_mask module parameter.
> 
> But when the user provides the prot_mask module parameter
> value as zero then the driverĀ is not disabling the DIF,
> instead it enables all three typesof DIF's.
> 
> [...]

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: mpt3sas: Disable DIF when prot_mask set to zero
      https://git.kernel.org/mkp/scsi/c/e869f8ea6a64
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 04a40af..2757bdb 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -10763,8 +10763,8 @@  static void pcie_device_make_active(struct MPT3SAS_ADAPTER *ioc,
 		}
 	}
 	/* 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