gpu: nvgpu: support module parameters for devfreq

For POR like safety GPU, we may specify devfreq
timer and governor to keep GPU running with high
performance.

This change supports module parameters for
specifying devfreq governor and devfreq timer.

safety nvgpu module parameter example:
devfreq_timer="delayed" devfreq_gov="performance"

Regarding devfreq timers, a delayed timer can
ensure that the devfreq monitor polls on time.
However, a deferrable timer might potentially
cause a delay in polling time.

Regarding devfreq governors, the default governor
of nvgpu is nvhost_podgov, which scales the gpu
frequency based on GPU load reported by PMU.
Using the performance governor will keep the GPU
operating at a higher GPU frequency,
providing better performance.

Bug 4084478

Change-Id: I9dfef11648203c6af281e980d3a5790b36742414
Signed-off-by: shaochunk <shaochunk@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2978810
Reviewed-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
shaochunk
2023-09-12 15:23:35 +08:00
committed by mobile promotions
parent d28dda7149
commit 7a65a3e636
4 changed files with 59 additions and 22 deletions

View File

@@ -115,6 +115,16 @@
#define CREATE_TRACE_POINTS
#include <nvgpu/trace.h>
char *nvgpu_devfreq_timer = "";
module_param_named(devfreq_timer, nvgpu_devfreq_timer, charp, 0400);
MODULE_PARM_DESC(devfreq_timer,
"Specify gpu devfreq governor with module parameter.");
char *nvgpu_devfreq_gov = "";
module_param_named(devfreq_gov, nvgpu_devfreq_gov, charp, 0400);
MODULE_PARM_DESC(devfreq_gov,
"Specify gpu devfreq governor with module parameter.");
int nvgpu_lpwr_enable;
module_param_named(lpwr_enable, nvgpu_lpwr_enable, int, 0400);
MODULE_PARM_DESC(lpwr_enable,