diff --git a/drivers/misc/mods/Makefile b/drivers/misc/mods/Makefile index 4d9132a0..12af1408 100644 --- a/drivers/misc/mods/Makefile +++ b/drivers/misc/mods/Makefile @@ -3,6 +3,9 @@ ccflags-y += -I$(srctree.nvidia)/include ccflags-y += -DMODS_HAS_TEGRA +LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) +LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2) + ifeq ($(CONFIG_TEGRA_OOT_MODULE),m) CONFIG_MODS := m endif @@ -15,8 +18,12 @@ mods-y += mods_mem.o mods-$(CONFIG_ACPI) += mods_acpi.o mods-$(CONFIG_TEGRA_NVADSP) += mods_adsp.o +# mods_arm_ffa and mods_bpmpipc are currently broken for Linux v6.2 +# and so skip for Linux v6.2+ +ifeq ($(shell test $(LINUX_VERSION) -lt $(LINUX_VERSION_6_2); echo $$?),0) mods-$(CONFIG_ARM_FFA_TRANSPORT) += mods_arm_ffa.o mods-$(CONFIG_TEGRA_IVC) += mods_bpmpipc.o +endif mods-$(CONFIG_COMMON_CLK) += mods_clock.o mods-$(CONFIG_DEBUG_FS) += mods_debugfs.o mods-$(CONFIG_DMA_ENGINE) += mods_dma.o diff --git a/drivers/misc/mods/mods_krnl.c b/drivers/misc/mods/mods_krnl.c index a6862152..975de0ff 100644 --- a/drivers/misc/mods/mods_krnl.c +++ b/drivers/misc/mods/mods_krnl.c @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef MODS_HAS_CONSOLE_LOCK # include # include @@ -488,9 +489,11 @@ static int __init mods_init_module(void) #endif #if defined(CONFIG_ARM_FFA_TRANSPORT) +#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) rc = mods_ffa_abi_register(); if (rc < 0) mods_warning_printk("error on mods_ffa_abi_register returned %d\n", rc); +#endif #endif mods_info_printk("*** WARNING: DIAGNOSTIC DRIVER LOADED ***\n"); @@ -534,7 +537,9 @@ static void __exit mods_exit_module(void) #endif #if defined(CONFIG_ARM_FFA_TRANSPORT) +#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) mods_ffa_abi_unregister(); +#endif #endif mods_info_printk("driver unloaded\n"); @@ -1035,7 +1040,9 @@ static int mods_krnl_close(struct inode *ip, struct file *fp) #endif #if defined(CONFIG_TEGRA_IVC) +#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) mods_bpmpipc_cleanup(); +#endif #endif mods_disable_all_devices(client); @@ -2660,9 +2667,11 @@ static long mods_krnl_ioctl(struct file *fp, #endif #if defined(CONFIG_ARM_FFA_TRANSPORT) +#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) case MODS_ESC_FFA_CMD: MODS_IOCTL(MODS_ESC_FFA_CMD, esc_mods_arm_ffa_cmd, MODS_FFA_PARAMS); break; +#endif #endif case MODS_ESC_ACQUIRE_ACCESS_TOKEN: @@ -2735,11 +2744,13 @@ static long mods_krnl_ioctl(struct file *fp, break; #ifdef CONFIG_TEGRA_IVC +#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) case MODS_ESC_BPMP_UPHY_LANE_EOM_SCAN: MODS_IOCTL(MODS_ESC_BPMP_UPHY_LANE_EOM_SCAN, esc_mods_bpmp_uphy_lane_eom_scan, MODS_BPMP_UPHY_LANE_EOM_SCAN_PARAMS); break; +#endif #endif default: