linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mwifiex: fix PCIe legacy interrupt problem
@ 2016-07-15 13:37 Amitkumar Karwar
  2016-07-15 13:37 ` [PATCH 2/2] mwifiex: update command response skb length correctly Amitkumar Karwar
  2016-07-18 19:43 ` [1/2] mwifiex: fix PCIe legacy interrupt problem Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Amitkumar Karwar @ 2016-07-15 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

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(+)

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",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] mwifiex: update command response skb length correctly
  2016-07-15 13:37 [PATCH 1/2] mwifiex: fix PCIe legacy interrupt problem Amitkumar Karwar
@ 2016-07-15 13:37 ` Amitkumar Karwar
  2016-07-18 19:43 ` [1/2] mwifiex: fix PCIe legacy interrupt problem Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Amitkumar Karwar @ 2016-07-15 13:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

Same skb is being reused for storing command response from firmware
in PCIe chipsets. There was a bug while updating the skb length.
This patch ensures skb length correctly gets updated based on rx_len.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 38bd62e..a6af85d 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -1616,6 +1616,7 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
 
 	pkt_len = *((__le16 *)skb->data);
 	rx_len = le16_to_cpu(pkt_len);
+	skb_put(skb, MWIFIEX_UPLD_SIZE - skb->len);
 	skb_trim(skb, rx_len);
 	skb_pull(skb, INTF_HEADER_LEN);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [1/2] mwifiex: fix PCIe legacy interrupt problem
  2016-07-15 13:37 [PATCH 1/2] mwifiex: fix PCIe legacy interrupt problem Amitkumar Karwar
  2016-07-15 13:37 ` [PATCH 2/2] mwifiex: update command response skb length correctly Amitkumar Karwar
@ 2016-07-18 19:43 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2016-07-18 19:43 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

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

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/9232091/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-18 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-15 13:37 [PATCH 1/2] mwifiex: fix PCIe legacy interrupt problem Amitkumar Karwar
2016-07-15 13:37 ` [PATCH 2/2] mwifiex: update command response skb length correctly Amitkumar Karwar
2016-07-18 19:43 ` [1/2] mwifiex: fix PCIe legacy interrupt problem Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).