diff --git a/drivers/misc/nvscic2c-pcie/pci-client.c b/drivers/misc/nvscic2c-pcie/pci-client.c index 307ae89e..24668613 100644 --- a/drivers/misc/nvscic2c-pcie/pci-client.c +++ b/drivers/misc/nvscic2c-pcie/pci-client.c @@ -3,6 +3,8 @@ #define pr_fmt(fmt) "nvscic2c-pcie: pci-client: " fmt +#include + #include #include #include @@ -246,7 +248,11 @@ allocate_edma_rx_desc_iova(struct pci_client_t *ctx) goto err; } prot = (IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE); +#if defined(NV_IOMMU_MAP_HAS_GFP_ARG) /* Linux v6.3 */ + ret = iommu_map(ctx->domain, ctx->edma_ch_desc_iova, phys_addr, EDMA_CH_DESC_SZ, prot, GFP_KERNEL); +#else ret = iommu_map(ctx->domain, ctx->edma_ch_desc_iova, phys_addr, EDMA_CH_DESC_SZ, prot); +#endif if (ret) { pr_err("pci client failed to map iova to 60K physical backing\n"); goto err; @@ -408,7 +414,11 @@ pci_client_map_addr(void *pci_client_h, u64 to_iova, phys_addr_t paddr, if (WARN_ON(!ctx || !to_iova || !paddr || !size)) return -EINVAL; +#if defined(NV_IOMMU_MAP_HAS_GFP_ARG) /* Linux v6.3 */ + return iommu_map(ctx->domain, to_iova, paddr, size, prot, GFP_KERNEL); +#else return iommu_map(ctx->domain, to_iova, paddr, size, prot); +#endif } size_t