diff options
| author | Fenglin Wu <fenglinw@codeaurora.org> | 2017-08-24 14:28:54 +0800 |
|---|---|---|
| committer | Fenglin Wu <fenglinw@codeaurora.org> | 2017-09-20 12:34:11 +0800 |
| commit | 28121ca02fefa7d243c0ffdfa8071d5f22d22dc3 (patch) | |
| tree | cc85a5f211b84bff54a66cbca0426a5d797a4565 | |
| parent | 3f06fc9b4a9a547831435fc28d4e6e3d37d05528 (diff) | |
power: smb-lib: Disable USB IRQs during high duty cycle
Disable USB IRQs after high duty cycle IRQ triggered and re-enable
them in the delay worker. This helps to avoid the high duty cycle
IRQ storming.
CRs-Fixed: 2094725
Change-Id: Iba22a7402692b5ee5f738cc17ed9c214f6014ac0
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
| -rw-r--r-- | drivers/power/supply/qcom/smb-lib.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c index b3c2b67abfde..8de4708332f8 100644 --- a/drivers/power/supply/qcom/smb-lib.c +++ b/drivers/power/supply/qcom/smb-lib.c @@ -4063,6 +4063,14 @@ irqreturn_t smblib_handle_high_duty_cycle(int irq, void *data) struct smb_charger *chg = irq_data->parent_data; chg->is_hdc = true; + /* + * Disable usb IRQs after the flag set and re-enable IRQs after + * the flag cleared in the delayed work queue, to avoid any IRQ + * storming during the delays + */ + if (chg->irq_info[HIGH_DUTY_CYCLE_IRQ].irq) + disable_irq_nosync(chg->irq_info[HIGH_DUTY_CYCLE_IRQ].irq); + schedule_delayed_work(&chg->clear_hdc_work, msecs_to_jiffies(60)); return IRQ_HANDLED; @@ -4240,6 +4248,8 @@ static void clear_hdc_work(struct work_struct *work) clear_hdc_work.work); chg->is_hdc = 0; + if (chg->irq_info[HIGH_DUTY_CYCLE_IRQ].irq) + enable_irq(chg->irq_info[HIGH_DUTY_CYCLE_IRQ].irq); } static void rdstd_cc2_detach_work(struct work_struct *work) |
