Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1425869

Re: [PATCH RFC 1/2] brcmfmac: remove interface before notifying listener

From Rafał Miłecki <zajec5@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC 1/2] brcmfmac: remove interface before notifying listener
Date 2016-06-19 00:50 +0200
Message-ID <rLxdU-1O2-3@gated-at.bofh.it> (permalink)
References <rLt0C-7A6-11@gated-at.bofh.it> <rLu6l-8dJ-1@gated-at.bofh.it> <rLwrv-1fj-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 18 June 2016 at 23:58, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 18 June 2016 at 21:26, Arend van Spriel <arend.vanspriel@broadcom.com> wrote:
>> On 18-06-16 20:18, Rafał Miłecki wrote:
>>> So far when receiving event about in-firmware-interface removal we were
>>> notifying our listener and afterwards we were removing Linux interface.
>>>
>>
>> [snip]
>>
>>>
>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
>>> index 9da7a4c..5fd1886 100644
>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
>>> @@ -18,6 +18,7 @@
>>>  #include "brcmu_wifi.h"
>>>  #include "brcmu_utils.h"
>>>
>>> +#include "cfg80211.h"
>>>  #include "core.h"
>>>  #include "debug.h"
>>>  #include "tracepoint.h"
>>> @@ -180,10 +181,16 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
>>>       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);
>>
>> The reason for doing this first is because we are passing the ifp, which
>> is netdev_priv(ifp->ndev). In brcmf_remove_interface() we only
>> unregister the netdev, which will end up (after scheduling) in
>> brcmf_free_netdev() thus freeing the ifp. By moving the event handler
>> function ifp may be stale already.
>
> Good catch. What about making brcmf_fweh_call_event_handler work
> without ifp? Would that be OK then?

Maybe I have even better idea. What about handling Linux interface
removal in the code waiting for BRCMF_E_IF_DEL? We already do
something like that in case of BRCMF_E_IF_ADD (it is brcmf_ap_add_vif
that calls brcmf_net_attach).

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RFC 1/2] brcmfmac: remove interface before notifying listener Rafał Miłecki <zajec5@gmail.com> - 2016-06-18 20:20 +0200
  [PATCH RFC 2/2] brcmfmac: support removing AP interfaces with "interface_remove" Rafał Miłecki <zajec5@gmail.com> - 2016-06-18 20:20 +0200
    Re: [PATCH RFC 2/2] brcmfmac: support removing AP interfaces with  "interface_remove" Arend van Spriel <arend.vanspriel@broadcom.com> - 2016-06-18 21:40 +0200
  Re: [PATCH RFC 1/2] brcmfmac: remove interface before notifying  listener Arend van Spriel <arend.vanspriel@broadcom.com> - 2016-06-18 21:30 +0200
    Re: [PATCH RFC 1/2] brcmfmac: remove interface before notifying listener Rafał Miłecki <zajec5@gmail.com> - 2016-06-19 00:00 +0200
      Re: [PATCH RFC 1/2] brcmfmac: remove interface before notifying listener Rafał Miłecki <zajec5@gmail.com> - 2016-06-19 00:50 +0200
  [PATCH V2 RFC 2/2] brcmfmac: support removing AP interfaces with "interface_remove" Rafał Miłecki <zajec5@gmail.com> - 2016-06-19 18:40 +0200
  [PATCH V2 RFC 1/2] brcmfmac: delete interface directly in code that sent fw request Rafał Miłecki <zajec5@gmail.com> - 2016-06-19 18:40 +0200

csiph-web