gpu: nvgpu: vgpu: fixed build errors for k5.9

- enable pm qos only on CONFIG_GK20A_PM_QOS enabled
- removed setting of devfreq->min_freq/max_freq. It's not support on
k5.9. For K4.14, we won't need it since the scale core code has setup
the freq table.

Jira GVSCI-7221

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I78fef76dfb82296250065065510cd1f044308bdf
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2421647
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Richard Zhao
2020-09-29 22:31:59 -07:00
committed by Alex Waterman
parent f3153a3ecc
commit 6be1d64a59

View File

@@ -234,6 +234,8 @@ done:
return err; return err;
} }
#ifdef CONFIG_GK20A_PM_QOS
static int vgpu_qos_notify(struct notifier_block *nb, static int vgpu_qos_notify(struct notifier_block *nb,
unsigned long n, void *data) unsigned long n, void *data)
{ {
@@ -286,13 +288,11 @@ static void vgpu_pm_qos_remove(struct device *dev)
g->scale_profile = NULL; g->scale_profile = NULL;
} }
#endif
static int vgpu_pm_init(struct device *dev) static int vgpu_pm_init(struct device *dev)
{ {
struct gk20a *g = get_gk20a(dev); struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = gk20a_get_platform(dev);
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
unsigned long *freqs;
int num_freqs;
int err = 0; int err = 0;
nvgpu_log_fn(g, " "); nvgpu_log_fn(g, " ");
@@ -305,22 +305,11 @@ static int vgpu_pm_init(struct device *dev)
if (IS_ENABLED(CONFIG_GK20A_DEVFREQ)) if (IS_ENABLED(CONFIG_GK20A_DEVFREQ))
gk20a_scale_init(dev); gk20a_scale_init(dev);
if (l->devfreq) { #ifdef CONFIG_GK20A_PM_QOS
/* set min/max frequency based on frequency table */
err = platform->get_clk_freqs(dev, &freqs, &num_freqs);
if (err)
return err;
if (num_freqs < 1)
return -EINVAL;
l->devfreq->min_freq = freqs[0];
l->devfreq->max_freq = freqs[num_freqs - 1];
}
err = vgpu_pm_qos_init(dev); err = vgpu_pm_qos_init(dev);
if (err) if (err)
return err; return err;
#endif
return err; return err;
} }
@@ -494,7 +483,9 @@ int vgpu_remove(struct platform_device *pdev)
gk20a_dma_buf_priv_list_clear(l); gk20a_dma_buf_priv_list_clear(l);
nvgpu_mutex_destroy(&l->dmabuf_priv_list_lock); nvgpu_mutex_destroy(&l->dmabuf_priv_list_lock);
#ifdef CONFIG_GK20A_PM_QOS
vgpu_pm_qos_remove(dev); vgpu_pm_qos_remove(dev);
#endif
if (g->remove_support) if (g->remove_support)
g->remove_support(g); g->remove_support(g);