From b3c39dfa967f0b34caf817843f60797d124f2ac9 Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Thu, 11 Mar 2021 14:17:54 +0800 Subject: [PATCH] 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 Change-Id: Ifc1a6fbac4b4b328c7a2f5c8d8a6322fff222088 --- drivers/video/rockchip/mpp/mpp_common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/video/rockchip/mpp/mpp_common.c b/drivers/video/rockchip/mpp/mpp_common.c index 18146a1ceca0..941e8f76dc46 100644 --- a/drivers/video/rockchip/mpp/mpp_common.c +++ b/drivers/video/rockchip/mpp/mpp_common.c @@ -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);