mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: register pm_qos min & max frequency notifiers
nvpmodel updates the devfreq frequency limits as per power requirements
for specific chip. Clock arbiter ignored these limits and set clock
to maximum supported frequency which may lead to leaking power and
over heating.
Add support to get the devfreq limits by registering PM_QOS notifiers.
Note that with this patch we enable CONFIG_GK20A_PM_QOS when PM_DEVFREQ
is enabled. So it will be enabled for all supported kernels (4.9, 4.14
kernels continue to support this. For 5.10+ kernels notifiers added in
this patch will be used. Thermal framework related notifiers for kernels
after 4.14 will not be registered as those use downstream interfaces
that are not available.)
We maintain devfreq min/max limits in the scale profile and update those
in the notifier calls. We use these limits to clamp the frequency in the
clock arbiter.
Bug 3852824
Change-Id: I734a9fb080fee1a91e9b5da071b662dbd9a18682
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822686
(cherry picked from commit eacaf8cec2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822682
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
01eb416745
commit
9726ae3ba8
@@ -19,6 +19,7 @@
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <uapi/linux/nvgpu.h>
|
||||
@@ -205,7 +206,12 @@ static void nvgpu_init_pm_vars(struct gk20a *g)
|
||||
/* disable devfreq for pre-silicon */
|
||||
if (!nvgpu_platform_is_silicon(g)) {
|
||||
platform->devfreq_governor = NULL;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||
platform->qos_min_notify = NULL;
|
||||
platform->qos_max_notify = NULL;
|
||||
#else
|
||||
platform->qos_notify = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
nvgpu_set_enabled(g, NVGPU_GPU_CAN_ELCG,
|
||||
@@ -228,7 +234,12 @@ static void nvgpu_init_pm_vars(struct gk20a *g)
|
||||
platform->can_railgate_init = false;
|
||||
/* Disable frequency scaling for hypervisor platforms */
|
||||
platform->devfreq_governor = NULL;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||
platform->qos_min_notify = NULL;
|
||||
platform->qos_max_notify = NULL;
|
||||
#else
|
||||
platform->qos_notify = NULL;
|
||||
#endif
|
||||
} else {
|
||||
/* Always enable railgating on simulation platform */
|
||||
platform->can_railgate_init = nvgpu_platform_is_simulation(g) ?
|
||||
|
||||
Reference in New Issue
Block a user