Files
Arch-R/projects
Memphiz d12146f9e4 [Wetek.Play/amlkernel] - fix race condition in ge2d_wq.
1. thread 1 is here https://github.com/codesnake/linux-amlogic/blob/master/drivers/amlogic/display/ge2d/ge2d_wq.c#L147
2. thread 2 is here https://github.com/codesnake/linux-amlogic/blob/master/drivers/amlogic/display/ge2d/ge2d_wq.c#L855
3. thread 2 is running and enters the if condition because state is GE2D_STATE_RUNNING
4. thread 2 gets interrupted by thread 1 thread 1 jumps over the if and sets GE2D_STATE_IDLE and is done
5. back to thread 2 which now sets state GE2D_STATE_REMOVING_WQ and calls wait_for_completion
6. thread2 will never return because thread 1 is done already and won't signal the event

destroy_ge2d_work_queue is called from https://github.com/codesnake/linux-amlogic/blob/master/drivers/amlogic/amports/amvideocap.c#L320 in my use case and will block there forever - and basically blocks down to the read in the userspace which tries to read the current captured frame
2015-01-15 19:13:02 +01:00
..