mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
video: tegra: nvmap: Fix build for Linux v6.15
In Linux v6.15, the function ioremap_prot() was updated to pass a variable of type pgprot_t instead of an unsigned long. Add a conftest test to check for this and update the NVMAP driver accordlingly to fix the build for Linux v6.15. JIRA LINQPJ14-47 Change-Id: Icff9f63bf5c914997b69076435dd9e2432f343a3 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3332454 (cherry picked from commit b464d75b06c7976ae73e5d7a8660b49e29e1df77) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499759 Reviewed-by: Brad Griffis <bgriffis@nvidia.com> Tested-by: Brad Griffis <bgriffis@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
8e9d8552c3
commit
48373c24ad
@@ -148,10 +148,14 @@ int nvmap_cache_maint_phys_range(unsigned int op, phys_addr_t pstart,
|
|||||||
void *base;
|
void *base;
|
||||||
next = min(next, pend);
|
next = min(next, pend);
|
||||||
#if defined(CONFIG_GENERIC_IOREMAP)
|
#if defined(CONFIG_GENERIC_IOREMAP)
|
||||||
|
#if defined(NV_IOREMAP_PROT_HAS_PGPROT_T_ARG) /* Linux v6.15 */
|
||||||
|
io_addr = ioremap_prot(loop, PAGE_SIZE, PAGE_KERNEL);
|
||||||
|
#else
|
||||||
io_addr = ioremap_prot(loop, PAGE_SIZE, pgprot_val(PAGE_KERNEL));
|
io_addr = ioremap_prot(loop, PAGE_SIZE, pgprot_val(PAGE_KERNEL));
|
||||||
|
#endif /* NV_IOREMAP_PROT_HAS_PGPROT_T_ARG */
|
||||||
#else
|
#else
|
||||||
io_addr = __ioremap(loop, PAGE_SIZE, PG_PROT_KERNEL);
|
io_addr = __ioremap(loop, PAGE_SIZE, PG_PROT_KERNEL);
|
||||||
#endif
|
#endif /* CONFIG_GENERIC_IOREMAP */
|
||||||
if (io_addr == NULL)
|
if (io_addr == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
base = (__force void *)io_addr + (loop & ~PAGE_MASK);
|
base = (__force void *)io_addr + (loop & ~PAGE_MASK);
|
||||||
|
|||||||
@@ -201,11 +201,15 @@ void *__nvmap_mmap(struct nvmap_handle *h)
|
|||||||
vaddr = vmap(pages, nr_pages, VM_MAP, prot);
|
vaddr = vmap(pages, nr_pages, VM_MAP, prot);
|
||||||
} else {
|
} else {
|
||||||
#if defined(CONFIG_GENERIC_IOREMAP)
|
#if defined(CONFIG_GENERIC_IOREMAP)
|
||||||
|
#if defined(NV_IOREMAP_PROT_HAS_PGPROT_T_ARG) /* Linux v6.15 */
|
||||||
|
vaddr = ioremap_prot(h->carveout->base, adj_size, prot);
|
||||||
|
#else
|
||||||
vaddr = ioremap_prot(h->carveout->base, adj_size, pgprot_val(prot));
|
vaddr = ioremap_prot(h->carveout->base, adj_size, pgprot_val(prot));
|
||||||
|
#endif /* NV_IOREMAP_PROT_HAS_PGPROT_T_ARG */
|
||||||
#else
|
#else
|
||||||
vaddr = (__force void *)__ioremap(h->carveout->base, adj_size,
|
vaddr = (__force void *)__ioremap(h->carveout->base, adj_size,
|
||||||
prot);
|
prot);
|
||||||
#endif
|
#endif /* CONFIG_GENERIC_IOREMAP */
|
||||||
}
|
}
|
||||||
if (vaddr == NULL)
|
if (vaddr == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_mux_add_adapter_has_no_class_argument
|
|||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iio_dev_opaque_has_mlock
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iio_dev_opaque_has_mlock
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_map_has_gfp_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_map_has_gfp_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_paging_domain_alloc
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_paging_domain_alloc
|
||||||
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_prot_has_pgprot_t_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += irq_get_nr_irqs
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += irq_get_nr_irqs
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += kthread_complete_and_exit
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += kthread_complete_and_exit
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += media_entity_remote_pad
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += media_entity_remote_pad
|
||||||
|
|||||||
@@ -7570,6 +7570,24 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_IOMMU_MAP_HAS_GFP_ARG" "" "types"
|
compile_check_conftest "$CODE" "NV_IOMMU_MAP_HAS_GFP_ARG" "" "types"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
ioremap_prot_has_pgprot_t_arg)
|
||||||
|
#
|
||||||
|
# Determine if pgprot_t is passed to ioremap_prot()
|
||||||
|
#
|
||||||
|
# In Linux v6.15, commit 86758b504864 ("mm/ioremap: pass pgprot_t to
|
||||||
|
# ioremap_prot() instead of unsigned long") updated ioremap_prot() to
|
||||||
|
# pass pgprot_t.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
#include <linux/io.h>
|
||||||
|
void conftest_ioremap_prot_has_pgprot_t_arg(phys_addr_t phys_addr,
|
||||||
|
size_t size, pgprot_t prot) {
|
||||||
|
ioremap_prot(phys_addr, size, prot);
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" "NV_IOREMAP_PROT_HAS_PGPROT_T_ARG" "" "types" $1
|
||||||
|
;;
|
||||||
|
|
||||||
iio_dev_opaque_has_mlock)
|
iio_dev_opaque_has_mlock)
|
||||||
#
|
#
|
||||||
# Determine if the 'iio_dev_opaque' structure has 'mlock' field.
|
# Determine if the 'iio_dev_opaque' structure has 'mlock' field.
|
||||||
|
|||||||
Reference in New Issue
Block a user