Commit 8fa5fdec authored by Arend Van Spriel's avatar Arend Van Spriel Committed by Kalle Valo

brcmfmac: remove worker from .ndo_set_mac_address() callback

As it turns out there is no need to use a worker for the callback
because it is not called from atomic context.
Reported-by: default avatarDan Williams <dcbw@redhat.com>
Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 26305d3d
...@@ -136,27 +136,6 @@ static void _brcmf_set_multicast_list(struct work_struct *work) ...@@ -136,27 +136,6 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
err); err);
} }
static void
_brcmf_set_mac_address(struct work_struct *work)
{
struct brcmf_if *ifp;
s32 err;
ifp = container_of(work, struct brcmf_if, setmacaddr_work);
brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr,
ETH_ALEN);
if (err < 0) {
brcmf_err("Setting cur_etheraddr failed, %d\n", err);
} else {
brcmf_dbg(TRACE, "MAC address updated to %pM\n",
ifp->mac_addr);
memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
}
}
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
static void _brcmf_update_ndtable(struct work_struct *work) static void _brcmf_update_ndtable(struct work_struct *work)
{ {
...@@ -190,10 +169,20 @@ static int brcmf_netdev_set_mac_address(struct net_device *ndev, void *addr) ...@@ -190,10 +169,20 @@ static int brcmf_netdev_set_mac_address(struct net_device *ndev, void *addr)
{ {
struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_if *ifp = netdev_priv(ndev);
struct sockaddr *sa = (struct sockaddr *)addr; struct sockaddr *sa = (struct sockaddr *)addr;
int err;
memcpy(&ifp->mac_addr, sa->sa_data, ETH_ALEN); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
schedule_work(&ifp->setmacaddr_work);
return 0; err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", sa->sa_data,
ETH_ALEN);
if (err < 0) {
brcmf_err("Setting cur_etheraddr failed, %d\n", err);
} else {
brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data);
memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN);
memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
}
return err;
} }
static void brcmf_netdev_set_multicast_list(struct net_device *ndev) static void brcmf_netdev_set_multicast_list(struct net_device *ndev)
...@@ -525,7 +514,6 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked) ...@@ -525,7 +514,6 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
/* set the mac address */ /* set the mac address */
memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN); memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
INIT_WORK(&ifp->setmacaddr_work, _brcmf_set_mac_address);
INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list); INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list);
INIT_WORK(&ifp->ndoffload_work, _brcmf_update_ndtable); INIT_WORK(&ifp->ndoffload_work, _brcmf_update_ndtable);
...@@ -730,7 +718,6 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx, ...@@ -730,7 +718,6 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx,
} }
if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
cancel_work_sync(&ifp->setmacaddr_work);
cancel_work_sync(&ifp->multicast_work); cancel_work_sync(&ifp->multicast_work);
cancel_work_sync(&ifp->ndoffload_work); cancel_work_sync(&ifp->ndoffload_work);
} }
......
...@@ -176,7 +176,6 @@ enum brcmf_netif_stop_reason { ...@@ -176,7 +176,6 @@ enum brcmf_netif_stop_reason {
* @vif: points to cfg80211 specific interface information. * @vif: points to cfg80211 specific interface information.
* @ndev: associated network device. * @ndev: associated network device.
* @stats: interface specific network statistics. * @stats: interface specific network statistics.
* @setmacaddr_work: worker object for setting mac address.
* @multicast_work: worker object for multicast provisioning. * @multicast_work: worker object for multicast provisioning.
* @ndoffload_work: worker object for neighbor discovery offload configuration. * @ndoffload_work: worker object for neighbor discovery offload configuration.
* @fws_desc: interface specific firmware-signalling descriptor. * @fws_desc: interface specific firmware-signalling descriptor.
...@@ -193,7 +192,6 @@ struct brcmf_if { ...@@ -193,7 +192,6 @@ struct brcmf_if {
struct brcmf_cfg80211_vif *vif; struct brcmf_cfg80211_vif *vif;
struct net_device *ndev; struct net_device *ndev;
struct net_device_stats stats; struct net_device_stats stats;
struct work_struct setmacaddr_work;
struct work_struct multicast_work; struct work_struct multicast_work;
struct work_struct ndoffload_work; struct work_struct ndoffload_work;
struct brcmf_fws_mac_descriptor *fws_desc; struct brcmf_fws_mac_descriptor *fws_desc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment