OSDN Git Service

power: qpnp-fg-gen3: Use disable_irq_nosync for disabling interrupts
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Fri, 29 Sep 2017 23:07:28 +0000 (16:07 -0700)
committerSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Thu, 12 Oct 2017 05:02:19 +0000 (22:02 -0700)
commit14148191af946b54420c5cfa550cc08cf71ecdef
tree3800ca03029216f1c47befd0bd52c51fa35d07f6
parent4a28bdab128782a923da8fda74825ea6b5d07e63
power: qpnp-fg-gen3: Use disable_irq_nosync for disabling interrupts

Delta battery SOC interrupt can fire during boot just after
registering the interrupts before disabling it through vote() on
delta_bsoc_irq_en_votable during driver probe. When this happens,
from the delta_bsoc interrupt handler, an attempt to disable the
interrupt can be made by fg_charge_full_update() if charge_done
is not set. This will in turn acquire the mutex lock of votable
while trying to do disable_irq() which needs synchronization.

Prevent this situation by using disable_irq_nosync() when
disabling the interrupts from votable callbacks.

CRs-Fixed: 2125269
Change-Id: I1b617c4afd39c544ce79f9396030b730c55445a7
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
drivers/power/supply/qcom/qpnp-fg-gen3.c