Lines Matching refs:task
13 int __rxe_do_task(struct rxe_task *task) in __rxe_do_task() argument
18 while ((ret = task->func(task->arg)) == 0) in __rxe_do_task()
21 task->ret = ret; in __rxe_do_task()
36 struct rxe_task *task = from_tasklet(task, t, tasklet); in rxe_do_task() local
38 spin_lock_irqsave(&task->state_lock, flags); in rxe_do_task()
39 switch (task->state) { in rxe_do_task()
41 task->state = TASK_STATE_BUSY; in rxe_do_task()
42 spin_unlock_irqrestore(&task->state_lock, flags); in rxe_do_task()
46 task->state = TASK_STATE_ARMED; in rxe_do_task()
49 spin_unlock_irqrestore(&task->state_lock, flags); in rxe_do_task()
53 spin_unlock_irqrestore(&task->state_lock, flags); in rxe_do_task()
54 pr_warn("%s failed with bad state %d\n", __func__, task->state); in rxe_do_task()
60 ret = task->func(task->arg); in rxe_do_task()
62 spin_lock_irqsave(&task->state_lock, flags); in rxe_do_task()
63 switch (task->state) { in rxe_do_task()
66 task->state = TASK_STATE_START; in rxe_do_task()
76 task->state = TASK_STATE_BUSY; in rxe_do_task()
82 task->state); in rxe_do_task()
84 spin_unlock_irqrestore(&task->state_lock, flags); in rxe_do_task()
87 task->ret = ret; in rxe_do_task()
90 int rxe_init_task(void *obj, struct rxe_task *task, in rxe_init_task() argument
93 task->obj = obj; in rxe_init_task()
94 task->arg = arg; in rxe_init_task()
95 task->func = func; in rxe_init_task()
96 snprintf(task->name, sizeof(task->name), "%s", name); in rxe_init_task()
97 task->destroyed = false; in rxe_init_task()
99 tasklet_setup(&task->tasklet, rxe_do_task); in rxe_init_task()
101 task->state = TASK_STATE_START; in rxe_init_task()
102 spin_lock_init(&task->state_lock); in rxe_init_task()
107 void rxe_cleanup_task(struct rxe_task *task) in rxe_cleanup_task() argument
116 task->destroyed = true; in rxe_cleanup_task()
119 spin_lock_irqsave(&task->state_lock, flags); in rxe_cleanup_task()
120 idle = (task->state == TASK_STATE_START); in rxe_cleanup_task()
121 spin_unlock_irqrestore(&task->state_lock, flags); in rxe_cleanup_task()
124 tasklet_kill(&task->tasklet); in rxe_cleanup_task()
127 void rxe_run_task(struct rxe_task *task, int sched) in rxe_run_task() argument
129 if (task->destroyed) in rxe_run_task()
133 tasklet_schedule(&task->tasklet); in rxe_run_task()
135 rxe_do_task(&task->tasklet); in rxe_run_task()
138 void rxe_disable_task(struct rxe_task *task) in rxe_disable_task() argument
140 tasklet_disable(&task->tasklet); in rxe_disable_task()
143 void rxe_enable_task(struct rxe_task *task) in rxe_enable_task() argument
145 tasklet_enable(&task->tasklet); in rxe_enable_task()