PCI: tegra264: Fix build issues using conftest

The Tegra264 PCIe drivers don't build for kernels that don't have:

1. The structure mrq_pcie_request_req defined
2. The function pci_epc_deinit_notify() present

This is currently being handling by building a dummy driver for kernels
that don't have these. To simplify this, use conftest to detect if the
above are present and modify the Tegra264 PCIe driver accordingly if
they are not present. By using conftest we can remove the Makefile
variable 'NV_OOT_PCIE_T264_SOC_SKIP_BUILD' and ccflag
'DNV_CONFIG_PCIE_TEGRA_DMA_DISABLE'.

Finally, the PCIe drivers are always built as modules so simplify the
Makefile and remove the usage of 'CONFIG_TEGRA_OOT_MODULE'.

Bug 4911768

Change-Id: Id282497b8607a732b5e6c90e1e7c1436589a0b5f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3245592
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-10-21 12:00:10 +01:00
parent cb233ff6f5
commit 23e3912ef7
11 changed files with 52 additions and 86 deletions

View File

@@ -158,6 +158,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_read_c45
NV_CONFTEST_FUNCTION_COMPILE_TESTS += mii_bus_struct_has_write_c45
NV_CONFTEST_FUNCTION_COMPILE_TESTS += media_entity_remote_pad
NV_CONFTEST_FUNCTION_COMPILE_TESTS += module_import_ns_calls_stringify
NV_CONFTEST_FUNCTION_COMPILE_TESTS += mrq_pcie_request_struct_present
NV_CONFTEST_FUNCTION_COMPILE_TESTS += msi_get_virq
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_set_tso_max_size
NV_CONFTEST_FUNCTION_COMPILE_TESTS += netif_napi_add_weight
@@ -174,6 +175,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_chip_struct_has_base_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_chip_struct_has_struct_device
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_owner
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pwm_ops_struct_has_config
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_deinit_notify
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_core_deinit
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_epc_deinit
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_epc_event_ops_struct_has_epc_init

View File

@@ -7796,6 +7796,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_MODULE_IMPORT_NS_CALLS_STRINGIFY" "" "types"
;;
mrq_pcie_request_struct_present)
#
# Determine if the 'struct mrq_pcie_request_req' is present. This
# structure is not available in current upstream Linux kernels and
# so add a test to see if the necessary downstream change is
# present.
#
CODE="
#include <linux/types.h>
#include <soc/tegra/bpmp-abi.h>
static struct mrq_pcie_request req;"
compile_check_conftest "$CODE" "NV_MRQ_PCIE_REQUEST_STRUCT_PRESENT" "" "symbols"
;;
no_llseek)
#
# Determine if the function no_llseek() is present.
@@ -7919,6 +7935,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_PWM_OPS_STRUCT_HAS_CONFIG" "" "types"
;;
pci_epc_deinit_notify)
#
# Determine if the function pci_epc_deinit_notify() is present.
#
# In Linux v6.11, commit 473b2cf9c4d1 ("PCI: endpoint: Introduce 'epc_deinit'
# event and notify the EPF drivers") added the function pci_epc_deinit_notify().
#
CODE="
#include <linux/pci-epc.h>
void conftest_pci_epc_deinit_notify(void) {
pci_epc_deinit_notify();
}"
compile_check_conftest "$CODE" "NV_PCI_EPC_DEINIT_NOTIFY_PRESENT" "" "functions"
;;
pci_epc_event_ops_struct_has_core_deinit)
#
# Determine if the pci_epc_event_ops struct has the core_deinit function.