Commit 82a09292 authored by Ni Fujia's avatar Ni Fujia Committed by Zheng Zengkai
Browse files

Increase-debugfs_dump_index-after-dump

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4NDP8


CVE: NA

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

The hisi_hba debugfs_dump_index member should increased after a dump
insertion completed, and not before it has started, so fix the code to do
so.

Signed-off-by: default avatarLuo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarOuyangdelong <ouyangdelong@huawei.com>
Signed-off-by: default avatarNifujia <nifujia1@hisilicon.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 36a53cf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3686,7 +3686,6 @@ static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba)

	do_div(timestamp, NSEC_PER_MSEC);
	hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp;
	hisi_hba->debugfs_dump_index++;

	debugfs_snapshot_prepare_v3_hw(hisi_hba);

@@ -3702,6 +3701,7 @@ static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba)
	debugfs_create_files_v3_hw(hisi_hba);

	debugfs_snapshot_restore_v3_hw(hisi_hba);
	hisi_hba->debugfs_dump_index++;
}

static ssize_t debugfs_trigger_dump_v3_hw_write(struct file *file,