kae_driver/support-kernel-5.7.0-compation.patch

39 lines
1.2 KiB
Diff
Raw Normal View History

2020-11-11 17:33:49 +08:00
From b3dd45f0dc62148045cdbdc52dbaac6c7f136efe Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 11 Nov 2020 15:43:59 +0800
Subject: [PATCH] fix pci_cleanup_aer_uncorrect_error_status renamed to pci_aer_clear_nonfatal_status since kernel 5.7.0
---
kae_driver/hisilicon/qm.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kae_driver/hisilicon/qm.c b/KAEdriver-1.3.9/kae_driver/hisilicon/qm.c
index 35aa107..601b9c2 100644
--- a/kae_driver/hisilicon/qm.c
+++ b/kae_driver/hisilicon/qm.c
@@ -13,6 +13,7 @@
#include <linux/seq_file.h>
#include "qm.h"
#include "qm_usr_if.h"
+#include <linux/version.h>
/* eq/aeq irq enable */
#define QM_VF_AEQ_INT_SOURCE 0x0
@@ -4127,8 +4128,11 @@ pci_ers_result_t hisi_qm_dev_slot_reset(struct pci_dev *pdev)
return PCI_ERS_RESULT_RECOVERED;
pci_info(pdev, "Requesting reset due to PCI error\n");
- pci_cleanup_aer_uncorrect_error_status(pdev);
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
+ pci_aer_clear_nonfatal_status(pdev);
+#else
+ pci_cleanup_aer_uncorrect_error_status(pdev);
+#endif
/* reset pcie device controller */
ret = hisi_qm_controller_reset(qm);
if (ret) {
--
2.23.0