summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Pervushin <dpervushin@nvidia.com>2019-02-15 11:14:35 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2019-03-11 14:00:46 -0400
commit4269d56d02db3278270e8d49d3ec402f5a0a1189 (patch)
tree1fc03106cf45439646b349074947c572e8a90c0c
parent7c8d212b503bf9b0412afce25a038d0b7945d487 (diff)
nvgpu: more changes to clean loading/unloading
Bug 200487652 Change-Id: Ib52cc6a85a19ea0396c8ab584c5ce9970f93085a Signed-off-by: Dmitry Pervushin <dpervushin@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2020386 (cherry picked from commit 617dff478c3687a08ed5b77f4ac2073b290c57ea) Reviewed-on: https://git-master.nvidia.com/r/2035720 GVS: Gerrit_Virtual_Submit Reviewed-by: Rahul Jain (SW-TEGRA) <rahuljain@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/os/linux/scale.c11
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c4
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c
index d7a961c7..ee5b6861 100644
--- a/drivers/gpu/nvgpu/os/linux/scale.c
+++ b/drivers/gpu/nvgpu/os/linux/scale.c
@@ -368,11 +368,11 @@ void gk20a_scale_init(struct device *dev)
368 profile->devfreq_profile.get_cur_freq = get_cur_freq; 368 profile->devfreq_profile.get_cur_freq = get_cur_freq;
369 profile->devfreq_profile.polling_ms = 25; 369 profile->devfreq_profile.polling_ms = 25;
370 370
371 devfreq = devfreq_add_device(dev, 371 devfreq = devm_devfreq_add_device(dev,
372 &profile->devfreq_profile, 372 &profile->devfreq_profile,
373 platform->devfreq_governor, NULL); 373 platform->devfreq_governor, NULL);
374 374
375 if (IS_ERR(devfreq)) 375 if (IS_ERR_OR_NULL(devfreq))
376 devfreq = NULL; 376 devfreq = NULL;
377 377
378 l->devfreq = devfreq; 378 l->devfreq = devfreq;
@@ -401,8 +401,6 @@ void gk20a_scale_exit(struct device *dev)
401{ 401{
402 struct gk20a_platform *platform = dev_get_drvdata(dev); 402 struct gk20a_platform *platform = dev_get_drvdata(dev);
403 struct gk20a *g = platform->g; 403 struct gk20a *g = platform->g;
404 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
405 int err;
406 404
407#ifdef CONFIG_GK20A_PM_QOS 405#ifdef CONFIG_GK20A_PM_QOS
408 if (platform->qos_notify) { 406 if (platform->qos_notify) {
@@ -413,11 +411,6 @@ void gk20a_scale_exit(struct device *dev)
413 } 411 }
414#endif 412#endif
415 413
416 if (platform->devfreq_governor) {
417 err = devfreq_remove_device(l->devfreq);
418 l->devfreq = NULL;
419 }
420
421 nvgpu_kfree(g, g->scale_profile); 414 nvgpu_kfree(g, g->scale_profile);
422 g->scale_profile = NULL; 415 g->scale_profile = NULL;
423} 416}
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index c17a16df..5a3f0046 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -240,7 +240,9 @@ void vgpu_remove_support_common(struct gk20a *g)
240 msg.event = TEGRA_VGPU_EVENT_ABORT; 240 msg.event = TEGRA_VGPU_EVENT_ABORT;
241 err = vgpu_ivc_send(vgpu_ivc_get_peer_self(), TEGRA_VGPU_QUEUE_INTR, 241 err = vgpu_ivc_send(vgpu_ivc_get_peer_self(), TEGRA_VGPU_QUEUE_INTR,
242 &msg, sizeof(msg)); 242 &msg, sizeof(msg));
243 WARN_ON(err); 243 if (err)
244 nvgpu_log_info(g, "vgpu_ivc_send_returned %d\n", err);
245
244 nvgpu_thread_stop(&priv->intr_handler); 246 nvgpu_thread_stop(&priv->intr_handler);
245 247
246 nvgpu_clk_arb_cleanup_arbiter(g); 248 nvgpu_clk_arb_cleanup_arbiter(g);