video : rockchip: mpp: issue for delay work timeout and isr handle

if task entry into the state of isr or delay work, the other cannot
entry again.

Change-Id: I953798de4a57829c4734709f7167d6eab167482b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This commit is contained in:
Ding Wei
2020-05-22 11:10:15 +08:00
committed by Tao Huang
parent bfb2ae12fe
commit 7e2e3d6b78

View File

@@ -302,6 +302,8 @@ static void mpp_task_timeout_work(struct work_struct *work_s)
timeout_work);
mpp_err("task %p processing timed out!\n", task);
/* if hardware timeout, task must abort */
atomic_inc(&task->abort_request);
if (!task->session) {
mpp_err("task %p, task->session is null.\n", task);
@@ -1671,15 +1673,23 @@ irqreturn_t mpp_dev_isr_sched(int irq, void *param)
{
irqreturn_t ret = IRQ_NONE;
struct mpp_dev *mpp = param;
struct mpp_task *task = mpp->cur_task;
if (task) {
/* if wait or delayed work timeout, abort request will turn on,
* isr should not to response, and handle it in delayed work
*/
if (atomic_read(&task->abort_request) > 0)
return IRQ_HANDLED;
task->state = TASK_STATE_IRQ;
cancel_delayed_work(&task->timeout_work);
}
if (mpp->hw_ops->reduce_freq &&
list_empty(&mpp->queue->pending_list))
mpp->hw_ops->reduce_freq(mpp);
if (mpp->cur_task) {
mpp->cur_task->state = TASK_STATE_IRQ;
cancel_delayed_work(&mpp->cur_task->timeout_work);
}
if (mpp->dev_ops->isr)
ret = mpp->dev_ops->isr(mpp);