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:
Anirudh Ghayal
2012-01-02 17:04:32 +05:30
parent 4e566b30e0
commit 4e66bb7bce

View File

@@ -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: