From 596800ce2d75ea9dd01e68c8a14b5baa0e6bd6e5 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Wed, 10 May 2023 11:09:00 +0300 Subject: [PATCH] qla2x00t-32gbit: Backport to older kernel versions Backport the change from a previous commit to kernel versions prior to v6.0, where commit f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native") hasn't been introduced. --- qla2x00t-32gbit/qla_def.h | 6 ++++++ qla2x00t-32gbit/qla_os.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 437200a46..b403107b6 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -6,6 +6,9 @@ #ifndef __QLA_DEF_H #define __QLA_DEF_H +#ifndef INSIDE_KERNEL_TREE +#include +#endif #include #include #include @@ -22,6 +25,9 @@ #include #include #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#include +#endif #include #include #include diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index fc071dfbb..490568ee4 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -3010,6 +3010,11 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + /* This may fail but that's ok */ + pci_enable_pcie_error_reporting(pdev); +#endif + ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, @@ -4019,6 +4024,10 @@ qla2x00_remove_one(struct pci_dev *pdev) pci_release_selected_regions(ha->pdev, ha->bars); kfree(ha); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + pci_disable_pcie_error_reporting(pdev); +#endif + pci_disable_device(pdev); } @@ -6894,6 +6903,9 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) qla2x00_unmap_iobases(ha); pci_release_selected_regions(ha->pdev, ha->bars); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + pci_disable_pcie_error_reporting(pdev); +#endif pci_disable_device(pdev); /*