From e02b9efcc405ca4324a310b8d893b9dacbf2b3c3 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Fri, 10 Nov 2023 02:28:33 +0000 Subject: [PATCH] tegra_hv: Enable driver for Linux 6.2 and above The driver tegra_hv was disabled for the Linux 6.2 and above due to build failure. All build issue is fixed and re-enabling driver for all kernel. Bug 4370594 Change-Id: I9edef01a4f204b138204d583d9f7f61dc6112a25 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3014191 (cherry picked from commit af936f3b1eb2bad44334c1682167b01f70e1af2e) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059175 Tested-by: Jonathan Hunter Reviewed-by: Jonathan Hunter GVS: Gerrit_Virtual_Submit --- drivers/virt/tegra/Makefile | 7 ------- include/soc/tegra/virt/hv-ivc.h | 8 +++----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/virt/tegra/Makefile b/drivers/virt/tegra/Makefile index 47f1a11c..2a0db74e 100644 --- a/drivers/virt/tegra/Makefile +++ b/drivers/virt/tegra/Makefile @@ -4,16 +4,9 @@ # # Makefile for Hypervisor interface # - -LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) -LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2) - -# tegra_hv is 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) ifdef CONFIG_TEGRA_VIRTUALIZATION obj-m += tegra_hv.o endif -endif obj-m += tegra_hv_pm_ctl.o obj-m += hvc_sysfs.o obj-m += ivc-cdev.o diff --git a/include/soc/tegra/virt/hv-ivc.h b/include/soc/tegra/virt/hv-ivc.h index 4dd678e3..3e03cd93 100644 --- a/include/soc/tegra/virt/hv-ivc.h +++ b/include/soc/tegra/virt/hv-ivc.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ #ifndef __TEGRA_HV_IVC_H @@ -32,7 +32,7 @@ struct tegra_hv_ivm_cookie { void *reserved; }; -#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) && defined(CONFIG_TEGRA_VIRTUALIZATION) +#if defined(CONFIG_TEGRA_VIRTUALIZATION) bool is_tegra_hypervisor_mode(void); /** @@ -451,8 +451,6 @@ static inline struct tegra_ivc *tegra_hv_ivc_convert_cookie( { return ERR_PTR(-ENOTSUPP); }; -#endif /* (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) && - * defined(CONFIG_TEGRA_VIRTUALIZATION) - */ +#endif /* defined(CONFIG_TEGRA_VIRTUALIZATION) */ #endif /* __TEGRA_HV_IVC_H */