summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJustin Tee <justin.tee@broadcom.com>2024-10-31 23:32:09 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2024-11-03 02:45:23 +0100
commit29a64210c76788cae589f31c1cda6c46c2364111 (patch)
treea7118f74eb430be6051566f63b76deb53def9fe8 /drivers/scsi
parentLinux 6.12-rc1 (diff)
downloadlinux-29a64210c76788cae589f31c1cda6c46c2364111.tar.xz
linux-29a64210c76788cae589f31c1cda6c46c2364111.zip
scsi: lpfc: Modify CGN warning signal calculation based on EDC response
CGN warning signals are currently statically fixed to a passed in driver parameter called lpfc_fabric_cgn_frequency. However, CGN frequency should be more correctly based on EDC responses from the fabric when available. Otherwise, still allow the driver to fall back on user configured lpfc_fabric_cgn_frequency driver parameter. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20241031223219.152342-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 2ec6e55771b4..80a43fd40af2 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -1932,7 +1932,7 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
union lpfc_wqe128 *wqe;
struct lpfc_iocbq *sync_buf;
unsigned long iflags;
- u32 ret_val;
+ u32 ret_val, cgn_sig_freq;
u32 atot, wtot, max;
u8 warn_sync_period = 0;
@@ -1987,8 +1987,10 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
} else if (wtot) {
if (phba->cgn_reg_signal == EDC_CG_SIG_WARN_ONLY ||
phba->cgn_reg_signal == EDC_CG_SIG_WARN_ALARM) {
+ cgn_sig_freq = phba->cgn_sig_freq ? phba->cgn_sig_freq :
+ lpfc_fabric_cgn_frequency;
/* We hit an Signal warning condition */
- max = LPFC_SEC_TO_MSEC / lpfc_fabric_cgn_frequency *
+ max = LPFC_SEC_TO_MSEC / cgn_sig_freq *
lpfc_acqe_cgn_frequency;
bf_set(cmf_sync_wsigmax, &wqe->cmf_sync, max);
bf_set(cmf_sync_wsigcnt, &wqe->cmf_sync, wtot);