linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ath5k: scanning while transmitting causes oops on 802.11a capable card
@ 2009-05-06 16:14 Pavel Roskin
  2009-05-06 16:19 ` Johannes Berg
  2009-05-06 16:36 ` [ath5k-devel] " Bob Copeland
  0 siblings, 2 replies; 10+ messages in thread
From: Pavel Roskin @ 2009-05-06 16:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath5k-devel

Hello!

If I scan by "iw dev wlan0 scan" while sending data through the
interface, I get a BUG in net/mac80211/tx.c:

                /* RC is busted */
                if (WARN_ON_ONCE(info->control.rates[i].idx >=
                                 sband->n_bitrates)) {
                        info->control.rates[i].idx = -1;
                        continue;
                }

I added this statement inside the condition:

printk("idx = %d, bitrates = %d, i = %d\n", info->control.rates[i].idx,
sband->n_bitrates, i);

The result is:

idx = 9, bitrates = 8, i = 0
idx = 10, bitrates = 8, i = 1
idx = 9, bitrates = 8, i = 2

The card is 802.11a capable.  My interpretation is that scanning
switches to the 802.11a band temporarily, but doesn't stop transmission.
When transmitting, the rate indices for 2.4 GHz band are checked against
the number of rates in the 5 GHz band, which is indeed 8.  There are 12
rates in the 2.4 GHz band.

ath5k 0000:0b:00.0: PCI INT A disabled
ath5k 0000:0b:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
ath5k 0000:0b:00.0: setting latency timer to 64
ath5k 0000:0b:00.0: registered as 'phy2'
ath: Country alpha2 being used: US
ath: Regpair detected: 0x3a
phy2: Selected rate control algorithm 'minstrel'
ath5k phy2: Atheros AR5414 chip found (MAC: 0xa3, PHY: 0x61)

I actually had to patch the kernel, or the oops would escalate to a
panic.  Perhaps it's a good idea to have that check:

--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1246,6 +1246,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
                        PCI_DMA_TODEVICE);
 
        rate = ieee80211_get_tx_rate(sc->hw, info);
+       if (!rate)
+               return -EIO;
 
        if (info->flags & IEEE80211_TX_CTL_NO_ACK)
                flags |= AR5K_TXDESC_NOACK;

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-07 14:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-06 16:14 ath5k: scanning while transmitting causes oops on 802.11a capable card Pavel Roskin
2009-05-06 16:19 ` Johannes Berg
2009-05-06 16:36 ` [ath5k-devel] " Bob Copeland
2009-05-06 17:25   ` John W. Linville
2009-05-06 20:12     ` Pavel Roskin
2009-05-06 20:26       ` Johannes Berg
2009-05-06 21:29         ` Pavel Roskin
2009-05-07  6:01           ` Johannes Berg
2009-05-07  8:56     ` Bob Copeland
2009-05-07 14:04       ` Bob Copeland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).