Unverified Commit 3a20dc05 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14975 [OLK-6.6] [Backport] scsi: lpfc: Update phba link state conditional...

!14975 [OLK-6.6] [Backport] scsi: lpfc: Update phba link state conditional before sending CMF_SYNC_WQE

Merge Pull Request from: @jingtongmeng 
 
backport the follow important fix from mainline-v6.12-rc1 for lpfc driver:
https://github.com/torvalds/linux/commit/fc318cac66ac50398f9fc7cbec7b339e6d08a7e6 
 
Link:https://gitee.com/openeuler/kernel/pulls/14975

 

Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 944ce05f a1d3a588
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1938,12 +1938,15 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
	atot = atomic_xchg(&phba->cgn_sync_alarm_cnt, 0);
	wtot = atomic_xchg(&phba->cgn_sync_warn_cnt, 0);
	spin_lock_irqsave(&phba->hbalock, iflags);
	/* ONLY Managed mode will send the CMF_SYNC_WQE to the HBA */
	if (phba->cmf_active_mode != LPFC_CFG_MANAGED ||
	    phba->link_state == LPFC_LINK_DOWN)
		return 0;
	    phba->link_state < LPFC_LINK_UP) {
		ret_val = 0;
		goto out_unlock;
	}
	spin_lock_irqsave(&phba->hbalock, iflags);
	sync_buf = __lpfc_sli_get_iocbq(phba);
	if (!sync_buf) {
		lpfc_printf_log(phba, KERN_ERR, LOG_CGN_MGMT,