Lines Matching refs:ipc_task
14 struct ipc_task_queue *ipc_task = (struct ipc_task_queue *)data; in ipc_task_queue_handler() local
15 unsigned int q_rpos = ipc_task->q_rpos; in ipc_task_queue_handler()
18 while (q_rpos != ipc_task->q_wpos) { in ipc_task_queue_handler()
20 struct ipc_task_queue_args *args = &ipc_task->args[q_rpos]; in ipc_task_queue_handler()
52 ipc_task->q_rpos = q_rpos; in ipc_task_queue_handler()
57 static void ipc_task_queue_cleanup(struct ipc_task_queue *ipc_task) in ipc_task_queue_cleanup() argument
59 unsigned int q_rpos = ipc_task->q_rpos; in ipc_task_queue_cleanup()
61 while (q_rpos != ipc_task->q_wpos) { in ipc_task_queue_cleanup()
62 struct ipc_task_queue_args *args = &ipc_task->args[q_rpos]; in ipc_task_queue_cleanup()
71 ipc_task->q_rpos = q_rpos; in ipc_task_queue_cleanup()
83 struct tasklet_struct *ipc_tasklet = ipc_imem->ipc_task->ipc_tasklet; in ipc_task_queue_add_task()
84 struct ipc_task_queue *ipc_task = &ipc_imem->ipc_task->ipc_queue; in ipc_task_queue_add_task() local
95 spin_lock_irqsave(&ipc_task->q_lock, flags); in ipc_task_queue_add_task()
97 pos = ipc_task->q_wpos; in ipc_task_queue_add_task()
101 if (nextpos != ipc_task->q_rpos) { in ipc_task_queue_add_task()
105 ipc_task->args[pos].arg = arg; in ipc_task_queue_add_task()
106 ipc_task->args[pos].msg = msg; in ipc_task_queue_add_task()
107 ipc_task->args[pos].func = func; in ipc_task_queue_add_task()
108 ipc_task->args[pos].ipc_imem = ipc_imem; in ipc_task_queue_add_task()
109 ipc_task->args[pos].size = size; in ipc_task_queue_add_task()
110 ipc_task->args[pos].is_copy = is_copy; in ipc_task_queue_add_task()
111 ipc_task->args[pos].completion = wait ? &completion : NULL; in ipc_task_queue_add_task()
112 ipc_task->args[pos].response = -1; in ipc_task_queue_add_task()
120 ipc_task->q_wpos = nextpos; in ipc_task_queue_add_task()
124 spin_unlock_irqrestore(&ipc_task->q_lock, flags); in ipc_task_queue_add_task()
131 result = ipc_task->args[pos].response; in ipc_task_queue_add_task()
134 dev_err(ipc_imem->ipc_task->dev, "queue is full"); in ipc_task_queue_add_task()
160 dev_err(imem->ipc_task->dev, in ipc_task_queue_send_task()
173 int ipc_task_init(struct ipc_task *ipc_task) in ipc_task_init() argument
175 struct ipc_task_queue *ipc_queue = &ipc_task->ipc_queue; in ipc_task_init()
177 ipc_task->ipc_tasklet = kzalloc(sizeof(*ipc_task->ipc_tasklet), in ipc_task_init()
180 if (!ipc_task->ipc_tasklet) in ipc_task_init()
188 tasklet_init(ipc_task->ipc_tasklet, ipc_task_queue_handler, in ipc_task_init()
193 void ipc_task_deinit(struct ipc_task *ipc_task) in ipc_task_deinit() argument
195 tasklet_kill(ipc_task->ipc_tasklet); in ipc_task_deinit()
197 kfree(ipc_task->ipc_tasklet); in ipc_task_deinit()
201 ipc_task_queue_cleanup(&ipc_task->ipc_queue); in ipc_task_deinit()