mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 17:55:05 +03:00
pci: endpoint: Update drivers for Linux v6.11
For Linux v6.11, the 'pci_epc_event_ops' structure 'core_init' callback
was renamed to 'epc_init' and a new 'epc_deinit' callback was added.
Update the PCI endpoint drivers for Linux v6.11 by:
1. Adding tests to conftest to detect the presence of 'epc_init' and
'epc_deinit'.
2. Update the drivers as necessary to use the appropriate callback
depending upon what is present in the kernel.
Bug 4749580
Change-Id: Ife7e2d5d18332bf84f22142c9727dc1ece913c49
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186686
(cherry picked from commit b0ff4f1358)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3219305
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
15ca4ff659
commit
93ba193a32
@@ -170,7 +170,8 @@ static int pcie_dma_epf_core_init(struct pci_epf *epf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_CORE_DEINIT) /* Nvidia Internal */
|
||||
#if defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_EPC_DEINIT) || \
|
||||
defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_CORE_DEINIT) /* Linux v6.11 || Nvidia Internal */
|
||||
static int pcie_dma_epf_core_deinit(struct pci_epf *epf)
|
||||
{
|
||||
struct pcie_epf_dma *epfnv = epf_get_drvdata(epf);
|
||||
@@ -186,6 +187,13 @@ static int pcie_dma_epf_core_deinit(struct pci_epf *epf)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_EPC_DEINIT)
|
||||
static void pcie_dma_epf_epc_deinit(struct pci_epf *epf)
|
||||
{
|
||||
pcie_dma_epf_core_deinit(epf);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void pcie_dma_epf_unbind(struct pci_epf *epf)
|
||||
@@ -283,8 +291,14 @@ static const struct pci_epf_device_id pcie_dma_epf_ids[] = {
|
||||
};
|
||||
|
||||
static const struct pci_epc_event_ops pci_epf_dma_test_event_ops = {
|
||||
#if defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_EPC_INIT) /* Linux v6.11 */
|
||||
.epc_init = pcie_dma_epf_core_init,
|
||||
#else
|
||||
.core_init = pcie_dma_epf_core_init,
|
||||
#if defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_CORE_DEINIT) /* Nvidia Internal */
|
||||
#endif
|
||||
#if defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_EPC_DEINIT) /* Linux v6.11 */
|
||||
.epc_deinit = pcie_dma_epf_epc_deinit,
|
||||
#elif defined(NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_CORE_DEINIT) /* Nvidia Internal */
|
||||
.core_deinit = pcie_dma_epf_core_deinit,
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user