Commit a7faf81d authored by Anand Lodnoor's avatar Anand Lodnoor Committed by Martin K. Petersen

scsi: megaraid_sas: Set no_write_same only for Virtual Disk

Disable WRITE_SAME (no_write_same) for Virtual Disks only.  For System PDs
and EPDs (Enhanced PDs), WRITE_SAME need not be disabled by default.

Link: https://lore.kernel.org/r/1579000882-20246-3-git-send-email-anand.lodnoor@broadcom.comSigned-off-by: default avatarAnand Lodnoor <anand.lodnoor@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 499e7246
...@@ -1887,6 +1887,10 @@ void megasas_set_dynamic_target_properties(struct scsi_device *sdev, ...@@ -1887,6 +1887,10 @@ void megasas_set_dynamic_target_properties(struct scsi_device *sdev,
mr_device_priv_data->is_tm_capable = mr_device_priv_data->is_tm_capable =
raid->capability.tmCapable; raid->capability.tmCapable;
if (!raid->flags.isEPD)
sdev->no_write_same = 1;
} else if (instance->use_seqnum_jbod_fp) { } else if (instance->use_seqnum_jbod_fp) {
pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) + pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
sdev->id; sdev->id;
...@@ -3416,7 +3420,6 @@ static struct scsi_host_template megasas_template = { ...@@ -3416,7 +3420,6 @@ static struct scsi_host_template megasas_template = {
.bios_param = megasas_bios_param, .bios_param = megasas_bios_param,
.change_queue_depth = scsi_change_queue_depth, .change_queue_depth = scsi_change_queue_depth,
.max_segment_size = 0xffffffff, .max_segment_size = 0xffffffff,
.no_write_same = 1,
}; };
/** /**
......
...@@ -864,9 +864,20 @@ struct MR_LD_RAID { ...@@ -864,9 +864,20 @@ struct MR_LD_RAID {
u8 regTypeReqOnRead; u8 regTypeReqOnRead;
__le16 seqNum; __le16 seqNum;
struct { struct {
#ifndef MFI_BIG_ENDIAN
u32 ldSyncRequired:1; u32 ldSyncRequired:1;
u32 reserved:31; u32 regTypeReqOnReadIsValid:1;
u32 isEPD:1;
u32 enableSLDOnAllRWIOs:1;
u32 reserved:28;
#else
u32 reserved:28;
u32 enableSLDOnAllRWIOs:1;
u32 isEPD:1;
u32 regTypeReqOnReadIsValid:1;
u32 ldSyncRequired:1;
#endif
} flags; } flags;
u8 LUN[8]; /* 0x24 8 byte LUN field used for SCSI IO's */ u8 LUN[8]; /* 0x24 8 byte LUN field used for SCSI IO's */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment