summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.c22
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.h1
3 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 3d887d85..7b0db427 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -1460,6 +1460,9 @@ static int __exit gk20a_remove(struct platform_device *dev)
1460 cfb_remove_device(&dev->dev); 1460 cfb_remove_device(&dev->dev);
1461#endif 1461#endif
1462 1462
1463 if (IS_ENABLED(CONFIG_GK20A_DEVFREQ))
1464 gk20a_scale_exit(dev);
1465
1463 if (g->remove_support) 1466 if (g->remove_support)
1464 g->remove_support(dev); 1467 g->remove_support(dev);
1465 1468
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
index d09a18f8..7efd07bf 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
@@ -312,6 +312,28 @@ err_get_freqs:
312 g->scale_profile = NULL; 312 g->scale_profile = NULL;
313} 313}
314 314
315void gk20a_scale_exit(struct platform_device *pdev)
316{
317 struct gk20a_platform *platform = platform_get_drvdata(pdev);
318 struct gk20a *g = platform->g;
319 int err;
320
321 if (platform->qos_id < PM_QOS_NUM_CLASSES &&
322 platform->qos_id != PM_QOS_RESERVED &&
323 platform->postscale) {
324 pm_qos_remove_notifier(platform->qos_id,
325 &g->scale_profile->qos_notify_block);
326 }
327
328 if (platform->devfreq_governor) {
329 err = devfreq_remove_device(g->devfreq);
330 g->devfreq = NULL;
331 }
332
333 kfree(g->scale_profile);
334 g->scale_profile = NULL;
335}
336
315/* 337/*
316 * gk20a_scale_hw_init(dev) 338 * gk20a_scale_hw_init(dev)
317 * 339 *
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.h b/drivers/gpu/nvgpu/gk20a/gk20a_scale.h
index 81c23b68..5a9eff97 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.h
@@ -35,6 +35,7 @@ struct gk20a_scale_profile {
35 35
36/* Initialization and de-initialization for module */ 36/* Initialization and de-initialization for module */
37void gk20a_scale_init(struct platform_device *); 37void gk20a_scale_init(struct platform_device *);
38void gk20a_scale_exit(struct platform_device *);
38void gk20a_scale_hw_init(struct platform_device *pdev); 39void gk20a_scale_hw_init(struct platform_device *pdev);
39 40
40#ifdef CONFIG_GK20A_DEVFREQ 41#ifdef CONFIG_GK20A_DEVFREQ