video: rockchip: mpp: fix access null task exception issue

Unable to handle kernel read from unreadable memory at virtual address 0000000000000000
Mem abort info:
  ESR = 0x96000005
  Exception class = DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000005
  CM = 0, WnR = 0
user pgtable: 4k pages, 39-bit VAs, pgdp =00000000c9324dfa
[0000000000000000] pgd=0000000000000000, pud=0000000000000000
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in: rk_vcodec bcmdhd [last unloaded: rk_vcodec]
Process queue_work0 (pid: 3128, stack limit = 0x00000000044997c1)
CPU: 2 PID: 3128 Comm: queue_work0 Not tainted 4.19.232 #439
Hardware name: Rockchip RK3528 EVB1 DDR4 V10 Board (DT)
pstate: a0400085 (NzCv daIf +PAN -UAO)
pc : __wake_up_common+0x58/0x170
lr : __wake_up_common_lock+0x90/0xe0
sp : ffffff801101bc50
x29: ffffff801101bc50 x28: 0000000000000000
x27: 0000000000000000 x26: 0000000000000003
x25: ffffffc043c62d70 x24: 0000000000000001
x23: ffffffc043c63908 x22: ffffff801101bcf0
x21: 0000000000000003 x20: ffffffffffffffe8
x19: 0000000000000000 x18: 0000000000000030
x17: 0000000000000000 x16: 0000000000000000
x15: ffffffffffffffff x14: 766365725f727369
x13: 5f6b6e696c5f6365 x12: 00000000000001d8
x11: 0000000000000000 x10: 0000000000000000
x9 : 0000000000000000 x8 : 0000000000000000
x7 : ffffffc07f75f340 x6 : 0000000000000000
x5 : ffffff801101bcf0 x4 : 0000000000000000
x3 : 0000000000000000 x2 : 0000000000000001
x1 : 0000000000000003 x0 : 0000000000000000
Call trace:
 __wake_up_common+0x58/0x170
 __wake_up_common_lock+0x90/0xe0
 __wake_up+0x14/0x20
 rkvdec2_link_worker+0xda4/0x12dc [rk_vcodec]
 kthread_worker_fn+0xbc/0x180
 kthread+0x12c/0x160
 ret_from_fork+0x10/0x20

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5129a1a52ffcf71775410c446ece4b5e85b812cc
This commit is contained in:
Yandong Lin
2022-12-21 16:13:00 +08:00
committed by Tao Huang
parent ecfc92e986
commit 98fe9965cc

View File

@@ -129,6 +129,8 @@ struct rkvdec_link_info rkvdec_link_rk356x_hw_info = {
.hack_setup = 1,
};
static void rkvdec2_link_free_task(struct kref *ref);
static void rkvdec_link_status_update(struct rkvdec_link_dev *dev)
{
void __iomem *reg_base = dev->reg_base;
@@ -641,6 +643,7 @@ static int rkvdec_link_isr_recv_task(struct mpp_dev *mpp,
set_bit(TASK_STATE_PROC_DONE, &mpp_task->state);
/* Wake up the GET thread */
wake_up(&task->wait);
kref_put(&mpp_task->ref, rkvdec2_link_free_task);
}
return 0;
@@ -1282,7 +1285,6 @@ static int mpp_session_pop_done(struct mpp_session *session,
struct mpp_task *task)
{
set_bit(TASK_STATE_DONE, &task->state);
kref_put(&task->ref, rkvdec2_link_free_task);
return 0;
}