提交 453b0c3f 编写于 作者: A Amitkumar Karwar 提交者: John W. Linville

mwifiex: fix SDIO interrupt lost issue

601216e1 "mwifiex: process RX packets in SDIO IRQ thread directly"
introduced a command timeout issue which can be reproduced easily on
an AM33xx platform using a test application written by Daniel Mack:

https://gist.github.com/zonque/6579314

mwifiex_main_process() is called from both the SDIO handler and
the workqueue. In case an interrupt occurs right after the
int_status check, but before updating the mwifiex_processing flag,
this interrupt gets lost, resulting in a command timeout and
consequently a card reset.

Let main_proc_lock protect both int_status and mwifiex_processing
flag. This fixes the interrupt lost issue.

Cc: <stable@vger.kernel.org> # 3.7+
Reported-by: NSven Neumann <s.neumann@raumfeld.com>
Reported-by: NAndreas Fenkart <andreas.fenkart@streamunlimited.com>
Tested-by: NDaniel Mack <zonque@gmail.com>
Reviewed-by: NDylan Reid <dgreid@chromium.org>
Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NBing Zhao <bzhao@marvell.com>
Signed-off-by: NPaul Stewart <pstew@chromium.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 dfb6b7c1
...@@ -358,10 +358,12 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -358,10 +358,12 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
} }
} while (true); } while (true);
if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) spin_lock_irqsave(&adapter->main_proc_lock, flags);
if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) {
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
goto process_start; goto process_start;
}
spin_lock_irqsave(&adapter->main_proc_lock, flags);
adapter->mwifiex_processing = false; adapter->mwifiex_processing = false;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags); spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册