|
@@ -63,7 +63,6 @@ extern struct megasas_cmd *megasas_get_cmd(struct megasas_instance
|
|
|
extern void
|
|
|
megasas_complete_cmd(struct megasas_instance *instance,
|
|
|
struct megasas_cmd *cmd, u8 alt_status);
|
|
|
-int megasas_is_ldio(struct scsi_cmnd *cmd);
|
|
|
int
|
|
|
wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
|
|
|
int seconds);
|
|
@@ -196,6 +195,7 @@ inline void megasas_return_cmd_fusion(struct megasas_instance *instance,
|
|
|
|
|
|
cmd->scmd = NULL;
|
|
|
cmd->sync_cmd_idx = (u32)ULONG_MAX;
|
|
|
+ memset(cmd->io_request, 0, sizeof(struct MPI2_RAID_SCSI_IO_REQUEST));
|
|
|
list_add(&cmd->list, (&fusion->cmd_pool)->next);
|
|
|
|
|
|
spin_unlock_irqrestore(&fusion->mpt_pool_lock, flags);
|
|
@@ -689,6 +689,8 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
|
|
|
= 1;
|
|
|
init_frame->driver_operations.mfi_capabilities.support_ndrive_r1_lb
|
|
|
= 1;
|
|
|
+ init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw
|
|
|
+ = 1;
|
|
|
/* Convert capability to LE32 */
|
|
|
cpu_to_le32s((u32 *)&init_frame->driver_operations.mfi_capabilities);
|
|
|
|
|
@@ -1284,6 +1286,7 @@ megasas_make_sgl_fusion(struct megasas_instance *instance,
|
|
|
|
|
|
sgl_ptr =
|
|
|
(struct MPI25_IEEE_SGE_CHAIN64 *)cmd->sg_frame;
|
|
|
+ memset(sgl_ptr, 0, MEGASAS_MAX_SZ_CHAIN_FRAME);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1657,6 +1660,8 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
|
|
|
u32 device_id;
|
|
|
struct MPI2_RAID_SCSI_IO_REQUEST *io_request;
|
|
|
u16 pd_index = 0;
|
|
|
+ u16 os_timeout_value;
|
|
|
+ u16 timeout_limit;
|
|
|
struct MR_DRV_RAID_MAP_ALL *local_map_ptr;
|
|
|
struct fusion_context *fusion = instance->ctrl_context;
|
|
|
u8 span, physArm;
|
|
@@ -1673,44 +1678,48 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
|
|
|
|
|
|
io_request->DataLength = cpu_to_le32(scsi_bufflen(scmd));
|
|
|
|
|
|
-
|
|
|
- /* Check if this is a system PD I/O */
|
|
|
if (scmd->device->channel < MEGASAS_MAX_PD_CHANNELS &&
|
|
|
instance->pd_list[pd_index].driveState == MR_PD_STATE_SYSTEM) {
|
|
|
- io_request->Function = 0;
|
|
|
if (fusion->fast_path_io)
|
|
|
io_request->DevHandle =
|
|
|
local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
|
|
|
- io_request->RaidContext.timeoutValue =
|
|
|
- local_map_ptr->raidMap.fpPdIoTimeoutSec;
|
|
|
- io_request->RaidContext.regLockFlags = 0;
|
|
|
- io_request->RaidContext.regLockRowLBA = 0;
|
|
|
- io_request->RaidContext.regLockLength = 0;
|
|
|
io_request->RaidContext.RAIDFlags =
|
|
|
- MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD <<
|
|
|
- MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT;
|
|
|
- if ((instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
|
|
|
- (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY))
|
|
|
- io_request->IoFlags |= cpu_to_le16(
|
|
|
- MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH);
|
|
|
- cmd->request_desc->SCSIIO.RequestFlags =
|
|
|
- (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY <<
|
|
|
- MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
|
|
|
- cmd->request_desc->SCSIIO.DevHandle =
|
|
|
- local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
|
|
|
+ MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD
|
|
|
+ << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT;
|
|
|
+ cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle;
|
|
|
cmd->request_desc->SCSIIO.MSIxIndex =
|
|
|
instance->msix_vectors ? smp_processor_id() % instance->msix_vectors : 0;
|
|
|
- /*
|
|
|
- * If the command is for the tape device, set the
|
|
|
- * FP timeout to the os layer timeout value.
|
|
|
- */
|
|
|
- if (scmd->device->type == TYPE_TAPE) {
|
|
|
- if ((scmd->request->timeout / HZ) > 0xFFFF)
|
|
|
- io_request->RaidContext.timeoutValue =
|
|
|
- 0xFFFF;
|
|
|
- else
|
|
|
- io_request->RaidContext.timeoutValue =
|
|
|
- scmd->request->timeout / HZ;
|
|
|
+ os_timeout_value = scmd->request->timeout / HZ;
|
|
|
+
|
|
|
+ if (instance->secure_jbod_support &&
|
|
|
+ (megasas_cmd_type(scmd) == NON_READ_WRITE_SYSPDIO)) {
|
|
|
+ /* system pd firmware path */
|
|
|
+ io_request->Function =
|
|
|
+ MEGASAS_MPI2_FUNCTION_LD_IO_REQUEST;
|
|
|
+ cmd->request_desc->SCSIIO.RequestFlags =
|
|
|
+ (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO <<
|
|
|
+ MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
|
|
|
+ io_request->RaidContext.timeoutValue =
|
|
|
+ cpu_to_le16(os_timeout_value);
|
|
|
+ } else {
|
|
|
+ /* system pd Fast Path */
|
|
|
+ io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST;
|
|
|
+ io_request->RaidContext.regLockFlags = 0;
|
|
|
+ io_request->RaidContext.regLockRowLBA = 0;
|
|
|
+ io_request->RaidContext.regLockLength = 0;
|
|
|
+ timeout_limit = (scmd->device->type == TYPE_DISK) ?
|
|
|
+ 255 : 0xFFFF;
|
|
|
+ io_request->RaidContext.timeoutValue =
|
|
|
+ cpu_to_le16((os_timeout_value > timeout_limit) ?
|
|
|
+ timeout_limit : os_timeout_value);
|
|
|
+ if ((instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
|
|
|
+ (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY))
|
|
|
+ io_request->IoFlags |=
|
|
|
+ cpu_to_le16(MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH);
|
|
|
+
|
|
|
+ cmd->request_desc->SCSIIO.RequestFlags =
|
|
|
+ (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY <<
|
|
|
+ MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
|
|
|
}
|
|
|
} else {
|
|
|
if (scmd->device->channel < MEGASAS_MAX_PD_CHANNELS)
|
|
@@ -1810,7 +1819,7 @@ megasas_build_io_fusion(struct megasas_instance *instance,
|
|
|
*/
|
|
|
io_request->IoFlags = cpu_to_le16(scp->cmd_len);
|
|
|
|
|
|
- if (megasas_is_ldio(scp))
|
|
|
+ if (megasas_cmd_type(scp) == READ_WRITE_LDIO)
|
|
|
megasas_build_ldio_fusion(instance, scp, cmd);
|
|
|
else
|
|
|
megasas_build_dcdb_fusion(instance, scp, cmd);
|