linux-stable/drivers/media/platform
Ming Qian f9c8ddce2f media: amphion: remove mutext lock in condition of wait_event
mutext_lock should not be called in condition of wait_event, otherwise,
when CONFIG_DEBUG_ATOMIC_SLEEP is enabled, we may meet the following
warning:
do not call blocking ops when !TASK_RUNNING; state=2
WARNING: CPU: 5 PID: 741 at kernel/sched/core.c:9859
__might_sleep+0x80/0xa4
Hardware name: Freescale i.MX8QM MEK (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)  pc :
__might_sleep+0x80/0xa4  lr : __might_sleep+0x80/0xa4  sp : ffffffc0123738a0
x29: ffffffc0123738a0 x28: ffffffc009194c48 x27: ffffffc00bbc1050
x26: ffffff8814b282f0 x25: ffffff8814b280d0 x24: ffffff8814b28080
x23: 0000000000000001 x22: 0000000000000032 x21: ffffffc00bbc1000
x20: 000000000000011b x19: ffffffc009324670 x18: 00000000fffffffd
x17: 30303c5b20746120 x16: 74657320323d6574 x15: 617473203b474e49
x14: 00058b5b8b9aa1f1 x13: ffffffc00903cda0 x12: 00000000d744fcc9
x11: 000000000000001c x10: 00000000000009a0 x9 : ffffffc0090201f4
x8 : ffffff8828245000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : 00000000410fd080 x4 : 0000000000000002 x3 : ffffff8815aab4c8
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff8828244600
Call trace:
 __might_sleep+0x80/0xa4
 mutex_lock+0x2c/0x80
 sync_session_response+0x110/0x310
 vpu_session_send_cmd+0x18c/0x244
 vpu_session_start+0x38/0x70
 vdec_start_session+0x1b4/0x3e0
 vpu_vb2_start_streaming+0xa0/0x1c4
 vb2_start_streaming+0x74/0x160
 vb2_core_qbuf+0x488/0x650
 vb2_qbuf+0x9c/0x100
 v4l2_m2m_qbuf+0x7c/0x224
 v4l2_m2m_ioctl_qbuf+0x20/0x2c
 v4l_qbuf+0x50/0x6c
 __video_do_ioctl+0x174/0x3f0
 video_usercopy+0x210/0x7cc
 video_ioctl2+0x20/0x30
 v4l2_ioctl+0x48/0x6c

we need to refine check_is_responsed() to remove the mutext_lock, each
cmd has a monotonically increasing id, and cmds are executed
sequentially, so we can check the id of the last reponsed cmd, then
determine whether a command has been responded or not.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
CC: Xiaolei Wang <xiaolei.wang@windriver.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-12-13 11:04:45 +01:00
..
allegro-dvt media: allegro: Annotate struct mcu_msg_push_buffers_internal with __counted_by 2023-10-07 10:55:45 +02:00
amlogic media: ge2d: Convert to platform remove callback returning void 2023-04-11 16:59:14 +02:00
amphion media: amphion: remove mutext lock in condition of wait_event 2023-12-13 11:04:45 +01:00
aspeed media: aspeed: Drop unnecessary error check for debugfs_create_file() 2023-10-13 11:33:22 +02:00
atmel media: v4l: subdev: Switch to stream-aware state functions 2023-11-23 18:57:47 +01:00
cadence media: v4l2-subdev: Rename .init_cfg() operation to .init_state() 2023-12-04 10:37:47 +01:00
chips-media media: chips-media: wave5: Requires GENERIC_ALLOCATOR 2023-12-13 09:43:45 +01:00
intel media: pxa_camera: Fix an error handling path in pxa_camera_probe() 2023-10-02 10:02:53 +02:00
marvell media: v4l: Use correct dependency for camera sensor drivers 2023-09-14 12:38:17 +02:00
mediatek media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP 2023-12-07 08:31:14 +01:00
microchip media: microchip-isc: Remove dead code in pipeline validation 2023-12-04 11:21:46 +01:00
nuvoton media: nuvoton: npcm-video: Fix sleeping in atomic context 2023-11-23 13:34:22 +01:00
nvidia media: vde: Use struct_size() 2023-11-23 13:33:38 +01:00
nxp media: nxp: imx8-isi-debug: Add missing 36-Bit DMA registers to debugfs output 2023-12-09 07:40:23 +01:00
qcom media: venus: core: Set up secure memory ranges for SC7280 2023-12-12 08:54:54 +01:00
renesas media: v4l2-subdev: Rename .init_cfg() operation to .init_state() 2023-12-04 10:37:47 +01:00
rockchip media: rkisp1: resizer: Stop manual allocation of v4l2_subdev_state 2023-12-09 07:47:10 +01:00
samsung media: exynos-gsc: remove unused improper CONFIG definition 2023-12-07 08:31:14 +01:00
st media: stm32-dcmipp: STM32 DCMIPP camera interface driver 2023-12-04 10:37:47 +01:00
sunxi media: v4l2-subdev: Rename .init_cfg() operation to .init_state() 2023-12-04 10:37:47 +01:00
ti media: v4l2-subdev: Rename .init_cfg() operation to .init_state() 2023-12-04 10:37:47 +01:00
verisilicon media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls 2023-11-23 13:57:20 +01:00
via media: via: Use correct dependency for camera sensor drivers 2023-09-14 12:38:17 +02:00
xilinx media: v4l2-subdev: Rename .init_cfg() operation to .init_state() 2023-12-04 10:37:47 +01:00
Kconfig media: nuvoton: Add driver for NPCM video capture and encoding engine 2023-09-27 09:40:02 +02:00
m2m-deinterlace.c media: m2m-deinterlace: Convert to platform remove callback returning void 2023-04-11 16:59:15 +02:00
Makefile media: nuvoton: Add driver for NPCM video capture and encoding engine 2023-09-27 09:40:02 +02:00
video-mux.c media: v4l2-subdev: Rename .init_cfg() operation to .init_state() 2023-12-04 10:37:47 +01:00