Skip to content

Commit 10a0737

Browse files
Krishna GudipatiJames Bottomley
authored andcommitted
[SCSI] bfa: Brocade-1860 Fabric Adapter PLL init fixes.
- If flash controller is halted unconditionally, this results in illegal write access to flash controller register domain. Since flash controller registers are only accessible once s_clk is started - added logic to check for WGN status and halt flash controller only if it is already running. - Added check to wait for flash controller halt to be completed before proceeding with s_clk/l_clk initializations. - Removed unnecessary reset logic for PMM 1T memory and moved memory initialization after flash access enable. - Disable Brocade-1860 asic MBOX interrupt before PLL initialization. - Remove reset enable for S_CLK/L_CLK after both PLL initializations are complete. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1 parent a714134 commit 10a0737

9 files changed

Lines changed: 169 additions & 132 deletions

File tree

‎drivers/scsi/bfa/bfa_core.c‎

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,39 @@ bfa_isr_reqq(struct bfa_s *bfa, int qid)
251251
void
252252
bfa_msix_all(struct bfa_s *bfa, int vec)
253253
{
254-
bfa_intx(bfa);
254+
u32 intr, qintr;
255+
int queue;
256+
257+
intr = readl(bfa->iocfc.bfa_regs.intr_status);
258+
if (!intr)
259+
return;
260+
261+
/*
262+
* RME completion queue interrupt
263+
*/
264+
qintr = intr & __HFN_INT_RME_MASK;
265+
if (qintr && bfa->queue_process) {
266+
for (queue = 0; queue < BFI_IOC_MAX_CQS; queue++)
267+
bfa_isr_rspq(bfa, queue);
268+
}
269+
270+
intr &= ~qintr;
271+
if (!intr)
272+
return;
273+
274+
/*
275+
* CPE completion queue interrupt
276+
*/
277+
qintr = intr & __HFN_INT_CPE_MASK;
278+
if (qintr && bfa->queue_process) {
279+
for (queue = 0; queue < BFI_IOC_MAX_CQS; queue++)
280+
bfa_isr_reqq(bfa, queue);
281+
}
282+
intr &= ~qintr;
283+
if (!intr)
284+
return;
285+
286+
bfa_msix_lpu_err(bfa, intr);
255287
}
256288

257289
bfa_boolean_t
@@ -469,6 +501,9 @@ bfa_iocfc_send_cfg(void *bfa_arg)
469501
/*
470502
* initialize IOC configuration info
471503
*/
504+
cfg_info->single_msix_vec = 0;
505+
if (bfa->msix.nvecs == 1)
506+
cfg_info->single_msix_vec = 1;
472507
cfg_info->endian_sig = BFI_IOC_ENDIAN_SIG;
473508
cfg_info->num_cqs = cfg->fwcfg.num_cqs;
474509
cfg_info->num_ioim_reqs = cpu_to_be16(cfg->fwcfg.num_ioim_reqs);
@@ -1080,12 +1115,6 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
10801115
ioc->trcmod = bfa->trcmod;
10811116
bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod);
10821117

1083-
/*
1084-
* Set FC mode for BFA_PCI_DEVICE_ID_CT_FC.
1085-
*/
1086-
if (pcidev->device_id == BFA_PCI_DEVICE_ID_CT_FC)
1087-
bfa_ioc_set_fcmode(&bfa->ioc);
1088-
10891118
bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_PCIFN_CLASS_FC);
10901119
bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs);
10911120

‎drivers/scsi/bfa/bfa_hw_cb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa)
114114
return;
115115

116116
if (bfa->msix.nvecs == 1) {
117-
for (i = BFI_MSIX_RME_QMAX_CB+1; i < BFI_MSIX_CB_MAX; i++)
117+
for (i = BFI_MSIX_CPE_QMIN_CB; i < BFI_MSIX_CB_MAX; i++)
118118
bfa->msix.handler[i] = bfa_msix_all;
119119
return;
120120
}

‎drivers/scsi/bfa/bfa_ioc.c‎

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,12 +2399,6 @@ bfa_ioc_error_isr(struct bfa_ioc_s *ioc)
23992399
bfa_fsm_send_event(ioc, IOC_E_HWERROR);
24002400
}
24012401

2402-
void
2403-
bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc)
2404-
{
2405-
ioc->fcmode = BFA_TRUE;
2406-
}
2407-
24082402
/*
24092403
* return true if IOC is disabled
24102404
*/
@@ -2592,35 +2586,7 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
25922586

25932587
ioc_attr = ioc->attr;
25942588

2595-
/*
2596-
* model name
2597-
*/
2598-
if (ioc->asic_gen == BFI_ASIC_GEN_CT2) {
2599-
int np = bfa_ioc_get_nports(ioc);
2600-
char c;
2601-
switch (ioc_attr->card_type) {
2602-
case BFA_MFG_TYPE_PROWLER_F:
2603-
case BFA_MFG_TYPE_PROWLER_N:
2604-
case BFA_MFG_TYPE_PROWLER_C:
2605-
snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN,
2606-
"%s-%u-%u",
2607-
BFA_MFG_NAME, ioc_attr->card_type, np);
2608-
break;
2609-
case BFA_MFG_TYPE_PROWLER_D:
2610-
if (ioc_attr->ic == BFA_MFG_IC_FC)
2611-
c = 'F';
2612-
else
2613-
c = 'P';
2614-
2615-
snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN,
2616-
"%s-%u-%u%c",
2617-
BFA_MFG_NAME, ioc_attr->card_type, np, c);
2618-
break;
2619-
default:
2620-
break;
2621-
}
2622-
} else
2623-
snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u",
2589+
snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u",
26242590
BFA_MFG_NAME, ioc_attr->card_type);
26252591
}
26262592

@@ -2711,12 +2677,6 @@ bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc)
27112677
return m;
27122678
}
27132679

2714-
bfa_boolean_t
2715-
bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc)
2716-
{
2717-
return ioc->fcmode || bfa_asic_id_cb(ioc->pcidev.device_id);
2718-
}
2719-
27202680
/*
27212681
* Retrieve saved firmware trace from a prior IOC failure.
27222682
*/

‎drivers/scsi/bfa/bfa_ioc.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ bfa_status_t bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
362362
} while (0)
363363
#define bfa_ioc_ownership_reset(__ioc) \
364364
((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc))
365+
#define bfa_ioc_get_fcmode(__ioc) ((__ioc)->fcmode)
365366
#define bfa_ioc_lpu_read_stat(__ioc) do { \
366367
if ((__ioc)->ioc_hwif->ioc_lpu_read_stat) \
367368
((__ioc)->ioc_hwif->ioc_lpu_read_stat(__ioc)); \
@@ -414,8 +415,6 @@ bfa_status_t bfa_ioc_debug_fwtrc(struct bfa_ioc_s *ioc, void *trcdata,
414415
int *trclen);
415416
bfa_status_t bfa_ioc_debug_fwcore(struct bfa_ioc_s *ioc, void *buf,
416417
u32 *offset, int *buflen);
417-
void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc);
418-
bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc);
419418
bfa_boolean_t bfa_ioc_sem_get(void __iomem *sem_reg);
420419
void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc,
421420
struct bfi_ioc_image_hdr_s *fwhdr);

0 commit comments

Comments
 (0)