From 4269d56d02db3278270e8d49d3ec402f5a0a1189 Mon Sep 17 00:00:00 2001 From: Dmitry Pervushin Date: Fri, 15 Feb 2019 17:14:35 +0100 Subject: nvgpu: more changes to clean loading/unloading Bug 200487652 Change-Id: Ib52cc6a85a19ea0396c8ab584c5ce9970f93085a Signed-off-by: Dmitry Pervushin 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) Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/scale.c | 11 ++--------- drivers/gpu/nvgpu/vgpu/vgpu.c | 4 +++- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'drivers/gpu') 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) profile->devfreq_profile.get_cur_freq = get_cur_freq; profile->devfreq_profile.polling_ms = 25; - devfreq = devfreq_add_device(dev, + devfreq = devm_devfreq_add_device(dev, &profile->devfreq_profile, platform->devfreq_governor, NULL); - if (IS_ERR(devfreq)) + if (IS_ERR_OR_NULL(devfreq)) devfreq = NULL; l->devfreq = devfreq; @@ -401,8 +401,6 @@ void gk20a_scale_exit(struct device *dev) { struct gk20a_platform *platform = dev_get_drvdata(dev); struct gk20a *g = platform->g; - struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); - int err; #ifdef CONFIG_GK20A_PM_QOS if (platform->qos_notify) { @@ -413,11 +411,6 @@ void gk20a_scale_exit(struct device *dev) } #endif - if (platform->devfreq_governor) { - err = devfreq_remove_device(l->devfreq); - l->devfreq = NULL; - } - nvgpu_kfree(g, g->scale_profile); g->scale_profile = NULL; } 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) msg.event = TEGRA_VGPU_EVENT_ABORT; err = vgpu_ivc_send(vgpu_ivc_get_peer_self(), TEGRA_VGPU_QUEUE_INTR, &msg, sizeof(msg)); - WARN_ON(err); + if (err) + nvgpu_log_info(g, "vgpu_ivc_send_returned %d\n", err); + nvgpu_thread_stop(&priv->intr_handler); nvgpu_clk_arb_cleanup_arbiter(g); -- cgit v1.2.2