mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 17:55:05 +03:00
drivers: pci: Fix the argument of iommu_map() for Linux v6.3
There is additional argument added in iommu_map() from Linux v6.3.
Pass the proper argument from the driver who are using this
APIs. Using conftest methods for differentiating whether
additional argument is needed or not.
Bug 4374520
Change-Id: I3d6452cf6c71f495e3b6e3b240b2c2d839aa4b0d
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3128547
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
(cherry picked from commit 222eebeb31)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3130621
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d99e65db74
commit
cdbedbf31e
@@ -321,7 +321,11 @@ static void tvnet_ep_alloc_empty_buffers(struct pci_epf_tvnet *tvnet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = iommu_map(domain, iova, page_to_phys(page), PAGE_SIZE,
|
ret = iommu_map(domain, iova, page_to_phys(page), PAGE_SIZE,
|
||||||
|
#if defined(NV_IOMMU_MAP_HAS_GFP_ARG)
|
||||||
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE, GFP_KERNEL);
|
||||||
|
#else
|
||||||
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
||||||
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(tvnet->fdev, "%s: iommu_map(RAM) failed: %d\n",
|
dev_err(tvnet->fdev, "%s: iommu_map(RAM) failed: %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
@@ -1235,7 +1239,11 @@ static int tvnet_ep_pci_epf_setup_irqsp(struct pci_epf_tvnet *tvnet)
|
|||||||
syncpt_addr = nvhost_interrupt_syncpt_get_syncpt_addr(ctrl_irqsp->is);
|
syncpt_addr = nvhost_interrupt_syncpt_get_syncpt_addr(ctrl_irqsp->is);
|
||||||
#endif
|
#endif
|
||||||
ret = iommu_map(domain, amap->iova, syncpt_addr, PAGE_SIZE,
|
ret = iommu_map(domain, amap->iova, syncpt_addr, PAGE_SIZE,
|
||||||
|
#if defined(NV_IOMMU_MAP_HAS_GFP_ARG)
|
||||||
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE, GFP_KERNEL);
|
||||||
|
#else
|
||||||
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
||||||
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(fdev, "%s: iommu_map of ctrlsp mem failed: %d\n",
|
dev_err(fdev, "%s: iommu_map of ctrlsp mem failed: %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
@@ -1254,7 +1262,11 @@ static int tvnet_ep_pci_epf_setup_irqsp(struct pci_epf_tvnet *tvnet)
|
|||||||
syncpt_addr = nvhost_interrupt_syncpt_get_syncpt_addr(data_irqsp->is);
|
syncpt_addr = nvhost_interrupt_syncpt_get_syncpt_addr(data_irqsp->is);
|
||||||
#endif
|
#endif
|
||||||
ret = iommu_map(domain, amap->iova + PAGE_SIZE, syncpt_addr, PAGE_SIZE,
|
ret = iommu_map(domain, amap->iova + PAGE_SIZE, syncpt_addr, PAGE_SIZE,
|
||||||
|
#if defined(NV_IOMMU_MAP_HAS_GFP_ARG)
|
||||||
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE, GFP_KERNEL);
|
||||||
|
#else
|
||||||
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
||||||
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(fdev, "%s: iommu_map of datasp mem failed: %d\n",
|
dev_err(fdev, "%s: iommu_map of datasp mem failed: %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
@@ -1321,7 +1333,11 @@ static int tvnet_ep_alloc_single_page_bar0_mem(struct pci_epf *epf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = iommu_map(domain, amap->iova, page_to_phys(amap->page), PAGE_SIZE,
|
ret = iommu_map(domain, amap->iova, page_to_phys(amap->page), PAGE_SIZE,
|
||||||
|
#if defined(NV_IOMMU_MAP_HAS_GFP_ARG)
|
||||||
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE, GFP_KERNEL);
|
||||||
|
#else
|
||||||
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
||||||
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(tvnet->fdev, "%s: type: %d iommu_map(RAM) failed: %d\n",
|
dev_err(tvnet->fdev, "%s: type: %d iommu_map(RAM) failed: %d\n",
|
||||||
__func__, type, ret);
|
__func__, type, ret);
|
||||||
@@ -1402,7 +1418,11 @@ static int tvnet_ep_alloc_multi_page_bar0_mem(struct pci_epf *epf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = iommu_map(domain, amap->iova, page_to_phys(amap->page),
|
ret = iommu_map(domain, amap->iova, page_to_phys(amap->page),
|
||||||
|
#if defined(NV_IOMMU_MAP_HAS_GFP_ARG)
|
||||||
|
amap->size, IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE, GFP_KERNEL);
|
||||||
|
#else
|
||||||
amap->size, IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
amap->size, IOMMU_CACHE | IOMMU_READ | IOMMU_WRITE);
|
||||||
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(tvnet->fdev, "%s: iommu_map(RAM) failed: %d\n",
|
dev_err(tvnet->fdev, "%s: iommu_map(RAM) failed: %d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
|
|||||||
Reference in New Issue
Block a user