diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index d7a961c76..ee5b68612 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 c17a16dff..5a3f00462 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);