pci: Use conftest to find if pci_enable_pcie_error_reporting() present

Use conftest to find if API pci_enable_pcie_error_reporting()
is present. This API is dropped from Linux 6.5 with change
commit 7ec4b34be42345 ("PCI/AER: Unexport
pci_enable_pcie_error_reporting()")

Bug 4346767

Change-Id: Ib0037544b4480b37c0ed6ac8b9ef9aef6ae82619
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028742
(cherry picked from commit bf46060d1e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032090
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 18:07:41 +00:00
committed by mobile promotions
parent ab8b8a6c84
commit 4a1a87890d
6 changed files with 23 additions and 6 deletions

View File

@@ -354,7 +354,7 @@ nvscic2c_pcie_epc_probe(struct pci_dev *pdev,
ret = pcim_enable_device(pdev);
if (ret)
goto err_enable_device;
#if !defined(NV_DROP_PCIE_ERROR_REPORTING)
#if defined(NV_PCI_ENABLE_PCIE_ERROR_REPORTING_PRESENT) /* Linux 6.5 */
pci_enable_pcie_error_reporting(pdev);
#endif
pci_set_master(pdev);

View File

@@ -5,6 +5,8 @@
* Copyright (C) 2021-2023 NVIDIA Corporation. All rights reserved.
*/
#include <nvidia/conftest.h>
#include <linux/aer.h>
#include <linux/delay.h>
#include <linux/crc32.h>
@@ -170,7 +172,7 @@ static int ep_test_dma_probe(struct pci_dev *pdev,
return ret;
}
#if !defined(NV_DROP_PCIE_ERROR_REPORTING)
#if defined(NV_PCI_ENABLE_PCIE_ERROR_REPORTING_PRESENT) /* Linux 6.5 */
pci_enable_pcie_error_reporting(pdev);
#endif