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

Commit b8324482 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Sahil Chandna
Browse files

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.

Change-Id: I1b617c4afd39c544ce79f9396030b730c55445a7
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Signed-off-by: default avatarSahil Chandna <chandna@codeaurora.org>
parent 62bf137f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1157,7 +1157,7 @@ static int fg_batt_miss_irq_en_cb(struct votable *votable, void *data,
		enable_irq_wake(chip->irqs[BATT_MISSING_IRQ].irq);
	} else {
		disable_irq_wake(chip->irqs[BATT_MISSING_IRQ].irq);
		disable_irq(chip->irqs[BATT_MISSING_IRQ].irq);
		disable_irq_nosync(chip->irqs[BATT_MISSING_IRQ].irq);
	}

	return 0;
@@ -1176,7 +1176,7 @@ static int fg_delta_bsoc_irq_en_cb(struct votable *votable, void *data,
		enable_irq_wake(chip->irqs[BSOC_DELTA_IRQ].irq);
	} else {
		disable_irq_wake(chip->irqs[BSOC_DELTA_IRQ].irq);
		disable_irq(chip->irqs[BSOC_DELTA_IRQ].irq);
		disable_irq_nosync(chip->irqs[BSOC_DELTA_IRQ].irq);
	}

	return 0;