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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1469650
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Terje Bergstrom
2017-04-25 09:44:39 -07:00
committed by mobile promotions
parent 72ded89101
commit 3d9b7847d9
2 changed files with 10 additions and 7 deletions

View File

@@ -13,7 +13,6 @@
* more details. * more details.
*/ */
#include <linux/kthread.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
@@ -134,6 +133,7 @@ static void vgpu_handle_channel_event(struct gk20a *g,
static int vgpu_intr_thread(void *dev_id) static int vgpu_intr_thread(void *dev_id)
{ {
struct gk20a *g = dev_id; struct gk20a *g = dev_id;
struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
while (true) { while (true) {
struct tegra_vgpu_intr_msg *msg; struct tegra_vgpu_intr_msg *msg;
@@ -188,7 +188,7 @@ static int vgpu_intr_thread(void *dev_id)
tegra_gr_comm_release(handle); tegra_gr_comm_release(handle);
} }
while (!kthread_should_stop()) while (!nvgpu_thread_should_stop(&priv->intr_handler))
msleep(10); msleep(10);
return 0; return 0;
} }
@@ -219,7 +219,7 @@ static void vgpu_remove_support(struct gk20a *g)
TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR, TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR,
&msg, sizeof(msg)); &msg, sizeof(msg));
WARN_ON(err); WARN_ON(err);
kthread_stop(priv->intr_handler); nvgpu_thread_stop(&priv->intr_handler);
/* free mappings to registers, etc*/ /* free mappings to registers, etc*/
@@ -650,9 +650,10 @@ int vgpu_probe(struct platform_device *pdev)
return err; return err;
} }
priv->intr_handler = kthread_run(vgpu_intr_thread, gk20a, "gk20a"); err = nvgpu_thread_create(&priv->intr_handler, gk20a,
if (IS_ERR(priv->intr_handler)) vgpu_intr_thread, "gk20a");
return -ENOMEM; if (err)
return err;
gk20a_debug_init(dev, "gpu.0"); gk20a_debug_init(dev, "gpu.0");

View File

@@ -20,11 +20,13 @@
#include <linux/tegra_vgpu.h> #include <linux/tegra_vgpu.h>
#include "gk20a/gk20a.h" #include "gk20a/gk20a.h"
#include <nvgpu/thread.h>
#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
struct vgpu_priv_data { struct vgpu_priv_data {
u64 virt_handle; u64 virt_handle;
struct task_struct *intr_handler; struct nvgpu_thread intr_handler;
struct tegra_vgpu_constants_params constants; struct tegra_vgpu_constants_params constants;
}; };