ll_schedule_domain: pass task during unregistration

Changes domain_unregister operation to also receive task
being unregistered.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2019-10-10 10:17:09 +02:00 committed by Liam Girdwood
parent cb5506f0b9
commit b734091d63
5 changed files with 12 additions and 7 deletions

View File

@ -30,7 +30,7 @@ struct ll_schedule_domain_ops {
uint64_t period, struct task *task,
void (*handler)(void *arg), void *arg);
void (*domain_unregister)(struct ll_schedule_domain *domain,
uint32_t num_tasks);
struct task *task, uint32_t num_tasks);
void (*domain_enable)(struct ll_schedule_domain *domain, int core);
void (*domain_disable)(struct ll_schedule_domain *domain, int core);
void (*domain_set)(struct ll_schedule_domain *domain, uint64_t start);
@ -85,11 +85,11 @@ static inline int domain_register(struct ll_schedule_domain *domain,
}
static inline void domain_unregister(struct ll_schedule_domain *domain,
uint32_t num_tasks)
struct task *task, uint32_t num_tasks)
{
assert(domain->ops->domain_unregister);
domain->ops->domain_unregister(domain, num_tasks);
domain->ops->domain_unregister(domain, task, num_tasks);
}
static inline void domain_enable(struct ll_schedule_domain *domain, int core)

View File

@ -172,9 +172,11 @@ static void dma_multi_chan_domain_irq_unregister(struct dma_domain_data *data)
/**
* \brief Unregisters task from DMA domain.
* \param[in,out] domain Pointer to schedule domain.
* \param[in,out] task Task to be unregistered from the domain..
* \param[in] num_tasks Number of currently scheduled tasks.
*/
static void dma_multi_chan_domain_unregister(struct ll_schedule_domain *domain,
struct task *task,
uint32_t num_tasks)
{
struct dma_domain *dma_domain = ll_sch_domain_get_pdata(domain);

View File

@ -333,9 +333,11 @@ static void dma_domain_unregister_owner(struct ll_schedule_domain *domain,
/**
* \brief Unregisters task from DMA domain.
* \param[in,out] domain Pointer to schedule domain.
* \param[in,out] task Task to be unregistered from the domain.
* \param[in] num_tasks Number of currently scheduled tasks.
*/
static void dma_single_chan_domain_unregister(struct ll_schedule_domain *domain,
struct task *task,
uint32_t num_tasks)
{
struct dma_domain *dma_domain = ll_sch_domain_get_pdata(domain);

View File

@ -191,7 +191,8 @@ static int schedule_ll_domain_set(struct ll_schedule_data *sch,
return 0;
}
static void schedule_ll_domain_clear(struct ll_schedule_data *sch)
static void schedule_ll_domain_clear(struct ll_schedule_data *sch,
struct task *task)
{
spin_lock(sch->domain->lock);
@ -212,7 +213,7 @@ static void schedule_ll_domain_clear(struct ll_schedule_data *sch)
spin_unlock(sch->domain->lock);
domain_unregister(sch->domain, atomic_read(&sch->num_tasks));
domain_unregister(sch->domain, task, atomic_read(&sch->num_tasks));
}
static void schedule_ll_task_insert(struct task *task, struct list_item *tasks)
@ -339,7 +340,7 @@ static void schedule_ll_task_cancel(void *data, struct task *task)
/* found it */
if (curr_task == task) {
schedule_ll_domain_clear(sch);
schedule_ll_domain_clear(sch, task);
break;
}
}

View File

@ -56,7 +56,7 @@ static int timer_domain_register(struct ll_schedule_domain *domain,
}
static void timer_domain_unregister(struct ll_schedule_domain *domain,
uint32_t num_tasks)
struct task *task, uint32_t num_tasks)
{
struct timer_domain *timer_domain = ll_sch_domain_get_pdata(domain);
int core = cpu_get_id();