Return-path: Received: from mail.atheros.com ([12.36.123.2]:58058 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757359AbZFJNVf (ORCPT ); Wed, 10 Jun 2009 09:21:35 -0400 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Wed, 10 Jun 2009 06:21:38 -0700 Date: Wed, 10 Jun 2009 18:50:16 +0530 From: Vasanthakumar Thiagarajan To: Johannes Berg CC: "linux-wireless@vger.kernel.org" , Luis Rodriguez Subject: Re: [RFT 2/3] ath9k: port to cfg80211 rfkill Message-ID: <20090610132015.GA10126@vasanth-laptop> References: <20090602111027.460530075@sipsolutions.net> <20090602111112.191915040@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: <20090602111112.191915040@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, Jun 02, 2009 at 04:40:29PM +0530, Johannes Berg wrote: > This ports the ath9k rfkill code to the new API offered by > cfg80211 and thus removes a lot of useless stuff. > I get the following lockdep warning few times when tried to scan after rfkill on/off. One more issue is, when rfkill is enabled before reboot, I could not bring up the interface when the rfkill is turned off after reboot. Apart from this it looks good, fixes a panic which used to happen during module unload. 757.714408] [ 757.714410] ======================================================= [ 757.714414] [ INFO: possible circular locking dependency detected ] [ 757.714418] 2.6.30-rc8-wl #87 [ 757.714420] ------------------------------------------------------- [ 757.714423] iwlist/3121 is trying to acquire lock: [ 757.714425] (cfg80211_mutex){+.+.+.}, at: [] cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714439] [ 757.714440] but task is already holding lock: [ 757.714443] (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x14/0x20 [ 757.714453] [ 757.714453] which lock already depends on the new lock. [ 757.714454] [ 757.714457] [ 757.714457] the existing dependency chain (in reverse order) is: [ 757.714460] [ 757.714461] -> #2 (rtnl_mutex){+.+.+.}: [ 757.714466] [] __lock_acquire+0xece/0x1780 [ 757.714473] [] lock_acquire+0xe0/0x110 [ 757.714477] [] mutex_lock_nested+0x5e/0x360 [ 757.714484] [] rtnl_lock+0x14/0x20 [ 757.714488] [] 0xfbfc99cd [ 757.714501] [] rfkill_set_block+0x65/0xd0 [rfkill] [ 757.714509] [] rfkill_epo+0x44/0xa0 [rfkill] [ 757.714515] [] rfkill_op_handler+0x5d/0x1c0 [rfkill] [ 757.714522] [] worker_thread+0x1c0/0x2f0 [ 757.714528] [] kthread+0x4b/0x80 [ 757.714532] [] kernel_thread_helper+0x7/0x10 [ 757.714538] [] 0xffffffff [ 757.714545] [ 757.714545] -> #1 (rfkill_global_mutex){+.+.+.}: [ 757.714550] [] __lock_acquire+0xece/0x1780 [ 757.714555] [] lock_acquire+0xe0/0x110 [ 757.714559] [] mutex_lock_nested+0x5e/0x360 [ 757.714564] [] rfkill_register+0x24/0x270 [rfkill] [ 757.714572] [] wiphy_register+0x181/0x230 [cfg80211] [ 757.714579] [] ieee80211_register_hw+0x136/0x4d0 [mac80211] [ 757.714593] [] ath_attach+0x74c/0xa20 [ath9k] [ 757.714605] [] ath_pci_probe+0x12c/0x2e0 [ath9k] [ 757.714614] [] local_pci_probe+0x13/0x20 [ 757.714620] [] pci_device_probe+0x68/0x90 [ 757.714625] [] driver_probe_device+0x71/0x170 [ 757.714631] [] __driver_attach+0x89/0xa0 [ 757.714635] [] bus_for_each_dev+0x5b/0x80 [ 757.714639] [] driver_attach+0x1e/0x20 [ 757.714644] [] bus_add_driver+0x237/0x2f0 [ 757.714648] [] driver_register+0x7a/0x150 [ 757.714652] [] __pci_register_driver+0x53/0xc0 [ 757.714657] [] ath_pci_init+0x1c/0x20 [ath9k] [ 757.714666] [] 0xf88c0022 [ 757.714678] [] do_one_initcall+0x2b/0x1c0 [ 757.714682] [] sys_init_module+0x8a/0x1d0 [ 757.714687] [] sysenter_do_call+0x12/0x3c [ 757.714691] [] 0xffffffff [ 757.714709] [ 757.714710] -> #0 (cfg80211_mutex){+.+.+.}: [ 757.714715] [] __lock_acquire+0x1003/0x1780 [ 757.714720] [] lock_acquire+0xe0/0x110 [ 757.714724] [] mutex_lock_nested+0x5e/0x360 [ 757.714729] [] cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714737] [] cfg80211_wext_siwscan+0x43/0x210 [cfg80211] [ 757.714746] [] ioctl_standard_call+0x1a1/0x3a0 [ 757.714751] [] wext_handle_ioctl+0x14f/0x220 [ 757.714756] [] dev_ioctl+0x485/0x560 [ 757.714760] [] sock_ioctl+0xf5/0x270 [ 757.714765] [] vfs_ioctl+0x2d/0x90 [ 757.714771] [] do_vfs_ioctl+0x7a/0x590 [ 757.714775] [] sys_ioctl+0x6b/0x70 [ 757.714779] [] sysenter_do_call+0x12/0x3c [ 757.714784] [] 0xffffffff [ 757.714795] [ 757.714796] other info that might help us debug this: [ 757.714797] [ 757.714799] 1 lock held by iwlist/3121: [ 757.714802] #0: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x14/0x20 [ 757.714809] [ 757.714810] stack backtrace: [ 757.714813] Pid: 3121, comm: iwlist Not tainted 2.6.30-rc8-wl #87 [ 757.714816] Call Trace: [ 757.714820] [] ? printk+0x1d/0x26 [ 757.714825] [] print_circular_bug_tail+0xbc/0xc0 [ 757.714829] [] ? print_circular_bug_entry+0x4b/0x50 [ 757.714834] [] __lock_acquire+0x1003/0x1780 [ 757.714839] [] ? __lock_acquire+0x14d/0x1780 [ 757.714848] [] ? cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714852] [] lock_acquire+0xe0/0x110 [ 757.714859] [] ? cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714867] [] ? cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714871] [] mutex_lock_nested+0x5e/0x360 [ 757.714878] [] ? cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714883] [] ? mark_held_locks+0x62/0x80 [ 757.714888] [] ? __kmalloc+0x9c/0x250 [ 757.714895] [] cfg80211_get_dev_from_ifindex+0x1d/0x80 [cfg80211] [ 757.714903] [] cfg80211_wext_siwscan+0x43/0x210 [cfg80211] [ 757.714907] [] ? ioctl_standard_call+0x16b/0x3a0 [ 757.714912] [] ? ioctl_standard_call+0x16b/0x3a0 [ 757.714916] [] ioctl_standard_call+0x1a1/0x3a0 [ 757.714920] [] ? rtnl_lock+0x14/0x20 [ 757.714926] [] ? __dev_get_by_name+0x85/0xb0 [ 757.714930] [] wext_handle_ioctl+0x14f/0x220 [ 757.714938] [] ? cfg80211_wext_siwscan+0x0/0x210 [cfg80211] [ 757.714942] [] dev_ioctl+0x485/0x560 [ 757.714947] [] ? sock_ioctl+0x0/0x270 [ 757.714951] [] sock_ioctl+0xf5/0x270 [ 757.714955] [] ? sock_ioctl+0x0/0x270 [ 757.714959] [] vfs_ioctl+0x2d/0x90 [ 757.714964] [] do_vfs_ioctl+0x7a/0x590 [ 757.714969] [] ? handle_mm_fault+0x126/0x740 [ 757.714975] [] ? do_page_fault+0x17e/0x2c0 [ 757.714980] [] ? trace_hardirqs_off_thunk+0xc/0x10 [ 757.714984] [] ? trace_hardirqs_on_thunk+0xc/0x10 [ 757.714989] [] ? up_read+0x1b/0x30 [ 757.714993] [] ? sysenter_exit+0xf/0x1a [ 757.714997] [] sys_ioctl+0x6b/0x70 [ 757.715001] [] sysenter_do_call+0x12/0x3c [ 757.715011] phy0: device no longer idle - scanning [ 758.876667] wlan0: dropped data frame to not associated station 00:00:00:00:00:00 [ 763.813869] phy0: device now idle