Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3df32f98 authored by Manaf Meethalavalappu Pallikunhi's avatar Manaf Meethalavalappu Pallikunhi
Browse files

power: bcl_peripheral: Fix deadlock condition not accounted correctly



If bcl peripheral driver is in polling mode either for vbat or ibat
and bcl disable request comes simultaneously, there is a deadlock
condition where bcl disable context tries to cancel worker thread for
either ibat or vbat within mutex context and the same time the worker
thread is waiting for the same mutex.
To fix this deadlock scenario, use non blocking call
cancel_delayed_work instead of cancel_delayed_work_sync within mutex
context. It is safe and no need to flush this worker thread since
disable request already changes state from polling to inactive which
makes sure that post disable request even if there is queued worker
thread instance, it safely exit from last execution.

Change-Id: I652d276472f784d6ea0bc01af0d0ea489a615c78
Signed-off-by: default avatarManaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
parent 3803e4f8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment