Commit d7a8d0ee authored by Ranjan Kumar's avatar Ranjan Kumar Committed by Baogen Shang
Browse files

scsi: mpt3sas: Prevent sending diag_reset when the controller is ready

stable inclusion
from stable-v5.10.214
commit ba3a55d118bf211f4a7f53f83dafbc3405ea198d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=ba3a55d118bf211f4a7f53f83dafbc3405ea198d



-------------------------

[ Upstream commit ee0017c3ed8a8abfa4d40e42f908fb38c31e7515 ]

If the driver detects that the controller is not ready before sending the
first IOC facts command, it will wait for a maximum of 10 seconds for it to
become ready. However, even if the controller becomes ready within 10
seconds, the driver will still issue a diagnostic reset.

Modify the driver to avoid sending a diag reset if the controller becomes
ready within the 10-second wait time.

Signed-off-by: default avatarRanjan Kumar <ranjan.kumar@broadcom.com>
Link: https://lore.kernel.org/r/20240221071724.14986-1-ranjan.kumar@broadcom.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarBaogen Shang <baogen.shang@windriver.com>
parent 34c4be6c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6357,6 +6357,8 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout)
		return -EFAULT;
	}

	return 0;

issue_diag_reset:
	rc = _base_diag_reset(ioc);
	return rc;