pci: Use conftest to find if pci_disable_pcie_error_reporting() present

Use conftest to find if API pci_disable_pcie_error_reporting()
is present. This API is dropped from Linux 6.5 with change
commit 69b264df8a41282 ("PCI/AER: Drop unused
pci_disable_pcie_error_reporting()")

Bug 4346767

Change-Id: Idcaf36e4215a874c70f7457a46fd875f1349b121
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028741
(cherry picked from commit f9f8b37e74)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032100
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 17:51:12 +00:00
committed by mobile promotions
parent 9c77439e40
commit ab8b8a6c84
4 changed files with 21 additions and 4 deletions

View File

@@ -50,9 +50,6 @@ subdir-ccflags-y += -DNV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME
# Deprecate PCIED Error reporting pci_enable_pcie_error_reporting # Deprecate PCIED Error reporting pci_enable_pcie_error_reporting
subdir-ccflags-y += -DNV_DROP_PCIE_ERROR_REPORTING subdir-ccflags-y += -DNV_DROP_PCIE_ERROR_REPORTING
# Drop the API for pcie_disable_pcie_error_reporting
subdir-ccflags-y += -DNV_PCIE_DIABLE_PCIE_ERROR_REPORTING_DROP
# PCIE EPF driver probe has additional argument as ID # PCIE EPF driver probe has additional argument as ID
subdir-ccflags-y += -DNV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG subdir-ccflags-y += -DNV_PCIE_EFP_DRIVER_PROBE_HAS_ID_ARG

View File

@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. // Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <nvidia/conftest.h>
#define pr_fmt(fmt) "nvscic2c-pcie: epc: " fmt #define pr_fmt(fmt) "nvscic2c-pcie: epc: " fmt
#include <linux/aer.h> #include <linux/aer.h>
@@ -290,7 +292,7 @@ deinit:
pci_release_region(pdev, 0); pci_release_region(pdev, 0);
pci_clear_master(pdev); pci_clear_master(pdev);
#if !defined(NV_PCIE_DIABLE_PCIE_ERROR_REPORTING_DROP) #if defined(NV_PCI_DISABLE_PCIE_ERROR_REPORTING_PRESENT) /* Linux 6.5 */
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
#endif #endif
pci_disable_device(pdev); pci_disable_device(pdev);

View File

@@ -123,6 +123,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_write_c45
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_disable_pcie_error_reporting
NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += register_shrinker_has_fmt_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_card_jack_new_has_no_snd_soc_jack_pins NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_card_jack_new_has_no_snd_soc_jack_pins
NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_component_driver_struct_has_non_legacy_dai_naming NV_CONFTEST_FUNCTION_COMPILE_TESTS += snd_soc_component_driver_struct_has_non_legacy_dai_naming

View File

@@ -6968,6 +6968,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_MII_BUS_STRUCT_HAS_WRITE_C45" "" "types" compile_check_conftest "$CODE" "NV_MII_BUS_STRUCT_HAS_WRITE_C45" "" "types"
;; ;;
pci_disable_pcie_error_reporting)
#
# Determine if the pci_disable_pcie_error_reporting() API available or not.
#
# API pci_disable_pcie_error_reporting() is dropped from Linux 6.5
# with commit 69b264df8a4128 ("PCI/AER: Drop unused
# pci_disable_pcie_error_reporting()")
#
CODE="
#include <linux/aer.h>
void conftest_pci_disable_pcie_error_reporting(void) {
pci_disable_pcie_error_reporting();
}"
compile_check_conftest "$CODE" "NV_PCI_DISABLE_PCIE_ERROR_REPORTING_PRESENT" "" "functions"
;;
register_shrinker_has_fmt_arg) register_shrinker_has_fmt_arg)
# #
# Determine if the 'register_shrinker' function # Determine if the 'register_shrinker' function