diff options
| author | Chengfeng Ye <[email protected]> | 2023-09-26 10:53:30 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2023-10-07 10:55:45 +0200 |
| commit | 04d19e65137e3cd4a5004e624c85c762933d115c (patch) | |
| tree | 58e5f9f5d2a8a9c0ab74226d869e58def53662f2 /tools/perf/scripts/python | |
| parent | 3568cb6556695af163e930a75b1ed8f6dfa848ba (diff) | |
media: s5p-mfc: Fix potential deadlock on condlock
As &dev->condlock is acquired under irq context along the following
call chain from s5p_mfc_irq(), other acquisition of the same lock
inside process context or softirq context should disable irq avoid double
lock. enc_post_frame_start() seems to be one such function that execute
under process context or softirq context.
<deadlock #1>
enc_post_frame_start()
--> clear_work_bit()
--> spin_loc(&dev->condlock)
<interrupt>
--> s5p_mfc_irq()
--> s5p_mfc_handle_frame()
--> clear_work_bit()
--> spin_lock(&dev->condlock)
This flaw was found by an experimental static analysis tool I am
developing for irq-related deadlock.
To prevent the potential deadlock, the patch change clear_work_bit()
inside enc_post_frame_start() to clear_work_bit_irqsave().
Signed-off-by: Chengfeng Ye <[email protected]>
Acked-by: Marek Szyprowski <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions