]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.33.2/ath9k-fix-lockdep-warning-when-unloading-module.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.33.2 / ath9k-fix-lockdep-warning-when-unloading-module.patch
CommitLineData
df00aad9
GKH
1From a9f042cbe5284f34ccff15f3084477e11b39b17b Mon Sep 17 00:00:00 2001
2From: Ming Lei <tom.leiming@gmail.com>
3Date: Sun, 28 Feb 2010 00:56:24 +0800
4Subject: ath9k: fix lockdep warning when unloading module
5
6From: Ming Lei <tom.leiming@gmail.com>
7
8commit a9f042cbe5284f34ccff15f3084477e11b39b17b upstream.
9
10Since txq->axq_lock may be hold in softirq context, it must be
11acquired with spin_lock_bh() instead of spin_lock() if softieq is
12enabled.
13
14The patch fixes the lockdep warning below when unloading ath9k modules.
15
16=================================
17[ INFO: inconsistent lock state ]
182.6.33-wl #12
19---------------------------------
20inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
21rmmod/3642 [HC0[0]:SC0[0]:HE1:SE1] takes:
22 (&(&txq->axq_lock)->rlock){+.?...}, at: [<ffffffffa03568c3>] ath_tx_node_cleanup+0x62/0x180 [ath9k]
23{IN-SOFTIRQ-W} state was registered at:
24 [<ffffffff8107577d>] __lock_acquire+0x2f6/0xd35
25 [<ffffffff81076289>] lock_acquire+0xcd/0xf1
26 [<ffffffff813a7486>] _raw_spin_lock_bh+0x3b/0x6e
27 [<ffffffffa0356b49>] spin_lock_bh+0xe/0x10 [ath9k]
28 [<ffffffffa0358ec7>] ath_tx_tasklet+0xcd/0x391 [ath9k]
29 [<ffffffffa0354f5f>] ath9k_tasklet+0x70/0xc8 [ath9k]
30 [<ffffffff8104e601>] tasklet_action+0x8c/0xf4
31 [<ffffffff8104f459>] __do_softirq+0xf8/0x1cd
32 [<ffffffff8100ab1c>] call_softirq+0x1c/0x30
33 [<ffffffff8100c2cf>] do_softirq+0x4b/0xa3
34 [<ffffffff8104f045>] irq_exit+0x4a/0x8c
35 [<ffffffff813acccc>] do_IRQ+0xac/0xc3
36 [<ffffffff813a7d53>] ret_from_intr+0x0/0x16
37 [<ffffffff81302d52>] cpuidle_idle_call+0x9e/0xf8
38 [<ffffffff81008be7>] cpu_idle+0x62/0x9d
39 [<ffffffff81391c1a>] rest_init+0x7e/0x80
40 [<ffffffff818bbd38>] start_kernel+0x3e8/0x3f3
41 [<ffffffff818bb2bc>] x86_64_start_reservations+0xa7/0xab
42 [<ffffffff818bb3b8>] x86_64_start_kernel+0xf8/0x107
43irq event stamp: 42037
44hardirqs last enabled at (42037): [<ffffffff813a7b21>] _raw_spin_unlock_irqrestore+0x47/0x56
45hardirqs last disabled at (42036): [<ffffffff813a72f4>] _raw_spin_lock_irqsave+0x2b/0x88
46softirqs last enabled at (42000): [<ffffffffa0353ea6>] spin_unlock_bh+0xe/0x10 [ath9k]
47softirqs last disabled at (41998): [<ffffffff813a7463>] _raw_spin_lock_bh+0x18/0x6e
48
49other info that might help us debug this:
504 locks held by rmmod/3642:
51 #0: (rtnl_mutex){+.+.+.}, at: [<ffffffff8132c10d>] rtnl_lock+0x17/0x19
52 #1: (&wdev->mtx){+.+.+.}, at: [<ffffffffa01e53f2>] cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211]
53 #2: (&ifmgd->mtx){+.+.+.}, at: [<ffffffffa0260834>] ieee80211_mgd_deauth+0x3f/0x17e [mac80211]
54 #3: (&local->sta_mtx){+.+.+.}, at: [<ffffffffa025a381>] sta_info_destroy_addr+0x2b/0x5e [mac80211]
55
56stack backtrace:
57Pid: 3642, comm: rmmod Not tainted 2.6.33-wl #12
58Call Trace:
59 [<ffffffff81074469>] valid_state+0x178/0x18b
60 [<ffffffff81014f94>] ? save_stack_trace+0x2f/0x4c
61 [<ffffffff81074e08>] ? check_usage_backwards+0x0/0x88
62 [<ffffffff8107458f>] mark_lock+0x113/0x230
63 [<ffffffff810757f1>] __lock_acquire+0x36a/0xd35
64 [<ffffffff8101018d>] ? native_sched_clock+0x2d/0x5f
65 [<ffffffffa03568c3>] ? ath_tx_node_cleanup+0x62/0x180 [ath9k]
66 [<ffffffff81076289>] lock_acquire+0xcd/0xf1
67 [<ffffffffa03568c3>] ? ath_tx_node_cleanup+0x62/0x180 [ath9k]
68 [<ffffffff810732eb>] ? trace_hardirqs_off+0xd/0xf
69 [<ffffffff813a7193>] _raw_spin_lock+0x36/0x69
70 [<ffffffffa03568c3>] ? ath_tx_node_cleanup+0x62/0x180 [ath9k]
71 [<ffffffffa03568c3>] ath_tx_node_cleanup+0x62/0x180 [ath9k]
72 [<ffffffff810749ed>] ? trace_hardirqs_on+0xd/0xf
73 [<ffffffffa0353950>] ath9k_sta_remove+0x22/0x26 [ath9k]
74 [<ffffffffa025a08f>] __sta_info_destroy+0x1ad/0x38c [mac80211]
75 [<ffffffffa025a394>] sta_info_destroy_addr+0x3e/0x5e [mac80211]
76 [<ffffffffa02605d6>] ieee80211_set_disassoc+0x175/0x180 [mac80211]
77 [<ffffffffa026084d>] ieee80211_mgd_deauth+0x58/0x17e [mac80211]
78 [<ffffffff813a60c1>] ? __mutex_lock_common+0x37f/0x3a4
79 [<ffffffffa01e53f2>] ? cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211]
80 [<ffffffffa026786e>] ieee80211_deauth+0x1e/0x20 [mac80211]
81 [<ffffffffa01f47f9>] __cfg80211_mlme_deauth+0x130/0x13f [cfg80211]
82 [<ffffffffa01e53f2>] ? cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211]
83 [<ffffffff810732eb>] ? trace_hardirqs_off+0xd/0xf
84 [<ffffffffa01f7eee>] __cfg80211_disconnect+0x111/0x189 [cfg80211]
85 [<ffffffffa01e5433>] cfg80211_netdev_notifier_call+0x2ce/0x46d [cfg80211]
86 [<ffffffff813aa9ea>] notifier_call_chain+0x37/0x63
87 [<ffffffff81068c98>] raw_notifier_call_chain+0x14/0x16
88 [<ffffffff81322e97>] call_netdevice_notifiers+0x1b/0x1d
89 [<ffffffff8132386d>] dev_close+0x6a/0xa6
90 [<ffffffff8132395f>] rollback_registered_many+0xb6/0x2f4
91 [<ffffffff81323bb8>] unregister_netdevice_many+0x1b/0x66
92 [<ffffffffa026494f>] ieee80211_remove_interfaces+0xc5/0xd0 [mac80211]
93 [<ffffffffa02580a2>] ieee80211_unregister_hw+0x47/0xe8 [mac80211]
94 [<ffffffffa035290e>] ath9k_deinit_device+0x7a/0x9b [ath9k]
95 [<ffffffffa035bc26>] ath_pci_remove+0x38/0x76 [ath9k]
96 [<ffffffff8120940a>] pci_device_remove+0x2d/0x51
97 [<ffffffff8129d797>] __device_release_driver+0x7b/0xd1
98 [<ffffffff8129d885>] driver_detach+0x98/0xbe
99 [<ffffffff8129ca7a>] bus_remove_driver+0x94/0xb7
100 [<ffffffff8129ddd6>] driver_unregister+0x6c/0x74
101 [<ffffffff812096d2>] pci_unregister_driver+0x46/0xad
102 [<ffffffffa035bae1>] ath_pci_exit+0x15/0x17 [ath9k]
103 [<ffffffffa035e1a2>] ath9k_exit+0xe/0x2f [ath9k]
104 [<ffffffff8108050a>] sys_delete_module+0x1c7/0x236
105 [<ffffffff813a7df5>] ? retint_swapgs+0x13/0x1b
106 [<ffffffff810749b5>] ? trace_hardirqs_on_caller+0x119/0x144
107 [<ffffffff8109b9f6>] ? audit_syscall_entry+0x11e/0x14a
108 [<ffffffff81009bb2>] system_call_fastpath+0x16/0x1b
109wlan1: deauthenticating from 00:23:cd:e1:f9:b2 by local choice (reason=3)
110PM: Removing info for No Bus:wlan1
111cfg80211: Calling CRDA to update world regulatory domain
112PM: Removing info for No Bus:rfkill2
113PM: Removing info for No Bus:phy1
114ath9k 0000:16:00.0: PCI INT A disabled
115
116Signed-off-by: Ming Lei <tom.leiming@gmail.com>
117Signed-off-by: John W. Linville <linville@tuxdriver.com>
118Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
119
120---
121 drivers/net/wireless/ath/ath9k/xmit.c | 4 ++--
122 1 file changed, 2 insertions(+), 2 deletions(-)
123
124--- a/drivers/net/wireless/ath/ath9k/xmit.c
125+++ b/drivers/net/wireless/ath/ath9k/xmit.c
126@@ -2264,7 +2264,7 @@ void ath_tx_node_cleanup(struct ath_soft
127 if (ATH_TXQ_SETUP(sc, i)) {
128 txq = &sc->tx.txq[i];
129
130- spin_lock(&txq->axq_lock);
131+ spin_lock_bh(&txq->axq_lock);
132
133 list_for_each_entry_safe(ac,
134 ac_tmp, &txq->axq_acq, list) {
135@@ -2285,7 +2285,7 @@ void ath_tx_node_cleanup(struct ath_soft
136 }
137 }
138
139- spin_unlock(&txq->axq_lock);
140+ spin_unlock_bh(&txq->axq_lock);
141 }
142 }
143 }