video: rockchip: mpp: Fix wait all the time when hw hang issue

When the dec hw is stuck, the software timeout is triggered.
the waiting thread should be awakened and return timeout at this time.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ifc1a6fbac4b4b328c7a2f5c8d8a6322fff222088
This commit is contained in:
Yandong Lin
2021-03-11 14:17:54 +08:00
committed by Tao Huang
parent 95c92f0df0
commit b3c39dfa96

View File

@@ -344,6 +344,10 @@ static void mpp_task_timeout_work(struct work_struct *work_s)
mpp_dev_reset(mpp);
mpp_power_off(mpp);
mpp_session_push_done(session, task);
/* Wake up the GET thread */
wake_up(&session->wait);
/* remove task from taskqueue running list */
set_bit(TASK_STATE_TIMEOUT, &task->state);
mpp_taskqueue_pop_running(mpp->queue, task);
@@ -663,6 +667,9 @@ static int mpp_wait_result(struct mpp_session *session,
if (mpp->dev_ops->result)
ret = mpp->dev_ops->result(mpp, task, msgs);
mpp_session_pop_done(session, task);
if (test_bit(TASK_STATE_TIMEOUT, &task->state))
ret = -ETIMEDOUT;
} else {
mpp_err("session %p task %p, not found in done list!\n",
session, task);