From 8cb147aa88727ce1ba0559b65823d987b6a2e1e1 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Wed, 6 Jul 2022 14:31:07 +0530 Subject: [PATCH] gpu: nvgpu: add a soft dependency on podgov module The present implementation of podgov driver doesn't export any symbols and as a result, the dependency between NVGPU driver and podgov is not established by depmod. Fix that by adding a soft dependency. MODULE_SOFTDEP("pre: governor_pod_scaling"); This allows loading the podgov governor before nvgpu driver. Bug 3674235 Signed-off-by: Debarshi Dutta Change-Id: Id1959639399042f488cdaa30372feb65d8f21aaa Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2740446 (cherry picked from commit e4b34998506c06b56693c4d8ea00ebc25b2b7abf) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2741188 Reviewed-by: Jonathan Hunter Reviewed-by: Sagar Kamble Reviewed-by: Bibek Basu Tested-by: Jonathan Hunter GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/module.c | 3 +++ drivers/gpu/nvgpu/os/linux/scale.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 163ab1f74..3ac326b00 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -2050,6 +2050,9 @@ static void __exit gk20a_exit(void) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) MODULE_IMPORT_NS(DMA_BUF); #endif +#ifdef CONFIG_GK20A_DEVFREQ +MODULE_SOFTDEP("pre: governor_pod_scaling_v2"); +#endif MODULE_LICENSE("GPL v2"); module_init(gk20a_init); module_exit(gk20a_exit); diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index f78f99b1d..3ab9c9331 100644 --- a/drivers/gpu/nvgpu/os/linux/scale.c +++ b/drivers/gpu/nvgpu/os/linux/scale.c @@ -441,8 +441,11 @@ void gk20a_scale_init(struct device *dev) &profile->devfreq_profile, platform->devfreq_governor, NULL); - if (IS_ERR(devfreq)) + if (IS_ERR(devfreq)) { devfreq = NULL; + } else { + nvgpu_info(g, "enabled scaling for GPU\n"); + } l->devfreq = devfreq;