media: atomisp: Properly stop the ISP stream on sensor streamon errors
When v4l2_subdev_call(sensor, s_stream, 1) fails atomisp_start_streaming()
was not properly returning the buffer ownership back to the videobuf2-core
code, resulting in:
[ 1318.153447] ------------[ cut here ]------------
[ 1318.153499] WARNING: CPU: 0 PID: 4856 at drivers/media/common/videobuf2/videobuf2-core.c:1803 vb2_start_streaming+0xcb/0x160 [videobuf2_common]
...
[ 1318.154551] Call Trace:
[ 1318.154560] <TASK>
[ 1318.154571] ? __warn.cold+0xb7/0x14a
[ 1318.154591] ? vb2_start_streaming+0xcb/0x160 [videobuf2_common]
[ 1318.154617] ? report_bug+0xe0/0x180
[ 1318.154640] ? handle_bug+0x5e/0xa0
[ 1318.154652] ? exc_invalid_op+0x14/0x70
[ 1318.154665] ? asm_exc_invalid_op+0x16/0x20
[ 1318.154697] ? vb2_start_streaming+0xcb/0x160 [videobuf2_common]
[ 1318.154723] ? vb2_start_streaming+0x70/0x160 [videobuf2_common]
[ 1318.154748] vb2_core_streamon+0xa2/0x100 [videobuf2_common]
The sensor streamon call is the last thing that atomisp_start_streaming()
does and it was failing to undo all of the previous steps in general.
Refactor atomisp_stop_streaming() into an atomisp_stop_stream() helper and
call that on sensor streamon failure to properly clean things up.
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250505210008.152659-3-hdegoede@redhat.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>