media: rockchip: vicap fixes error of buffer init

in the case, qbuf once before start stream, than start stream and qbuf other buffers

error info
WARNING: CPU: 2 PID: 2811 at drivers/media/common/videobuf2/videobuf2-core.c:2035 __vb2_queue_cancel+0x1f8/0x260
Modules linked in: bcmdhd(O) r8168
CPU: 2 PID: 2811 Comm: PPThread Tainted: G        W  O       6.1.99 #520
Hardware name: Rockchip RK3576 EVB1 V10 Board + Rockchip RK628 HDMI to MIPI Extboard (DT)
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __vb2_queue_cancel+0x1f8/0x260
lr : __vb2_queue_cancel+0x38/0x260
sp : ffffffc00d3d3aa0
x29: ffffffc00d3d3aa0 x28: 00000000400004d8 x27: ffffff80eaa3c520
x26: ffffff80c7886e80 x25: 0000000000000009 x24: 00000000000e001b
x23: ffffff80c6179880 x22: 0000000000000000 x21: ffffff80c4ae0a18
x20: ffffff80c4ae09f8 x19: ffffff80c4ae06a0 x18: ffffffc00a491070
x17: 696e696620676e69 x16: ffffffffffffffff x15: 0000000000000004
x14: ffffffc009fbbf80 x13: 0000000000003fff x12: 0000000000000003
x11: 0000000000000000 x10: 0000000000000000 x9 : 80d7bbf14371e500
x8 : 0000000000000001 x7 : 205b5d3937333231 x6 : 392e32393431205b
x5 : ffffffc00a3d9617 x4 : ffffffc00d3d3707 x3 : 0000000000000000
x2 : 0000000000000000 x1 : ffffff80eaa3bd00 x0 : ffffff80eaa3bd00
Call trace:
 __vb2_queue_cancel+0x1f8/0x260
 vb2_core_queue_release+0x20/0x50
 vb2_fop_release+0x98/0xb0
 rkcif_fh_release+0x30/0xb0
 v4l2_release+0x94/0xf0
 __fput+0x80/0x25c
 ____fput+0x10/0x1c
 task_work_run+0xb4/0xd8
 do_exit+0x294/0x9bc
 do_group_exit+0x70/0x98
 get_signal+0x72c/0x828
 do_notify_resume+0x134/0x2140
 el0_svc+0x4c/0x68
 el0t_64_sync_handler+0x68/0xb4
 el0t_64_sync+0x164/0x168

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I891866ffa8a3d14eddd2c03a693b39f392afb035
This commit is contained in:
Zefa Chen
2025-01-07 10:36:50 +08:00
committed by Tao Huang
parent fc85b5039f
commit 6b4ed2fa4f

View File

@@ -2695,8 +2695,6 @@ static void rkcif_assign_new_buffer_init(struct rkcif_stream *stream,
__func__, __LINE__, stream->id, stream->next_buf->vb.vb2_buf.index);
list_del(&stream->next_buf->queue);
atomic_inc(&buf_stream->sub_stream_buf_cnt);
} else if (stream->curr_buf) {
stream->next_buf = stream->curr_buf;
}
}
@@ -2718,6 +2716,8 @@ static void rkcif_assign_new_buffer_init(struct rkcif_stream *stream,
} else if (!stream->next_buf && stream->curr_buf) {
stream->next_buf = stream->curr_buf;
if (stream->lack_buf_cnt < 2)
stream->lack_buf_cnt++;
}
if (stream->next_buf) {
buff_addr_y = stream->next_buf->buff_addr[RKCIF_PLANE_Y];
@@ -5162,6 +5162,8 @@ static void rkcif_check_buffer_update_pingpong(struct rkcif_stream *stream,
stream->curr_buf == NULL ||
stream->next_buf == NULL) {
frame_phase = stream->frame_phase_cache;
if (dev->irq_stats.frm_end_cnt[stream->id] == 0)
frame_phase = CIF_CSI_FRAME1_READY;
if (!stream->is_line_wake_up ||
(stream->is_line_wake_up && stream->frame_idx < 2)) {
if (mbus_cfg->type == V4L2_MBUS_CSI2_DPHY ||