Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: BH shouldn't be enabled when hardirqs are disabled.

ath_tx_complete_buf uses a BH version of spinlock and so releasing
the lock enables BH which is incorrect when called from sta_notify
callback as MAC80211 disables hardirqs before the driver callback
is called.

As ath_tx_complete_buf is shared between user and softirq context
using normal spinlock may not be appropriate. Though the proper
fix would be to cleanup the context properly in the driver code,
this would be an interim fix to avoid kernel warning.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Senthil Balasubramanian and committed by
John W. Linville
a07d3619 b1439236

+3 -2
+3 -2
drivers/net/wireless/ath9k/xmit.c
··· 310 310 { 311 311 struct sk_buff *skb = bf->bf_mpdu; 312 312 struct ath_xmit_status tx_status; 313 + unsigned long flags; 313 314 314 315 /* 315 316 * Set retry information. ··· 341 340 /* 342 341 * Return the list of ath_buf of this mpdu to free queue 343 342 */ 344 - spin_lock_bh(&sc->sc_txbuflock); 343 + spin_lock_irqsave(&sc->sc_txbuflock, flags); 345 344 list_splice_tail_init(bf_q, &sc->sc_txbuf); 346 - spin_unlock_bh(&sc->sc_txbuflock); 345 + spin_unlock_irqrestore(&sc->sc_txbuflock, flags); 347 346 } 348 347 349 348 /*