* [PATCH for-3.11 0/2] brcmfmac: fixing potential driver issues
@ 2013-07-22 10:46 Arend van Spriel
2013-07-22 10:46 ` [PATCH for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure Arend van Spriel
2013-07-22 10:46 ` [PATCH for-3.11 2/2] brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface Arend van Spriel
0 siblings, 2 replies; 4+ messages in thread
From: Arend van Spriel @ 2013-07-22 10:46 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
Two patch that seem worth taking in 3.11. The first one could cause the
driver to lock up. This issue has been discovered reading the code. The
second issue has been observed during internal testing and resulted in
a NULL pointer access.
Arend van Spriel (2):
brcmfmac: decrement pending 8021x count upon tx failure
brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 2 +-
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure
2013-07-22 10:46 [PATCH for-3.11 0/2] brcmfmac: fixing potential driver issues Arend van Spriel
@ 2013-07-22 10:46 ` Arend van Spriel
2013-07-22 18:31 ` [PATCH V2 " Arend van Spriel
2013-07-22 10:46 ` [PATCH for-3.11 2/2] brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface Arend van Spriel
1 sibling, 1 reply; 4+ messages in thread
From: Arend van Spriel @ 2013-07-22 10:46 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
If the transmit fails because there are no hanger slots or
any other reason and the packet was an EAPOL packet the
pending coutner should be decreased although it was not
transmitted so the driver does not end up in a dead-lock.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index f0d9f7f..29b1f24 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -1744,13 +1744,14 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
ulong flags;
int fifo = BRCMF_FWS_FIFO_BCMC;
bool multicast = is_multicast_ether_addr(eh->h_dest);
+ bool pae = eh->h_proto == htons(ETH_P_PAE);
/* determine the priority */
if (!skb->priority)
skb->priority = cfg80211_classify8021d(skb);
drvr->tx_multicast += !!multicast;
- if (ntohs(eh->h_proto) == ETH_P_PAE)
+ if (pae)
atomic_inc(&ifp->pend_8021x_cnt);
if (!brcmf_fws_fc_active(fws)) {
@@ -1781,6 +1782,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
brcmf_fws_schedule_deq(fws);
} else {
brcmf_err("drop skb: no hanger slot\n");
+ if (pae) {
+ atomic_dec(&ifp->pend_8021x_cnt);
+ if (waitqueue_active(&ifp->pend_8021x_wait))
+ wake_up(&ifp->pend_8021x_wait);
+ }
brcmu_pkt_buf_free_skb(skb);
}
brcmf_fws_unlock(drvr, flags);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH for-3.11 2/2] brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface
2013-07-22 10:46 [PATCH for-3.11 0/2] brcmfmac: fixing potential driver issues Arend van Spriel
2013-07-22 10:46 ` [PATCH for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure Arend van Spriel
@ 2013-07-22 10:46 ` Arend van Spriel
1 sibling, 0 replies; 4+ messages in thread
From: Arend van Spriel @ 2013-07-22 10:46 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
To avoid ending up in a NULL-pointer access, the function
brcmf_txflowblock_if() should only be called for interfaces
that have a netdev associated with it.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index 8e89755..8009901 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -242,7 +242,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp,
{
unsigned long flags;
- if (!ifp)
+ if (!ifp || !ifp->ndev)
return;
brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n",
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH V2 for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure
2013-07-22 10:46 ` [PATCH for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure Arend van Spriel
@ 2013-07-22 18:31 ` Arend van Spriel
0 siblings, 0 replies; 4+ messages in thread
From: Arend van Spriel @ 2013-07-22 18:31 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
If the transmit fails because there are no hanger slots or
any other reason and the packet was an EAPOL packet the
pending counter should be decreased although it was not
transmitted so the driver does not end up in a dead-lock.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
Fixed typo in commit message: coutner -> counter.
Replaces patch with:
Message-ID: <1374489984-18250-2-git-send-email-arend@broadcom.com>
Regards,
Arend
---
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index f0d9f7f..29b1f24 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -1744,13 +1744,14 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
ulong flags;
int fifo = BRCMF_FWS_FIFO_BCMC;
bool multicast = is_multicast_ether_addr(eh->h_dest);
+ bool pae = eh->h_proto == htons(ETH_P_PAE);
/* determine the priority */
if (!skb->priority)
skb->priority = cfg80211_classify8021d(skb);
drvr->tx_multicast += !!multicast;
- if (ntohs(eh->h_proto) == ETH_P_PAE)
+ if (pae)
atomic_inc(&ifp->pend_8021x_cnt);
if (!brcmf_fws_fc_active(fws)) {
@@ -1781,6 +1782,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
brcmf_fws_schedule_deq(fws);
} else {
brcmf_err("drop skb: no hanger slot\n");
+ if (pae) {
+ atomic_dec(&ifp->pend_8021x_cnt);
+ if (waitqueue_active(&ifp->pend_8021x_wait))
+ wake_up(&ifp->pend_8021x_wait);
+ }
brcmu_pkt_buf_free_skb(skb);
}
brcmf_fws_unlock(drvr, flags);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-22 18:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-22 10:46 [PATCH for-3.11 0/2] brcmfmac: fixing potential driver issues Arend van Spriel
2013-07-22 10:46 ` [PATCH for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure Arend van Spriel
2013-07-22 18:31 ` [PATCH V2 " Arend van Spriel
2013-07-22 10:46 ` [PATCH for-3.11 2/2] brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface Arend van Spriel
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).