Skip to content

Commit

Permalink
brcm80211: fmac: use spinlock calls saving irq flags in brcmf_enq_eve…
Browse files Browse the repository at this point in the history
…nt()

This function is executed within irq context. The call spin_unlock_irq
does enable interrupts which is not desired in the irq context. This patch
replaces them using the spin_loc_irqsave and spin_unlock_irqrestore
functions.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Kan Yan <kanyan@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Feb 22, 2012
1 parent bcbec9e commit cf44066
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3308,6 +3308,7 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
{
struct brcmf_cfg80211_event_q *e;
s32 err = 0;
ulong flags;

e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_ATOMIC);
if (!e)
Expand All @@ -3316,9 +3317,9 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
e->etype = event;
memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));

spin_lock_irq(&cfg_priv->evt_q_lock);
spin_lock_irqsave(&cfg_priv->evt_q_lock, flags);
list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list);
spin_unlock_irq(&cfg_priv->evt_q_lock);
spin_unlock_irqrestore(&cfg_priv->evt_q_lock, flags);

return err;
}
Expand Down

0 comments on commit cf44066

Please sign in to comment.