From: Senthil Balasubramanian Date: Wed, 10 Jun 2009 21:55:33 +0530 Subject: [ath9k-devel] [PATCH] ath9k: Fix panic when ath9k is unloaded. In-Reply-To: <1244651133-6537-8-git-send-email-senthilkumar@atheros.com> References: <1244651133-6537-1-git-send-email-senthilkumar@atheros.com> <1244651133-6537-2-git-send-email-senthilkumar@atheros.com> <1244651133-6537-3-git-send-email-senthilkumar@atheros.com> <1244651133-6537-4-git-send-email-senthilkumar@atheros.com> <1244651133-6537-5-git-send-email-senthilkumar@atheros.com> <1244651133-6537-6-git-send-email-senthilkumar@atheros.com> <1244651133-6537-7-git-send-email-senthilkumar@atheros.com> <1244651133-6537-8-git-send-email-senthilkumar@atheros.com> Message-ID: <1244651133-6537-9-git-send-email-senthilkumar@atheros.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org RFKILL deinit should happen after the device is unregistered with mac80211. EIP: 0060:[] EFLAGS: 00010286 CPU: 1 EIP is at rfkill_pause_polling+0x11/0x30 [rfkill] EAX: 00000000 EBX: e1eaeab4 ECX: f8947048 EDX: da8f5c00 ESI: e1eae1c0 EDI: e1eaeb78 EBP: d808ddac ESP: d808ddac DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process rmmod (pid: 5618, ti=d808c000 task=f61a8410 task.ti=d808c000) Stack: d808ddcc f8902191 c02e4e10 ffffffff e1eaeb78 00000000 e1eae1c0 e1c0b360 d808de04 f856d62e e1c0b360 e1c0b4d8 e1c0b000 e1eae2b0 c02f500e 00000000 00000002 e1c0b6e0 e1c0b140 e1c0b000 f8586180 e1eae760 d808de20 c02e4df3 Call Trace: [] ? ath9k_stop+0x81/0x120 [ath9k] [] ? dev_close+0x90/0xd0 [] ? ieee80211_stop+0x27e/0x5c0 [mac80211] [] ? dev_deactivate+0x17e/0x1a0 [] ? dev_close+0x73/0xd0 [] ? rollback_registered+0x47/0x210 [] ? unregister_netdevice+0x1e/0x70 [] ? ieee80211_remove_interfaces+0x69/0xa0 [mac80211] [] ? ieee80211_unregister_hw+0x40/0xe0 [mac80211] [] ? ath_detach+0xbe/0x1e0 [ath9k] [] ? ath_cleanup+0x10/0x40 [ath9k] [] ? ath_pci_remove+0x18/0x20 [ath9k] [] ? pci_device_remove+0x1e/0x40 [] ? __device_release_driver+0x56/0x90 [] ? driver_detach+0x8f/0xa0 [] ? bus_remove_driver+0x7b/0xb0 [] ? driver_unregister+0x39/0x40 [] ? pci_unregister_driver+0x35/0x90 [] ? ath_pci_exit+0x12/0x20 [ath9k] [] ? ath9k_exit+0x10/0x3d [ath9k] [] ? mutex_unlock+0xd/0x10 [] ? sys_delete_module+0x167/0x210 [] ? do_munmap+0x22b/0x280 [] ? sysenter_do_call+0x12/0x2c EIP: [] rfkill_pause_polling+0x11/0x30 [rfkill] SS:ESP 0068:d808ddac Signed-off-by: Senthil Balasubramanian --- drivers/net/wireless/ath/ath9k/main.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index e2c8649..5ee9800 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1288,9 +1288,6 @@ void ath_detach(struct ath_softc *sc) DPRINTF(sc, ATH_DBG_CONFIG, "Detach ATH hw\n"); -#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) - ath_deinit_rfkill(sc); -#endif ath_deinit_leds(sc); cancel_work_sync(&sc->chan_work); cancel_delayed_work_sync(&sc->wiphy_work); @@ -1304,6 +1301,10 @@ void ath_detach(struct ath_softc *sc) ieee80211_free_hw(aphy->hw); } ieee80211_unregister_hw(hw); + +#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) + ath_deinit_rfkill(sc); +#endif ath_rx_cleanup(sc); ath_tx_cleanup(sc); -- 1.6.0.4