Revert "FROMLIST: media: chips-media: wave5: Call v4l2_m2m_job_finish() in job_abort()"
The patch has been rejected [1] for some good reasons:
Wave5 firmware have no function to cancel pending jobs. By finishing the job without caring about the firmware state, wave5_vpu_dec_finish_decode() will be called concurrently to another job. This change will effectively breaks seeking, and will cause warning and possibly memory corruption.
We indeed observe memory corruption when running VTS with: $ atest VtsHalMediaC2V1_0TargetVideoDecTest
[ T3336] ------------[ cut here ]------------
[ T3336] kernel BUG at lib/list_debug.c:61!
[ T3336] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
[...]
[ T3336] CPU: 1 PID: 3336 Comm: kworker/1:1 Tainted: G OE 6.1.68-android14-11-maybe-dirty #1
[ T3336] Hardware name: Texas Instruments AM62P5 SK (DT)
[ T3336] Workqueue: events v4l2_m2m_device_run_work
[ T3336] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ T3336] pc : __list_del_entry_valid+0xbc/0xd4
[ T3336] lr : __list_del_entry_valid+0xbc/0xd4
[ T3336] sp : ffffffc018ab3b90
[ T3336] x29: ffffffc018ab3b90 x28: ffffff88019ede20 x27: 0000000000000000
[ T3336] x26: ffffff88637c9300 x25: ffffff881fb741b0 x24: ffffff881fb741b0
[ T3336] x23: 0000000000000002 x22: ffffffc018ab3ba8 x21: ffffff881fb741a0
[ T3336] x20: ffffff881fb741a8 x19: 0000000000000000 x18: ffffffc018745050
[ T3336] x17: 000000002f1d5b15 x16: ffffffffffffffff x15: 0000000000000004
[ T3336] x14: ffffffc00a0f1518 x13: 0000000000000fff x12: 0000000000000003
[ T3336] x11: 0000000000000000 x10: 0000000000000000 x9 : 2632145a09761d00
[ T3336] x8 : 2632145a09761d00 x7 : 205b5d3133303633 x6 : 332e30373520205b
[ T3336] x5 : ffffffc00a2ba7cf x4 : ffffffc00884f298 x3 : 0000000000000000
[ T3336] x2 : ffffff89741a8b88 x1 : 0000000000000000 x0 : 000000000000006d
[ T3336] Call trace:
[ T3336] __list_del_entry_valid+0xbc/0xd4
[ T3336] wait_for_common+0x118/0x1a4
[ T3336] wait_for_completion_timeout+0x1c/0x2c
[ T3336] wave5_vpu_wait_interrupt+0x30/0x58 [wave5]
[ T3336] wave5_vpu_dec_device_run+0x1dc/0x8c0 [wave5]
[ T3336] v4l2_m2m_try_run+0xc4/0x140
[ T3336] v4l2_m2m_device_run_work+0x1c/0x2c
[ T3336] process_one_work+0x1ec/0x444
[ T3336] worker_thread+0x264/0x438
[ T3336] kthread+0x10c/0x1dc
[ T3336] ret_from_fork+0x10/0x20
[ T3336] Code: f0006f60 9128ac00 aa0803e3 94243768 (d4210000)
[ T3336] ---[ end trace 0000000000000000 ]---
[ T3336] Kernel panic - not syncing: Oops - BUG: Fatal exception
[ T3336] SMP: stopping secondary CPUs
[ T3336] Kernel Offset: disabled
[ T3336] CPU features: 0x00,00000000,00800184,0000421b
[ T3336] Memory Limit: none
This reverts commit 3467ea58.
[1] https://patchwork.linuxtv.org/project/linux-media/patch/20240228-wave5-fix-abort-v1-1-7482b9316867@baylibre.com/ Signed-off-by: Mattijs Korpershoek mkorpershoek@baylibre.com
Edited by Mattijs Korpershoek