Commit 2f79d855 authored by Yihang Li's avatar Yihang Li
Browse files

scsi: hisi_sas: Remove redundant checks for automatic debugfs dump

mainline inclusion
from mainline-v6.9-rc1
commit 3f030550476566b12091687c70071d05ad433e0d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I96KNQ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3f030550476566b12091687c70071d05ad433e0d



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

In commit 63f0733d07ce ("scsi: hisi_sas: Allocate DFX memory during dump
trigger"), the memory allocation time of the DFX is changed from device
initialization to dump occurs, so .debugfs_itct is not a valid address and
do not need to check.

The parameter hisi_sas_debugfs_enable is enough to check whether automatic
debugfs dump is triggered, so remove redunant checks.

Fixes: 63f0733d07ce ("scsi: hisi_sas: Allocate DFX memory during dump trigger")
Signed-off-by: default avatarYihang Li <liyihang9@huawei.com>
Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1705904747-62186-3-git-send-email-chenxiang66@hisilicon.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarBing Xia <xiabing12@h-partners.com>
parent 055771cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1578,7 +1578,7 @@ static int hisi_sas_controller_prereset(struct hisi_hba *hisi_hba)
		return -EPERM;
	}

	if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct)
	if (hisi_sas_debugfs_enable)
		hisi_hba->hw->debugfs_snapshot_regs(hisi_hba);

	return 0;
@@ -1966,7 +1966,7 @@ static bool hisi_sas_internal_abort_timeout(struct sas_task *task,
	struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
	struct hisi_sas_internal_abort_data *timeout = data;

	if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) {
	if (hisi_sas_debugfs_enable) {
		/*
		 * If timeout occurs in device gone scenario, to avoid
		 * circular dependency like: