diff mbox

[for-3.12] brcmfmac: handle IF event for P2P_DEVICE interface

Message ID 1411465946-27161-1-git-send-email-arend@broadcom.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arend van Spriel Sept. 23, 2014, 9:52 a.m. UTC
upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

The firmware notifies about interface changes through the IF event
which has a NO_IF flag that means host can ignore the event. This
behaviour was introduced in the driver by:

  commit 2ee8382fc6c763c76396a6aaff77a27089eed3aa
  Author: Arend van Spriel <arend@broadcom.com>
  Date:   Sat Aug 10 12:27:24 2013 +0200

      brcmfmac: ignore IF event if firmware indicates it

It turns out that the IF event for the P2P_DEVICE also has this
flag set, but the event should not be ignored in this scenario.
The mentioned commit caused a regression in 3.12 kernel in creation
of the P2P_DEVICE interface.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Greg KH Sept. 23, 2014, 1:22 p.m. UTC | #1
On Tue, Sep 23, 2014 at 11:52:26AM +0200, Arend van Spriel wrote:
> upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe

That commit id doesn't match anything in Linus's tree :(

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel Sept. 23, 2014, 1:42 p.m. UTC | #2
On 09/23/14 15:22, Greg KH wrote:
> On Tue, Sep 23, 2014 at 11:52:26AM +0200, Arend van Spriel wrote:
>> upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe
>
> That commit id doesn't match anything in Linus's tree :(
>

Hmmm, that is weird:

[arend@lb-bun-235 ~/scm/brcm80211-next]
$ git remote show torvalds
* remote torvalds
   Fetch URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   Push  URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   HEAD branch: master
   Remote branch:
     master tracked
[arend@lb-bun-235 ~/scm/brcm80211-next]
$ git log torvalds/master --oneline -8 -- drivers/net/wireless/brcm80211
*87c4790 brcmfmac: handle IF event for P2P_DEVICE interface*
8f2b459 brcmfmac: obtain ifp through wdev structure
f1d5603 brcmfmac: conditionally compile firmware protocol source code
fac7d2a brcmfmac: Fix memory leak and missing assignment.
2d116b88 brcmfmac: fix memory leakage in msgbuf
ebcc2f5 brcmfmac: fix curly brace mistake in brcmf_pcie_handle_mb_data()
aef4f5b Merge tag 'master-2014-07-31' of 
git://git.kernel.org/pub/scm/linux/kern
70b7d94 brcmfmac: Add TDLS support to msgbuf.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Sept. 23, 2014, 1:51 p.m. UTC | #3
On Tue, Sep 23, 2014 at 03:42:42PM +0200, Arend van Spriel wrote:
> On 09/23/14 15:22, Greg KH wrote:
> >On Tue, Sep 23, 2014 at 11:52:26AM +0200, Arend van Spriel wrote:
> >>upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe
> >
> >That commit id doesn't match anything in Linus's tree :(
> >
> 
> Hmmm, that is weird:
> 
> [arend@lb-bun-235 ~/scm/brcm80211-next]
> $ git remote show torvalds
> * remote torvalds
>   Fetch URL:
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>   Push  URL:
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>   HEAD branch: master
>   Remote branch:
>     master tracked
> [arend@lb-bun-235 ~/scm/brcm80211-next]
> $ git log torvalds/master --oneline -8 -- drivers/net/wireless/brcm80211
> *87c4790 brcmfmac: handle IF event for P2P_DEVICE interface*
> 8f2b459 brcmfmac: obtain ifp through wdev structure
> f1d5603 brcmfmac: conditionally compile firmware protocol source code
> fac7d2a brcmfmac: Fix memory leak and missing assignment.
> 2d116b88 brcmfmac: fix memory leakage in msgbuf
> ebcc2f5 brcmfmac: fix curly brace mistake in brcmf_pcie_handle_mb_data()
> aef4f5b Merge tag 'master-2014-07-31' of
> git://git.kernel.org/pub/scm/linux/kern
> 70b7d94 brcmfmac: Add TDLS support to msgbuf.

Ah, it just went in, sorry for the noise.

But it _just_ went in, why are you emailing this?  We have to wait for a
-rc release to come out with the patch before being able to add it to
the tree.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel Sept. 23, 2014, 1:55 p.m. UTC | #4
On 09/23/14 15:51, Greg KH wrote:
> On Tue, Sep 23, 2014 at 03:42:42PM +0200, Arend van Spriel wrote:
>> On 09/23/14 15:22, Greg KH wrote:
>>> On Tue, Sep 23, 2014 at 11:52:26AM +0200, Arend van Spriel wrote:
>>>> upstream: 87c4790330810fe5caf0172d9320cf24ef19cebe
>>>
>>> That commit id doesn't match anything in Linus's tree :(
>>>
>>
>> Hmmm, that is weird:
>>
>> [arend@lb-bun-235 ~/scm/brcm80211-next]
>> $ git remote show torvalds
>> * remote torvalds
>>    Fetch URL:
>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>    Push  URL:
>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>    HEAD branch: master
>>    Remote branch:
>>      master tracked
>> [arend@lb-bun-235 ~/scm/brcm80211-next]
>> $ git log torvalds/master --oneline -8 -- drivers/net/wireless/brcm80211
>> *87c4790 brcmfmac: handle IF event for P2P_DEVICE interface*
>> 8f2b459 brcmfmac: obtain ifp through wdev structure
>> f1d5603 brcmfmac: conditionally compile firmware protocol source code
>> fac7d2a brcmfmac: Fix memory leak and missing assignment.
>> 2d116b88 brcmfmac: fix memory leakage in msgbuf
>> ebcc2f5 brcmfmac: fix curly brace mistake in brcmf_pcie_handle_mb_data()
>> aef4f5b Merge tag 'master-2014-07-31' of
>> git://git.kernel.org/pub/scm/linux/kern
>> 70b7d94 brcmfmac: Add TDLS support to msgbuf.
>
> Ah, it just went in, sorry for the noise.
>
> But it _just_ went in, why are you emailing this?  We have to wait for a
> -rc release to come out with the patch before being able to add it to
> the tree.

Noted. Did not find that nitty gritty detail in stable_kernel_rules.txt, 
but I just might create a patch for that if I can beat my writers block ;-)

Gr. AvS

> thanks,
>
> greg k-h

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
index fad77dd..3f9cb89 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
@@ -185,7 +185,13 @@  static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
 		  ifevent->action, ifevent->ifidx, ifevent->bssidx,
 		  ifevent->flags, ifevent->role);
 
-	if (ifevent->flags & BRCMF_E_IF_FLAG_NOIF) {
+	/* The P2P Device interface event must not be ignored
+	 * contrary to what firmware tells us. The only way to
+	 * distinguish the P2P Device is by looking at the ifidx
+	 * and bssidx received.
+	 */
+	if (!(ifevent->ifidx == 0 && ifevent->bssidx == 1) &&
+	    (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) {
 		brcmf_dbg(EVENT, "event can be ignored\n");
 		return;
 	}
@@ -210,12 +216,12 @@  static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
 				return;
 	}
 
-	if (ifevent->action == BRCMF_E_IF_CHANGE)
+	if (ifp && ifevent->action == BRCMF_E_IF_CHANGE)
 		brcmf_fws_reset_interface(ifp);
 
 	err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data);
 
-	if (ifevent->action == BRCMF_E_IF_DEL) {
+	if (ifp && ifevent->action == BRCMF_E_IF_DEL) {
 		brcmf_fws_del_interface(ifp);
 		brcmf_del_if(drvr, ifevent->bssidx);
 	}