提交 b9da4d22 编写于 作者: B Brian Norris 提交者: Kalle Valo

mwifiex: avoid double-disable_irq() race

We have a race where the wakeup IRQ might be in flight while we're
calling mwifiex_disable_wake() from resume(). This can leave us
disabling the IRQ twice.

Let's disable the IRQ and enable it in case if we have double-disabled
it.
Signed-off-by: NBrian Norris <briannorris@chromium.org>
Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 d96e3927
......@@ -1424,8 +1424,13 @@ static inline void mwifiex_disable_wake(struct mwifiex_adapter *adapter)
{
if (adapter->irq_wakeup >= 0) {
disable_irq_wake(adapter->irq_wakeup);
if (!adapter->wake_by_wifi)
disable_irq(adapter->irq_wakeup);
disable_irq(adapter->irq_wakeup);
if (adapter->wake_by_wifi)
/* Undo our disable, since interrupt handler already
* did this.
*/
enable_irq(adapter->irq_wakeup);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册