diff mbox

[1/2] mwifiex: fix PCIe legacy interrupt problem

Message ID 1468589825-9188-1-git-send-email-akarwar@marvell.com (mailing list archive)
State Accepted
Commit 514952889544fcb069bbedfec4aa624fc9e26c4b
Delegated to: Kalle Valo
Headers show

Commit Message

Amitkumar Karwar July 15, 2016, 1:37 p.m. UTC
In corner case, we may end up processing same interrupt twice.
We have a logic to read pending interrupts at the end of interrupt
processing routine. It has a race with interrupts read in interrupt
handler. This patch solves the problem by ORing the interrupt bitmap
in this case.

The symptom for this bug is below messages in dmesg log.

[   11.522123] mwifiex_pcie 0000:01:00.0: CMD_RESP: invalid cmd resp
[   11.680412] mwifiex_pcie 0000:01:00.0: There is no command but got cmdrsp

Link: https://bugzilla.kernel.org/show_bug.cgi?id=109681
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Kalle Valo July 18, 2016, 7:43 p.m. UTC | #1
Amitkumar Karwar <akarwar@marvell.com> wrote:
> In corner case, we may end up processing same interrupt twice.
> We have a logic to read pending interrupts at the end of interrupt
> processing routine. It has a race with interrupts read in interrupt
> handler. This patch solves the problem by ORing the interrupt bitmap
> in this case.
> 
> The symptom for this bug is below messages in dmesg log.
> 
> [   11.522123] mwifiex_pcie 0000:01:00.0: CMD_RESP: invalid cmd resp
> [   11.680412] mwifiex_pcie 0000:01:00.0: There is no command but got cmdrsp
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=109681
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Cathy Luo <cluo@marvell.com>

Thanks, 2 patches applied to wireless-drivers-next.git:

514952889544 mwifiex: fix PCIe legacy interrupt problem
2fd40d2d349f mwifiex: update command response skb length correctly
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index d61d4ad..38bd62e 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2300,6 +2300,12 @@  static int mwifiex_process_pcie_int(struct mwifiex_adapter *adapter)
 			}
 
 		}
+		if (!card->msi_enable) {
+			spin_lock_irqsave(&adapter->int_lock, flags);
+			pcie_ireg |= adapter->int_status;
+			adapter->int_status = 0;
+			spin_unlock_irqrestore(&adapter->int_lock, flags);
+		}
 	}
 	mwifiex_dbg(adapter, INTR,
 		    "info: cmd_sent=%d data_sent=%d\n",