mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +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 Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com> Reviewed-by: Dinesh T <dt@nvidia.com> Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Ankur Kishore <ankkishore@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
a432d2adf3
commit
eacaf8cec2
@@ -17,6 +17,7 @@
|
||||
#define _GK20A_PLATFORM_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include <nvgpu/lock.h>
|
||||
#include <nvgpu/gk20a.h>
|
||||
@@ -264,11 +265,21 @@ struct gk20a_platform {
|
||||
* this governor to be used in scaling */
|
||||
const char *devfreq_governor;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||
/* Quality of service notifier callback for min frequency limit. */
|
||||
int (*qos_min_notify)(struct notifier_block *nb,
|
||||
unsigned long n, void *p);
|
||||
|
||||
/* Quality of service notifier callback for max frequency limit. */
|
||||
int (*qos_max_notify)(struct notifier_block *nb,
|
||||
unsigned long n, void *p);
|
||||
#else
|
||||
/* Quality of service notifier callback. If this is set, the scaling
|
||||
* routines will register a callback to Qos. Each time we receive
|
||||
* a new value, this callback gets called. */
|
||||
int (*qos_notify)(struct notifier_block *nb,
|
||||
unsigned long n, void *p);
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) */
|
||||
|
||||
/* Called as part of debug dump. If the gpu gets hung, this function
|
||||
* is responsible for delivering all necessary debug data of other
|
||||
|
||||
Reference in New Issue
Block a user