mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
USB: chipidea: re-order irq handling to avoid unhandled irqs
- let role driver handle irq before ID change check; this gives the role driver a chance to handle disconnect; - disable irq during switch role; no role driver to handle irq in the period. Tested-by: Michael Grzeschik <[email protected]> Tested-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Richard Zhao <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
388ed48723
commit
b183c19f98
@@ -279,6 +279,7 @@ static void ci_role_work(struct work_struct *work)
|
||||
|
||||
ci_role_stop(ci);
|
||||
ci_role_start(ci, role);
|
||||
enable_irq(ci->irq);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,18 +319,22 @@ static irqreturn_t ci_irq(int irq, void *data)
|
||||
{
|
||||
struct ci13xxx *ci = data;
|
||||
irqreturn_t ret = IRQ_NONE;
|
||||
u32 otgsc = 0;
|
||||
|
||||
if (ci->is_otg) {
|
||||
u32 sts = hw_read(ci, OP_OTGSC, ~0);
|
||||
if (ci->is_otg)
|
||||
otgsc = hw_read(ci, OP_OTGSC, ~0);
|
||||
|
||||
if (sts & OTGSC_IDIS) {
|
||||
hw_write(ci, OP_OTGSC, OTGSC_IDIS, OTGSC_IDIS);
|
||||
queue_work(ci->wq, &ci->work);
|
||||
ret = IRQ_HANDLED;
|
||||
}
|
||||
if (ci->role != CI_ROLE_END)
|
||||
ret = ci_role(ci)->irq(ci);
|
||||
|
||||
if (ci->is_otg && (otgsc & OTGSC_IDIS)) {
|
||||
hw_write(ci, OP_OTGSC, OTGSC_IDIS, OTGSC_IDIS);
|
||||
disable_irq_nosync(ci->irq);
|
||||
queue_work(ci->wq, &ci->work);
|
||||
ret = IRQ_HANDLED;
|
||||
}
|
||||
|
||||
return ci->role == CI_ROLE_END ? ret : ci_role(ci)->irq(ci);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static DEFINE_IDA(ci_ida);
|
||||
|
||||
Reference in New Issue
Block a user