diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 18 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 3 |
2 files changed, 12 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 6db08a61..9902cb5e 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -16,7 +16,6 @@ | |||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/kthread.h> | ||
20 | #include <trace/events/gk20a.h> | 19 | #include <trace/events/gk20a.h> |
21 | #include <linux/dma-buf.h> | 20 | #include <linux/dma-buf.h> |
22 | 21 | ||
@@ -1780,7 +1779,7 @@ static int gk20a_channel_poll_worker(void *arg) | |||
1780 | gk20a_dbg_fn(""); | 1779 | gk20a_dbg_fn(""); |
1781 | 1780 | ||
1782 | start_wait = jiffies; | 1781 | start_wait = jiffies; |
1783 | while (!kthread_should_stop()) { | 1782 | while (!nvgpu_thread_should_stop(&worker->poll_task)) { |
1784 | bool got_events; | 1783 | bool got_events; |
1785 | 1784 | ||
1786 | got_events = wait_event_timeout( | 1785 | got_events = wait_event_timeout( |
@@ -1804,26 +1803,29 @@ static int gk20a_channel_poll_worker(void *arg) | |||
1804 | */ | 1803 | */ |
1805 | int nvgpu_channel_worker_init(struct gk20a *g) | 1804 | int nvgpu_channel_worker_init(struct gk20a *g) |
1806 | { | 1805 | { |
1807 | struct task_struct *task; | 1806 | int err; |
1807 | char thread_name[64]; | ||
1808 | 1808 | ||
1809 | atomic_set(&g->channel_worker.put, 0); | 1809 | atomic_set(&g->channel_worker.put, 0); |
1810 | init_waitqueue_head(&g->channel_worker.wq); | 1810 | init_waitqueue_head(&g->channel_worker.wq); |
1811 | nvgpu_init_list_node(&g->channel_worker.items); | 1811 | nvgpu_init_list_node(&g->channel_worker.items); |
1812 | nvgpu_spinlock_init(&g->channel_worker.items_lock); | 1812 | nvgpu_spinlock_init(&g->channel_worker.items_lock); |
1813 | task = kthread_run(gk20a_channel_poll_worker, g, | 1813 | snprintf(thread_name, sizeof(thread_name), |
1814 | "nvgpu_channel_poll_%s", g->name); | 1814 | "nvgpu_channel_poll_%s", g->name); |
1815 | if (IS_ERR(task)) { | 1815 | |
1816 | err = nvgpu_thread_create(&g->channel_worker.poll_task, g, | ||
1817 | gk20a_channel_poll_worker, thread_name); | ||
1818 | if (err) { | ||
1816 | nvgpu_err(g, "failed to start channel poller thread"); | 1819 | nvgpu_err(g, "failed to start channel poller thread"); |
1817 | return PTR_ERR(task); | 1820 | return err; |
1818 | } | 1821 | } |
1819 | g->channel_worker.poll_task = task; | ||
1820 | 1822 | ||
1821 | return 0; | 1823 | return 0; |
1822 | } | 1824 | } |
1823 | 1825 | ||
1824 | void nvgpu_channel_worker_deinit(struct gk20a *g) | 1826 | void nvgpu_channel_worker_deinit(struct gk20a *g) |
1825 | { | 1827 | { |
1826 | kthread_stop(g->channel_worker.poll_task); | 1828 | nvgpu_thread_stop(&g->channel_worker.poll_task); |
1827 | } | 1829 | } |
1828 | 1830 | ||
1829 | /** | 1831 | /** |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index c9a2ee93..7ac1d909 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -32,6 +32,7 @@ struct dbg_profiler_object_data; | |||
32 | 32 | ||
33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
34 | #include <nvgpu/lock.h> | 34 | #include <nvgpu/lock.h> |
35 | #include <nvgpu/thread.h> | ||
35 | #include <linux/irqreturn.h> | 36 | #include <linux/irqreturn.h> |
36 | #include <linux/version.h> | 37 | #include <linux/version.h> |
37 | #include <linux/cdev.h> | 38 | #include <linux/cdev.h> |
@@ -1142,7 +1143,7 @@ struct gk20a { | |||
1142 | wait_queue_head_t sw_irq_nonstall_last_handled_wq; | 1143 | wait_queue_head_t sw_irq_nonstall_last_handled_wq; |
1143 | 1144 | ||
1144 | struct gk20a_channel_worker { | 1145 | struct gk20a_channel_worker { |
1145 | struct task_struct *poll_task; | 1146 | struct nvgpu_thread poll_task; |
1146 | atomic_t put; | 1147 | atomic_t put; |
1147 | wait_queue_head_t wq; | 1148 | wait_queue_head_t wq; |
1148 | struct nvgpu_list_node items; | 1149 | struct nvgpu_list_node items; |