From 4ded4286d61477403d75f014c7f57b16dfdb8bb6 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Mon, 28 Aug 2023 08:45:50 +0000 Subject: [PATCH] platform: dce: prevent dce driver unloading DCE-KMD driver does not support reloading of the driver today. Support will be added in the future. As a WAR this patch prevents unloading of the driver. Bug 4239420 Change-Id: I29f60fbaaf99f5f4e22f75b6674bd1a543b83c1a Signed-off-by: Mahesh Kumar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2968906 Reviewed-by: Arun Swain Reviewed-by: Vinod Atyam GVS: Gerrit_Virtual_Submit Tested-by: Vinod Atyam --- drivers/platform/tegra/dce/dce-module.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/platform/tegra/dce/dce-module.c b/drivers/platform/tegra/dce/dce-module.c index 5b7515fd..5fce7704 100644 --- a/drivers/platform/tegra/dce/dce-module.c +++ b/drivers/platform/tegra/dce/dce-module.c @@ -254,6 +254,14 @@ static int tegra_dce_probe(struct platform_device *pdev) } } + /** + * FIXME: Allow tegra_dce.ko unloading. + */ + if (!try_module_get(THIS_MODULE)) { + dce_info(d, "Failed to get lock of DCE Module.\n"); + dce_info(d, "modprobe --remove of kernel modules depending on tegra_dce.ko will fail.\n"); + } + return 0; req_intr_err: