scsi: megaraid_sas: Handle sequence JBOD map failure at driver level
Issue: This issue is applicable to scenario when JBOD sequence map is unavailable (memory allocation for JBOD sequence map failed) to driver but feature is supported by firmware. If the driver sends a JBOD IO by not adding 255 (MAX_PHYSICAL_DEVICES - 1) to device ID when underlying firmware supports JBOD sequence map, it will lead to the IO failure. Fix: For JBOD IOs, driver will not use the RAID map to fetch the devhandle if JBOD sequence map is unavailable. Driver will set Devhandle to 0xffff and Target ID to 'device ID + 255 (MAX_PHYSICAL_DEVICES - 1)'. Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
798d44b04f
commit
59db5a931b
|
@ -2398,7 +2398,9 @@ struct megasas_instance {
|
|||
#endif
|
||||
u8 enable_fw_dev_list;
|
||||
bool atomic_desc_support;
|
||||
bool support_seqnum_jbod_fp;
|
||||
};
|
||||
|
||||
struct MR_LD_VF_MAP {
|
||||
u32 size;
|
||||
union MR_LD_REF ref;
|
||||
|
|
|
@ -5103,7 +5103,7 @@ megasas_get_ctrl_info(struct megasas_instance *instance)
|
|||
* in case of Firmware upgrade without system reboot.
|
||||
*/
|
||||
megasas_update_ext_vd_details(instance);
|
||||
instance->use_seqnum_jbod_fp =
|
||||
instance->support_seqnum_jbod_fp =
|
||||
ci->adapterOperations3.useSeqNumJbodFP;
|
||||
instance->support_morethan256jbod =
|
||||
ci->adapter_operations4.support_pd_map_target_id;
|
||||
|
@ -5140,6 +5140,8 @@ megasas_get_ctrl_info(struct megasas_instance *instance)
|
|||
dev_info(&instance->pdev->dev,
|
||||
"FW provided TM TaskAbort/Reset timeout\t: %d secs/%d secs\n",
|
||||
instance->task_abort_tmo, instance->max_reset_tmo);
|
||||
dev_info(&instance->pdev->dev, "JBOD sequence map support\t: %s\n",
|
||||
instance->support_seqnum_jbod_fp ? "Yes" : "No");
|
||||
|
||||
break;
|
||||
|
||||
|
@ -5554,10 +5556,12 @@ megasas_setup_jbod_map(struct megasas_instance *instance)
|
|||
pd_seq_map_sz = sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC) +
|
||||
(sizeof(struct MR_PD_CFG_SEQ) * (MAX_PHYSICAL_DEVICES - 1));
|
||||
|
||||
instance->use_seqnum_jbod_fp =
|
||||
instance->support_seqnum_jbod_fp;
|
||||
if (reset_devices || !fusion ||
|
||||
!instance->ctrl_info_buf->adapterOperations3.useSeqNumJbodFP) {
|
||||
!instance->support_seqnum_jbod_fp) {
|
||||
dev_info(&instance->pdev->dev,
|
||||
"Jbod map is not supported %s %d\n",
|
||||
"JBOD sequence map is disabled %s %d\n",
|
||||
__func__, __LINE__);
|
||||
instance->use_seqnum_jbod_fp = false;
|
||||
return;
|
||||
|
@ -6042,8 +6046,8 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
|||
instance->UnevenSpanSupport ? "yes" : "no");
|
||||
dev_info(&instance->pdev->dev, "firmware crash dump : %s\n",
|
||||
instance->crash_dump_drv_support ? "yes" : "no");
|
||||
dev_info(&instance->pdev->dev, "jbod sync map : %s\n",
|
||||
instance->use_seqnum_jbod_fp ? "yes" : "no");
|
||||
dev_info(&instance->pdev->dev, "JBOD sequence map : %s\n",
|
||||
instance->use_seqnum_jbod_fp ? "enabled" : "disabled");
|
||||
|
||||
instance->max_sectors_per_req = instance->max_num_sge *
|
||||
SGE_BUFFER_SIZE / 512;
|
||||
|
|
|
@ -3083,44 +3083,55 @@ megasas_build_syspd_fusion(struct megasas_instance *instance,
|
|||
<< MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT;
|
||||
|
||||
/* If FW supports PD sequence number */
|
||||
if (instance->use_seqnum_jbod_fp &&
|
||||
instance->pd_list[pd_index].driveType == TYPE_DISK) {
|
||||
/* TgtId must be incremented by 255 as jbod seq number is index
|
||||
* below raid map
|
||||
*/
|
||||
/* More than 256 PD/JBOD support for Ventura */
|
||||
if (instance->support_morethan256jbod)
|
||||
pRAID_Context->virtual_disk_tgt_id =
|
||||
pd_sync->seq[pd_index].pd_target_id;
|
||||
else
|
||||
pRAID_Context->virtual_disk_tgt_id =
|
||||
cpu_to_le16(device_id + (MAX_PHYSICAL_DEVICES - 1));
|
||||
pRAID_Context->config_seq_num = pd_sync->seq[pd_index].seqNum;
|
||||
io_request->DevHandle = pd_sync->seq[pd_index].devHandle;
|
||||
if (instance->adapter_type >= VENTURA_SERIES) {
|
||||
io_request->RaidContext.raid_context_g35.routing_flags |=
|
||||
(1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT);
|
||||
io_request->RaidContext.raid_context_g35.nseg_type |=
|
||||
(1 << RAID_CONTEXT_NSEG_SHIFT);
|
||||
io_request->RaidContext.raid_context_g35.nseg_type |=
|
||||
(MPI2_TYPE_CUDA << RAID_CONTEXT_TYPE_SHIFT);
|
||||
if (instance->support_seqnum_jbod_fp) {
|
||||
if (instance->use_seqnum_jbod_fp &&
|
||||
instance->pd_list[pd_index].driveType == TYPE_DISK) {
|
||||
|
||||
/* More than 256 PD/JBOD support for Ventura */
|
||||
if (instance->support_morethan256jbod)
|
||||
pRAID_Context->virtual_disk_tgt_id =
|
||||
pd_sync->seq[pd_index].pd_target_id;
|
||||
else
|
||||
pRAID_Context->virtual_disk_tgt_id =
|
||||
cpu_to_le16(device_id +
|
||||
(MAX_PHYSICAL_DEVICES - 1));
|
||||
pRAID_Context->config_seq_num =
|
||||
pd_sync->seq[pd_index].seqNum;
|
||||
io_request->DevHandle =
|
||||
pd_sync->seq[pd_index].devHandle;
|
||||
if (instance->adapter_type >= VENTURA_SERIES) {
|
||||
io_request->RaidContext.raid_context_g35.routing_flags |=
|
||||
(1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT);
|
||||
io_request->RaidContext.raid_context_g35.nseg_type |=
|
||||
(1 << RAID_CONTEXT_NSEG_SHIFT);
|
||||
io_request->RaidContext.raid_context_g35.nseg_type |=
|
||||
(MPI2_TYPE_CUDA << RAID_CONTEXT_TYPE_SHIFT);
|
||||
} else {
|
||||
pRAID_Context->type = MPI2_TYPE_CUDA;
|
||||
pRAID_Context->nseg = 0x1;
|
||||
pRAID_Context->reg_lock_flags |=
|
||||
(MR_RL_FLAGS_SEQ_NUM_ENABLE |
|
||||
MR_RL_FLAGS_GRANT_DESTINATION_CUDA);
|
||||
}
|
||||
} else {
|
||||
pRAID_Context->type = MPI2_TYPE_CUDA;
|
||||
pRAID_Context->nseg = 0x1;
|
||||
pRAID_Context->reg_lock_flags |=
|
||||
(MR_RL_FLAGS_SEQ_NUM_ENABLE|MR_RL_FLAGS_GRANT_DESTINATION_CUDA);
|
||||
pRAID_Context->virtual_disk_tgt_id =
|
||||
cpu_to_le16(device_id +
|
||||
(MAX_PHYSICAL_DEVICES - 1));
|
||||
pRAID_Context->config_seq_num = 0;
|
||||
io_request->DevHandle = cpu_to_le16(0xFFFF);
|
||||
}
|
||||
} else if (fusion->fast_path_io) {
|
||||
pRAID_Context->virtual_disk_tgt_id = cpu_to_le16(device_id);
|
||||
pRAID_Context->config_seq_num = 0;
|
||||
local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)];
|
||||
io_request->DevHandle =
|
||||
local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
|
||||
} else {
|
||||
/* Want to send all IO via FW path */
|
||||
pRAID_Context->virtual_disk_tgt_id = cpu_to_le16(device_id);
|
||||
pRAID_Context->config_seq_num = 0;
|
||||
io_request->DevHandle = cpu_to_le16(0xFFFF);
|
||||
|
||||
if (fusion->fast_path_io) {
|
||||
local_map_ptr =
|
||||
fusion->ld_drv_map[(instance->map_id & 1)];
|
||||
io_request->DevHandle =
|
||||
local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
|
||||
} else {
|
||||
io_request->DevHandle = cpu_to_le16(0xFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle;
|
||||
|
|
Loading…
Reference in New Issue