summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-25 12:44:39 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-12 19:08:59 -0400
commit3d9b7847d971ba405bf5459fd01bf60ae694300a (patch)
treeb240266f1e5078756214c6993d1b68b45a0a89e8 /drivers/gpu/nvgpu
parent72ded891014b18c9afffe44ea3013161339894de (diff)
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
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c13
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.h4
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 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#include <linux/kthread.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
18#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
19#include <linux/pm_runtime.h> 18#include <linux/pm_runtime.h>
@@ -134,6 +133,7 @@ static void vgpu_handle_channel_event(struct gk20a *g,
134static int vgpu_intr_thread(void *dev_id) 133static int vgpu_intr_thread(void *dev_id)
135{ 134{
136 struct gk20a *g = dev_id; 135 struct gk20a *g = dev_id;
136 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
137 137
138 while (true) { 138 while (true) {
139 struct tegra_vgpu_intr_msg *msg; 139 struct tegra_vgpu_intr_msg *msg;
@@ -188,7 +188,7 @@ static int vgpu_intr_thread(void *dev_id)
188 tegra_gr_comm_release(handle); 188 tegra_gr_comm_release(handle);
189 } 189 }
190 190
191 while (!kthread_should_stop()) 191 while (!nvgpu_thread_should_stop(&priv->intr_handler))
192 msleep(10); 192 msleep(10);
193 return 0; 193 return 0;
194} 194}
@@ -219,7 +219,7 @@ static void vgpu_remove_support(struct gk20a *g)
219 TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR, 219 TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR,
220 &msg, sizeof(msg)); 220 &msg, sizeof(msg));
221 WARN_ON(err); 221 WARN_ON(err);
222 kthread_stop(priv->intr_handler); 222 nvgpu_thread_stop(&priv->intr_handler);
223 223
224 /* free mappings to registers, etc*/ 224 /* free mappings to registers, etc*/
225 225
@@ -650,9 +650,10 @@ int vgpu_probe(struct platform_device *pdev)
650 return err; 650 return err;
651 } 651 }
652 652
653 priv->intr_handler = kthread_run(vgpu_intr_thread, gk20a, "gk20a"); 653 err = nvgpu_thread_create(&priv->intr_handler, gk20a,
654 if (IS_ERR(priv->intr_handler)) 654 vgpu_intr_thread, "gk20a");
655 return -ENOMEM; 655 if (err)
656 return err;
656 657
657 gk20a_debug_init(dev, "gpu.0"); 658 gk20a_debug_init(dev, "gpu.0");
658 659
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 @@
20#include <linux/tegra_vgpu.h> 20#include <linux/tegra_vgpu.h>
21#include "gk20a/gk20a.h" 21#include "gk20a/gk20a.h"
22 22
23#include <nvgpu/thread.h>
24
23#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION 25#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
24 26
25struct vgpu_priv_data { 27struct vgpu_priv_data {
26 u64 virt_handle; 28 u64 virt_handle;
27 struct task_struct *intr_handler; 29 struct nvgpu_thread intr_handler;
28 struct tegra_vgpu_constants_params constants; 30 struct tegra_vgpu_constants_params constants;
29}; 31};
30 32