From e81d0e8ff8df82dfe6991144b125da420d7e11da Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Mon, 2 May 2022 09:00:43 +0530 Subject: [PATCH] gpu: nvgpu: enable DEVFREQ for Sidecar Enable DEVFREQ for OOT module unconditionally as the podgov governor module. linux/pm_qos is only used for downstream supported modifications which is currently determined by CONFIG_GK20A_PM_QOS. struct devfreq_dev_status doesn't have any field 'busy' in the upstream driver hence enable it only for when downstream driver is in use activated by CONFIG_GK20A_PM_QOS. governor.h is only needed for android platforms which depend on 4.9 version of the kernel in downstream builds. Hence, added an compile time flag to remove it for kernels versions greater than 4.9. Jira LS-418 Signed-off-by: Debarshi Dutta Change-Id: Id242bd28e66ed187208f0d7975ee0bc508730a88 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2705766 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Jonathan Hunter Reviewed-by: Vijayakumar Subbu GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/Makefile.linux.configs | 2 +- drivers/gpu/nvgpu/os/linux/scale.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.linux.configs b/drivers/gpu/nvgpu/Makefile.linux.configs index a73a59525..0cd724cfc 100644 --- a/drivers/gpu/nvgpu/Makefile.linux.configs +++ b/drivers/gpu/nvgpu/Makefile.linux.configs @@ -193,7 +193,7 @@ endif # Set config for OOT module build ifeq ($(CONFIG_TEGRA_OOT_MODULE),m) -CONFIG_GK20A_DEVFREQ := n +CONFIG_GK20A_DEVFREQ := y CONFIG_GK20A_PM_QOS := n endif diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index b89928553..f78f99b1d 100644 --- a/drivers/gpu/nvgpu/os/linux/scale.c +++ b/drivers/gpu/nvgpu/os/linux/scale.c @@ -1,7 +1,7 @@ /* * gk20a clock scaling profile * - * Copyright (c) 2013-2021, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2013-2022, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -21,10 +21,14 @@ #include #endif #include +#ifdef CONFIG_GK20A_PM_QOS #include +#endif #include +#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 14, 0) #include +#endif #include #include @@ -403,7 +407,9 @@ void gk20a_scale_init(struct device *dev) return; profile->dev = dev; +#ifdef CONFIG_GK20A_PM_QOS profile->dev_stat.busy = false; +#endif /* Create frequency table */ err = gk20a_scale_make_freq_table(profile);