drivers: atmel_maxtouch: Fix IRQ handling in a possible race condition
Possibility of the IRQ being disabled twice if IRQ hander and the missed interrupt check execute simultaneously. This can case the IRQ to be disabled forever. Change-Id: If1d1cac138727c866dcd99b882b778d4b31b1774 Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
This commit is contained in:
@@ -1832,16 +1832,14 @@ static int mxt_resume(struct device *dev)
|
|||||||
if (error < 0)
|
if (error < 0)
|
||||||
goto err_write_block;
|
goto err_write_block;
|
||||||
|
|
||||||
|
/* Make sure we just didn't miss a interrupt. */
|
||||||
|
if (mxt->read_chg() == 0)
|
||||||
|
schedule_delayed_work(&mxt->dwork, 0);
|
||||||
|
else
|
||||||
enable_irq(mxt->irq);
|
enable_irq(mxt->irq);
|
||||||
|
|
||||||
mxt->is_suspended = false;
|
mxt->is_suspended = false;
|
||||||
|
|
||||||
/* Make sure we just didn't miss a interrupt. */
|
|
||||||
if (mxt->read_chg() == 0) {
|
|
||||||
disable_irq(mxt->irq);
|
|
||||||
schedule_delayed_work(&mxt->dwork, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_write_block:
|
err_write_block:
|
||||||
|
|||||||
Reference in New Issue
Block a user