From 150beca33511dce72f33020f47615c1c7adbb8d1 Mon Sep 17 00:00:00 2001 From: Manish Bhardwaj Date: Sat, 21 Sep 2024 10:07:27 +0000 Subject: [PATCH] nvidia-oot: tegra_hv: add dummy driver support For some of the kernel tegra_hv is part of core kernel and hence it is nto required to use the OOT tegra_hv driver. However, some packaging still expect the tegra_hv.ko from the OOT path. To trick the packaging file, add dummy tegra_hv driver which does not have anything other than module_init/module_exit. Bug 4551265 Change-Id: I59f6233705e2cfb510470ae3b9c1ce7d39618330 Signed-off-by: Manish Bhardwaj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197802 Reviewed-by: Laxman Dewangan GVS: buildbot_gerritrpt Reviewed-by: Bharat Nihalani --- configs/Makefile.config.oot | 1 + drivers/virt/tegra/Makefile | 5 +++++ drivers/virt/tegra/tegra_hv_dummy.c | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 drivers/virt/tegra/tegra_hv_dummy.c diff --git a/configs/Makefile.config.oot b/configs/Makefile.config.oot index a8817404..cf1f42ad 100644 --- a/configs/Makefile.config.oot +++ b/configs/Makefile.config.oot @@ -4,3 +4,4 @@ # Kernel OOT specific environment variables to configure the OOT modules export NV_OOT_IVC_EXT_SKIP_BUILD=y +export NV_OOT_TEGRA_HV_SKIP_BUILD=y diff --git a/drivers/virt/tegra/Makefile b/drivers/virt/tegra/Makefile index 2a0db74e..3a5f3c42 100644 --- a/drivers/virt/tegra/Makefile +++ b/drivers/virt/tegra/Makefile @@ -5,7 +5,12 @@ # Makefile for Hypervisor interface # ifdef CONFIG_TEGRA_VIRTUALIZATION +ifneq ($(NV_OOT_TEGRA_HV_SKIP_BUILD),y) obj-m += tegra_hv.o +else +obj-m += tegra_hv.o +tegra_hv-objs := tegra_hv_dummy.o +endif endif obj-m += tegra_hv_pm_ctl.o obj-m += hvc_sysfs.o diff --git a/drivers/virt/tegra/tegra_hv_dummy.c b/drivers/virt/tegra/tegra_hv_dummy.c new file mode 100644 index 00000000..24e00d1b --- /dev/null +++ b/drivers/virt/tegra/tegra_hv_dummy.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#include + +static int __init tegra_hv_dummy_init(void) +{ + pr_info("Inserting dummy tegra_hv.ko module"); + return 0; +} +module_init(tegra_hv_dummy_init); + +static void __exit tegra_hv_dummy_exit(void) +{ + pr_info("Removing dummy tegra_hv.ko module"); +} +module_exit(tegra_hv_dummy_exit); + +MODULE_AUTHOR("Manish Bhardwaj "); +MODULE_DESCRIPTION("Tegra HV Dummy Driver"); +MODULE_LICENSE("GPL v2");