Skip to content

Commit 630d42b

Browse files
shivasharan-smartinkpetersen
authored andcommitted
scsi: megaraid_sas: Fix Ventura series based checks
In preparation for the new Aero series adapter type, all the places where we check adapter type for Ventura series needs to include any later adapter types. Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 23c3828 commit 630d42b

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5398,7 +5398,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
53985398

53995399
fusion = instance->ctrl_context;
54005400

5401-
if (instance->adapter_type == VENTURA_SERIES) {
5401+
if (instance->adapter_type >= VENTURA_SERIES) {
54025402
scratch_pad_2 =
54035403
readl(&instance->reg_set->outbound_scratch_pad_2);
54045404
instance->max_raid_mapsize = ((scratch_pad_2 >>
@@ -5521,7 +5521,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
55215521
if (instance->instancet->init_adapter(instance))
55225522
goto fail_init_adapter;
55235523

5524-
if (instance->adapter_type == VENTURA_SERIES) {
5524+
if (instance->adapter_type >= VENTURA_SERIES) {
55255525
scratch_pad_3 =
55265526
readl(&instance->reg_set->outbound_scratch_pad_3);
55275527
if ((scratch_pad_3 & MR_NVME_PAGE_SIZE_MASK) >=
@@ -5557,7 +5557,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
55575557
memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
55585558

55595559
/* stream detection initialization */
5560-
if (instance->adapter_type == VENTURA_SERIES) {
5560+
if (instance->adapter_type >= VENTURA_SERIES) {
55615561
fusion->stream_detect_by_ld =
55625562
kcalloc(MAX_LOGICAL_DRIVES_EXT,
55635563
sizeof(struct LD_STREAM_DETECT *),
@@ -6176,7 +6176,7 @@ megasas_set_dma_mask(struct megasas_instance *instance)
61766176
u32 scratch_pad_1;
61776177

61786178
pdev = instance->pdev;
6179-
consistent_mask = (instance->adapter_type == VENTURA_SERIES) ?
6179+
consistent_mask = (instance->adapter_type >= VENTURA_SERIES) ?
61806180
DMA_BIT_MASK(64) : DMA_BIT_MASK(32);
61816181

61826182
if (IS_DMA64) {
@@ -7130,7 +7130,7 @@ static void megasas_detach_one(struct pci_dev *pdev)
71307130
if (instance->msix_vectors)
71317131
pci_free_irq_vectors(instance->pdev);
71327132

7133-
if (instance->adapter_type == VENTURA_SERIES) {
7133+
if (instance->adapter_type >= VENTURA_SERIES) {
71347134
for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i)
71357135
kfree(fusion->stream_detect_by_ld[i]);
71367136
kfree(fusion->stream_detect_by_ld);

drivers/scsi/megaraid/megaraid_sas_fp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,
743743
*pDevHandle = MR_PdDevHandleGet(pd, map);
744744
*pPdInterface = MR_PdInterfaceTypeGet(pd, map);
745745
/* get second pd also for raid 1/10 fast path writes*/
746-
if ((instance->adapter_type == VENTURA_SERIES) &&
746+
if ((instance->adapter_type >= VENTURA_SERIES) &&
747747
(raid->level == 1) &&
748748
!io_info->isRead) {
749749
r1_alt_pd = MR_ArPdGet(arRef, physArm + 1, map);
@@ -768,7 +768,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,
768768
}
769769

770770
*pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk);
771-
if (instance->adapter_type == VENTURA_SERIES) {
771+
if (instance->adapter_type >= VENTURA_SERIES) {
772772
((struct RAID_CONTEXT_G35 *)pRAID_Context)->span_arm =
773773
(span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm;
774774
io_info->span_arm =
@@ -859,7 +859,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow,
859859
*pDevHandle = MR_PdDevHandleGet(pd, map);
860860
*pPdInterface = MR_PdInterfaceTypeGet(pd, map);
861861
/* get second pd also for raid 1/10 fast path writes*/
862-
if ((instance->adapter_type == VENTURA_SERIES) &&
862+
if ((instance->adapter_type >= VENTURA_SERIES) &&
863863
(raid->level == 1) &&
864864
!io_info->isRead) {
865865
r1_alt_pd = MR_ArPdGet(arRef, physArm + 1, map);
@@ -886,7 +886,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow,
886886
}
887887

888888
*pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk);
889-
if (instance->adapter_type == VENTURA_SERIES) {
889+
if (instance->adapter_type >= VENTURA_SERIES) {
890890
((struct RAID_CONTEXT_G35 *)pRAID_Context)->span_arm =
891891
(span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm;
892892
io_info->span_arm =

drivers/scsi/megaraid/megaraid_sas_fusion.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ void megasas_configure_queue_sizes(struct megasas_instance *instance)
15541554
fusion = instance->ctrl_context;
15551555
max_cmd = instance->max_fw_cmds;
15561556

1557-
if (instance->adapter_type == VENTURA_SERIES)
1557+
if (instance->adapter_type >= VENTURA_SERIES)
15581558
instance->max_mpt_cmds = instance->max_fw_cmds * RAID_1_PEER_CMDS;
15591559
else
15601560
instance->max_mpt_cmds = instance->max_fw_cmds;
@@ -2721,7 +2721,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
27212721
cmd->request_desc->SCSIIO.MSIxIndex =
27222722
instance->reply_map[raw_smp_processor_id()];
27232723

2724-
if (instance->adapter_type == VENTURA_SERIES) {
2724+
if (instance->adapter_type >= VENTURA_SERIES) {
27252725
/* FP for Optimal raid level 1.
27262726
* All large RAID-1 writes (> 32 KiB, both WT and WB modes)
27272727
* are built by the driver as LD I/Os.
@@ -2789,7 +2789,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
27892789
rctx->reg_lock_flags |=
27902790
(MR_RL_FLAGS_GRANT_DESTINATION_CUDA |
27912791
MR_RL_FLAGS_SEQ_NUM_ENABLE);
2792-
} else if (instance->adapter_type == VENTURA_SERIES) {
2792+
} else if (instance->adapter_type >= VENTURA_SERIES) {
27932793
rctx_g35->nseg_type |= (1 << RAID_CONTEXT_NSEG_SHIFT);
27942794
rctx_g35->nseg_type |= (MPI2_TYPE_CUDA << RAID_CONTEXT_TYPE_SHIFT);
27952795
rctx_g35->routing_flags |= (1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT);
@@ -2805,15 +2805,15 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
28052805
&io_info, local_map_ptr);
28062806
scp->SCp.Status |= MEGASAS_LOAD_BALANCE_FLAG;
28072807
cmd->pd_r1_lb = io_info.pd_after_lb;
2808-
if (instance->adapter_type == VENTURA_SERIES)
2808+
if (instance->adapter_type >= VENTURA_SERIES)
28092809
rctx_g35->span_arm = io_info.span_arm;
28102810
else
28112811
rctx->span_arm = io_info.span_arm;
28122812

28132813
} else
28142814
scp->SCp.Status &= ~MEGASAS_LOAD_BALANCE_FLAG;
28152815

2816-
if (instance->adapter_type == VENTURA_SERIES)
2816+
if (instance->adapter_type >= VENTURA_SERIES)
28172817
cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle;
28182818
else
28192819
cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID;
@@ -2847,7 +2847,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
28472847
(MR_RL_FLAGS_GRANT_DESTINATION_CPU0 |
28482848
MR_RL_FLAGS_SEQ_NUM_ENABLE);
28492849
rctx->nseg = 0x1;
2850-
} else if (instance->adapter_type == VENTURA_SERIES) {
2850+
} else if (instance->adapter_type >= VENTURA_SERIES) {
28512851
rctx_g35->routing_flags |= (1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT);
28522852
rctx_g35->nseg_type |= (1 << RAID_CONTEXT_NSEG_SHIFT);
28532853
rctx_g35->nseg_type |= (MPI2_TYPE_CUDA << RAID_CONTEXT_TYPE_SHIFT);
@@ -2919,7 +2919,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance,
29192919

29202920
/* set RAID context values */
29212921
pRAID_Context->config_seq_num = raid->seqNum;
2922-
if (instance->adapter_type != VENTURA_SERIES)
2922+
if (instance->adapter_type < VENTURA_SERIES)
29232923
pRAID_Context->reg_lock_flags = REGION_TYPE_SHARED_READ;
29242924
pRAID_Context->timeout_value =
29252925
cpu_to_le16(raid->fpIoTimeoutForLd);
@@ -3004,7 +3004,7 @@ megasas_build_syspd_fusion(struct megasas_instance *instance,
30043004
cpu_to_le16(device_id + (MAX_PHYSICAL_DEVICES - 1));
30053005
pRAID_Context->config_seq_num = pd_sync->seq[pd_index].seqNum;
30063006
io_request->DevHandle = pd_sync->seq[pd_index].devHandle;
3007-
if (instance->adapter_type == VENTURA_SERIES) {
3007+
if (instance->adapter_type >= VENTURA_SERIES) {
30083008
io_request->RaidContext.raid_context_g35.routing_flags |=
30093009
(1 << MR_RAID_CTX_ROUTINGFLAGS_SQN_SHIFT);
30103010
io_request->RaidContext.raid_context_g35.nseg_type |=
@@ -3137,7 +3137,7 @@ megasas_build_io_fusion(struct megasas_instance *instance,
31373137
return 1;
31383138
}
31393139

3140-
if (instance->adapter_type == VENTURA_SERIES) {
3140+
if (instance->adapter_type >= VENTURA_SERIES) {
31413141
set_num_sge(&io_request->RaidContext.raid_context_g35, sge_count);
31423142
cpu_to_le16s(&io_request->RaidContext.raid_context_g35.routing_flags);
31433143
cpu_to_le16s(&io_request->RaidContext.raid_context_g35.nseg_type);
@@ -4656,7 +4656,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
46564656
for (i = 0 ; i < instance->max_scsi_cmds; i++) {
46574657
cmd_fusion = fusion->cmd_list[i];
46584658
/*check for extra commands issued by driver*/
4659-
if (instance->adapter_type == VENTURA_SERIES) {
4659+
if (instance->adapter_type >= VENTURA_SERIES) {
46604660
r1_cmd = fusion->cmd_list[i + instance->max_fw_cmds];
46614661
megasas_return_cmd_fusion(instance, r1_cmd);
46624662
}
@@ -4755,7 +4755,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
47554755
megasas_setup_jbod_map(instance);
47564756

47574757
/* reset stream detection array */
4758-
if (instance->adapter_type == VENTURA_SERIES) {
4758+
if (instance->adapter_type >= VENTURA_SERIES) {
47594759
for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) {
47604760
memset(fusion->stream_detect_by_ld[j],
47614761
0, sizeof(struct LD_STREAM_DETECT));

0 commit comments

Comments
 (0)