summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-25 12:00:47 -0400
committerVarun Colbert <vcolbert@nvidia.com>2017-05-04 12:53:40 -0400
commitc43c3f9c2f4def3e2c09a6b837230ded82f1ea27 (patch)
tree365bee3a4584bc76850b958ecb95abed0c4e5429 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentfc95237cf08975983634fd6d3ad85634f80a8a55 (diff)
gpu: nvgpu: Use nvgpu_thread for channel worker
Use nvgpu_thread for channel worker. JIRA NVGPU-14 Change-Id: Idcb93d3096de06a1569dc3ea69890745b5805d67 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1472870 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c18
1 files changed, 10 insertions, 8 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 */
1805int nvgpu_channel_worker_init(struct gk20a *g) 1804int 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
1824void nvgpu_channel_worker_deinit(struct gk20a *g) 1826void 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/**