From 3d9b7847d971ba405bf5459fd01bf60ae694300a Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 25 Apr 2017 09:44:39 -0700 Subject: gpu: nvgpu: Use nvgpu_thread for VGPU interrupts Use nvgpu_thread for launching the thread for polling VGPU interrupts. JIRA NVGPU-14 Change-Id: I7114336bb37c407ee7365c4442e1826d80575771 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1469650 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Richard Zhao Reviewed-by: Alex Waterman Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/vgpu/vgpu.c | 13 +++++++------ drivers/gpu/nvgpu/vgpu/vgpu.h | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index eb221d01..7e012fb0 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -13,7 +13,6 @@ * more details. */ -#include #include #include #include @@ -134,6 +133,7 @@ static void vgpu_handle_channel_event(struct gk20a *g, static int vgpu_intr_thread(void *dev_id) { struct gk20a *g = dev_id; + struct vgpu_priv_data *priv = vgpu_get_priv_data(g); while (true) { struct tegra_vgpu_intr_msg *msg; @@ -188,7 +188,7 @@ static int vgpu_intr_thread(void *dev_id) tegra_gr_comm_release(handle); } - while (!kthread_should_stop()) + while (!nvgpu_thread_should_stop(&priv->intr_handler)) msleep(10); return 0; } @@ -219,7 +219,7 @@ static void vgpu_remove_support(struct gk20a *g) TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR, &msg, sizeof(msg)); WARN_ON(err); - kthread_stop(priv->intr_handler); + nvgpu_thread_stop(&priv->intr_handler); /* free mappings to registers, etc*/ @@ -650,9 +650,10 @@ int vgpu_probe(struct platform_device *pdev) return err; } - priv->intr_handler = kthread_run(vgpu_intr_thread, gk20a, "gk20a"); - if (IS_ERR(priv->intr_handler)) - return -ENOMEM; + err = nvgpu_thread_create(&priv->intr_handler, gk20a, + vgpu_intr_thread, "gk20a"); + if (err) + return err; gk20a_debug_init(dev, "gpu.0"); diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h index 7883abc1..ac261979 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/vgpu/vgpu.h @@ -20,11 +20,13 @@ #include #include "gk20a/gk20a.h" +#include + #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION struct vgpu_priv_data { u64 virt_handle; - struct task_struct *intr_handler; + struct nvgpu_thread intr_handler; struct tegra_vgpu_constants_params constants; }; -- cgit v1.2.2