Return-path: Received: from mail.atheros.com ([12.36.123.2]:39383 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbYISO2I (ORCPT ); Fri, 19 Sep 2008 10:28:08 -0400 Date: Fri, 19 Sep 2008 19:58:01 +0530 From: Senthil Balasubramanian To: Steven Noonan CC: Luis Rodriguez , Ingo Molnar , "ath9k-devel@lists.ath9k.org" , linux-wireless , LKML Subject: Re: [ath9k-devel] ath9k: massive unexplained latency in 2.6.27 (rc5, rc6, probably others) Message-ID: <20080919142801.GA5816@senthil-lnx.users.atheros.com> (sfid-20080919_162814_691747_C048ED25) References: <43e72e890809181344q416b5944w3332ee5a33db048c@mail.gmail.com> <20080918220102.GE7408@tesla> <43e72e890809181508w5232a14ewbf2bf18fe90a92d5@mail.gmail.com> <43e72e890809181610h3a7729d8s4c8484d97b21932e@mail.gmail.com> <20080919030125.GG7408@tesla> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, Sep 19, 2008 at 12:59:29PM +0530, Steven Noonan wrote: > On Thu, Sep 18, 2008 at 8:01 PM, Luis R. Rodriguez > wrote: > > Thanks for testing, and glad to see this is resolved. > > > > Damn. It's back. I was using wireless normally this evening. Browsing > the web, that kind of thing, and then the wireless inexplicably > dropped (even with the group rekeying patch), so I unloaded/reloaded > the module. This popped up in dmesg: > > [ 3834.375658] vendor=8086 device=27d2 > [ 3834.375666] ath9k 0000:03:00.0: PCI INT A disabled > [ 3834.375716] ath9k: driver unloaded > [ 3838.552419] ath9k: 0.1 > [ 3838.552502] vendor=8086 device=27d2 > [ 3838.552511] ath9k 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17 > [ 3838.552532] ath9k 0000:03:00.0: setting latency timer to 64 > [ 3838.688924] phy1: Selected rate control algorithm 'ath9k_rate_control' > [ 3838.693652] phy1: Atheros 5416: mem=0xffffc20000060000, irq=17 > [ 3839.427125] irq 17: nobody cared (try booting with the "irqpoll" option) > [ 3839.427136] Pid: 0, comm: swapper Tainted: P > 2.6.27-rc6-tip-00478-g74f1a36 #1 > [ 3839.427141] Call Trace: > [ 3839.427145] [] ? read_hpet+0x9/0x1c > [ 3839.427165] [] __report_bad_irq+0x3d/0x8c > [ 3839.427172] [] note_interrupt+0x106/0x160 > [ 3839.427180] [] handle_fasteoi_irq+0xad/0xda > [ 3839.427188] [] do_IRQ+0x10c/0x190 > [ 3839.427194] [] ret_from_intr+0x0/0xa > [ 3839.427198] [] rcu_pending+0x62/0x6e > [ 3839.427211] [] ? tick_nohz_stop_sched_tick+0x2e4/0x2f3 > [ 3839.427218] [] cpu_idle+0x7b/0xdb > [ 3839.427226] [] rest_init+0x75/0x77 > [ 3839.427231] handlers: > [ 3839.427234] [] (ath_isr+0x0/0x170 [ath9k]) > [ 3839.427263] Disabling IRQ #17 > [ 3842.263699] ADDRCONF(NETDEV_UP): wlan0: link is not ready > [ 3848.035003] ADDRCONF(NETDEV_UP): wlan0: link is not ready > [ 3848.432701] ADDRCONF(NETDEV_UP): wlan0: link is not ready > [ 3850.216947] wlan0: authenticate with AP 00:1e:52:79:4d:01 > [ 3850.217027] wlan0: authenticate with AP 00:1e:52:79:4d:01 > [ 3850.228326] wlan0: authenticated > [ 3850.228336] wlan0: associate with AP 00:1e:52:79:4d:01 > [ 3850.428140] wlan0: associate with AP 00:1e:52:79:4d:01 > [ 3850.628151] wlan0: associate with AP 00:1e:52:79:4d:01 > [ 3850.728305] wlan0: RX AssocResp from 00:1e:52:79:4d:01 (capab=0x431 > status=0 aid=1) > [ 3850.728314] wlan0: associated > [ 3850.728655] wlan0 (WE) : Wireless Event too big (320) > [ 3850.743377] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready > [ 3860.855104] wlan0: no IPv6 routers present > > I rebuilt the module with DBG_ATH_INTERRUPT, but it somehow stumbled > itself back into working order while I was compiling. I can't keep the > interrupt debugging on all the time because it's just -too verbose-, > and when I pop a debug version of the module in, then it's too late to > track the issue.... I am able to reproduce this IRQ nobody cared issue in my setup and the following patch seems to be fixing the issue. Please try it out and let me know if it solves your issue in your setup. ********** IRQs should be disabled before calling free_irq. Also clear pending IRQs. Signed-off-by: Senthil Balasubramanian --- drivers/net/wireless/ath9k/core.c | 2 ++ drivers/net/wireless/ath9k/main.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c index c262ef2..c007dd2 100644 --- a/drivers/net/wireless/ath9k/core.c +++ b/drivers/net/wireless/ath9k/core.c @@ -1183,6 +1183,8 @@ void ath_deinit(struct ath_softc *sc) DPRINTF(sc, ATH_DBG_CONFIG, "%s\n", __func__); + tasklet_kill(&sc->intr_tq); + tasklet_kill(&sc->bcon_tasklet); ath_stop(sc); if (!(sc->sc_flags & SC_OP_INVALID)) ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index aca893a..559e0e8 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c @@ -1781,10 +1781,16 @@ static void ath_pci_remove(struct pci_dev *pdev) { struct ieee80211_hw *hw = pci_get_drvdata(pdev); struct ath_softc *sc = hw->priv; + enum ath9k_int status; - if (pdev->irq) + if (pdev->irq) { + ath9k_hw_set_interrupts(sc->sc_ah, 0); + ath9k_hw_getisr(sc->sc_ah, &status); /* NB: clears ISR too */ + sc->sc_flags |= SC_OP_INVALID; free_irq(pdev->irq, sc); + } ath_detach(sc); + pci_iounmap(pdev, sc->mem); pci_release_region(pdev, 0); pci_disable_device(pdev); -- 1.5.5