summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 6574f9e74476..a8fbdf7119d8 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -1,7 +1,7 @@
/*******************************************************************
* This file is part of the Emulex Linux Device Driver for *
* Fibre Channel Host Bus Adapters. *
- * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
+ * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term *
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. *
@@ -3925,13 +3925,20 @@ void lpfc_poll_eratt(struct timer_list *t)
uint32_t eratt = 0;
uint64_t sli_intr, cnt;
- phba = from_timer(phba, t, eratt_poll);
- if (!test_bit(HBA_SETUP, &phba->hba_flag))
- return;
+ phba = timer_container_of(phba, t, eratt_poll);
if (test_bit(FC_UNLOADING, &phba->pport->load_flag))
return;
+ if (phba->sli_rev == LPFC_SLI_REV4 &&
+ !test_bit(HBA_SETUP, &phba->hba_flag)) {
+ lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
+ "0663 HBA still initializing 0x%lx, restart "
+ "timer\n",
+ phba->hba_flag);
+ goto restart_timer;
+ }
+
/* Here we will also keep track of interrupts per sec of the hba */
sli_intr = phba->sli.slistat.sli_intr;
@@ -3950,13 +3957,16 @@ void lpfc_poll_eratt(struct timer_list *t)
/* Check chip HA register for error event */
eratt = lpfc_sli_check_eratt(phba);
- if (eratt)
+ if (eratt) {
/* Tell the worker thread there is work to do */
lpfc_worker_wake_up(phba);
- else
- /* Restart the timer for next eratt poll */
- mod_timer(&phba->eratt_poll,
- jiffies + secs_to_jiffies(phba->eratt_poll_interval));
+ return;
+ }
+
+restart_timer:
+ /* Restart the timer for next eratt poll */
+ mod_timer(&phba->eratt_poll,
+ jiffies + secs_to_jiffies(phba->eratt_poll_interval));
return;
}
@@ -5157,7 +5167,6 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba)
phba->link_events = 0;
phba->pport->fc_myDID = 0;
phba->pport->fc_prevDID = 0;
- clear_bit(HBA_SETUP, &phba->hba_flag);
spin_lock_irq(&phba->hbalock);
psli->sli_flag &= ~(LPFC_PROCESS_LA);
@@ -5274,6 +5283,7 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
"0296 Restart HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag);
+ clear_bit(HBA_SETUP, &phba->hba_flag);
lpfc_sli4_queue_unset(phba);
rc = lpfc_sli4_brdreset(phba);
@@ -6003,9 +6013,9 @@ lpfc_sli4_get_ctl_attr(struct lpfc_hba *phba)
phba->sli4_hba.flash_id = bf_get(lpfc_cntl_attr_flash_id, cntl_attr);
phba->sli4_hba.asic_rev = bf_get(lpfc_cntl_attr_asic_rev, cntl_attr);
- memset(phba->BIOSVersion, 0, sizeof(phba->BIOSVersion));
- strlcat(phba->BIOSVersion, (char *)cntl_attr->bios_ver_str,
+ memcpy(phba->BIOSVersion, cntl_attr->bios_ver_str,
sizeof(phba->BIOSVersion));
+ phba->BIOSVersion[sizeof(phba->BIOSVersion) - 1] = '\0';
lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"3086 lnk_type:%d, lnk_numb:%d, bios_ver:%s, "
@@ -9115,7 +9125,7 @@ out_free_mbox:
void
lpfc_mbox_timeout(struct timer_list *t)
{
- struct lpfc_hba *phba = from_timer(phba, t, sli.mbox_tmo);
+ struct lpfc_hba *phba = timer_container_of(phba, t, sli.mbox_tmo);
unsigned long iflag;
uint32_t tmo_posted;
@@ -15651,7 +15661,7 @@ lpfc_sli4_intr_handler(int irq, void *dev_id)
void lpfc_sli4_poll_hbtimer(struct timer_list *t)
{
- struct lpfc_hba *phba = from_timer(phba, t, cpuhp_poll_timer);
+ struct lpfc_hba *phba = timer_container_of(phba, t, cpuhp_poll_timer);
struct lpfc_queue *eq;
rcu_read_lock();
@@ -16467,10 +16477,10 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp,
case 4096:
if (phba->sli4_hba.pc_sli4_params.cqv ==
LPFC_Q_CREATE_VERSION_2) {
- bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
+ bf_set(lpfc_mbx_cq_create_set_cqe_cnt_lo,
&cq_set->u.request,
- cq->entry_count);
- bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
+ cq->entry_count);
+ bf_set(lpfc_mbx_cq_create_set_cqecnt,
&cq_set->u.request,
LPFC_CQ_CNT_WORD7);
break;
@@ -16486,15 +16496,15 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp,
}
fallthrough; /* otherwise default to smallest */
case 256:
- bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
+ bf_set(lpfc_mbx_cq_create_set_cqecnt,
&cq_set->u.request, LPFC_CQ_CNT_256);
break;
case 512:
- bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
+ bf_set(lpfc_mbx_cq_create_set_cqecnt,
&cq_set->u.request, LPFC_CQ_CNT_512);
break;
case 1024:
- bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
+ bf_set(lpfc_mbx_cq_create_set_cqecnt,
&cq_set->u.request, LPFC_CQ_CNT_1024);
break;
}