OpenCloudOS-Kernel/drivers/net/wireless
Stanislaw Gruszka e55b32c110 rtlwifi: fix lps_lock deadlock
rtl_lps_leave can be called from interrupt context, so we have to
disable interrupts when taking lps_lock.

Below is full lockdep info about deadlock:

[   93.815269] =================================
[   93.815390] [ INFO: inconsistent lock state ]
[   93.815472] 2.6.41.1-3.offch.fc15.x86_64.debug #1
[   93.815556] ---------------------------------
[   93.815635] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
[   93.815743] swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
[   93.815832]  (&(&rtlpriv->locks.lps_lock)->rlock){+.?...}, at: [<ffffffffa025dad6>] rtl_lps_leave+0x26/0x103 [rtlwifi]
[   93.815947] {SOFTIRQ-ON-W} state was registered at:
[   93.815947]   [<ffffffff8108e10d>] __lock_acquire+0x369/0xd0c
[   93.815947]   [<ffffffff8108efb3>] lock_acquire+0xf3/0x13e
[   93.815947]   [<ffffffff814e981d>] _raw_spin_lock+0x45/0x79
[   93.815947]   [<ffffffffa025de34>] rtl_swlps_rf_awake+0x5a/0x76 [rtlwifi]
[   93.815947]   [<ffffffffa025aec0>] rtl_op_config+0x12a/0x32a [rtlwifi]
[   93.815947]   [<ffffffffa01d614b>] ieee80211_hw_config+0x124/0x129 [mac80211]
[   93.815947]   [<ffffffffa01e0af3>] ieee80211_dynamic_ps_disable_work+0x32/0x47 [mac80211]
[   93.815947]   [<ffffffff81075aa5>] process_one_work+0x205/0x3e7
[   93.815947]   [<ffffffff81076753>] worker_thread+0xda/0x15d
[   93.815947]   [<ffffffff8107a119>] kthread+0xa8/0xb0
[   93.815947]   [<ffffffff814f3184>] kernel_thread_helper+0x4/0x10
[   93.815947] irq event stamp: 547822
[   93.815947] hardirqs last  enabled at (547822): [<ffffffff814ea1a7>] _raw_spin_unlock_irqrestore+0x45/0x61
[   93.815947] hardirqs last disabled at (547821): [<ffffffff814e9987>] _raw_spin_lock_irqsave+0x22/0x8e
[   93.815947] softirqs last  enabled at (547790): [<ffffffff810623ed>] _local_bh_enable+0x13/0x15
[   93.815947] softirqs last disabled at (547791): [<ffffffff814f327c>] call_softirq+0x1c/0x30
[   93.815947]
[   93.815947] other info that might help us debug this:
[   93.815947]  Possible unsafe locking scenario:
[   93.815947]
[   93.815947]        CPU0
[   93.815947]        ----
[   93.815947]   lock(&(&rtlpriv->locks.lps_lock)->rlock);
[   93.815947]   <Interrupt>
[   93.815947]     lock(&(&rtlpriv->locks.lps_lock)->rlock);
[   93.815947]
[   93.815947]  *** DEADLOCK ***
[   93.815947]
[   93.815947] no locks held by swapper/0.
[   93.815947]
[   93.815947] stack backtrace:
[   93.815947] Pid: 0, comm: swapper Not tainted 2.6.41.1-3.offch.fc15.x86_64.debug #1
[   93.815947] Call Trace:
[   93.815947]  <IRQ>  [<ffffffff814dfd00>] print_usage_bug+0x1e7/0x1f8
[   93.815947]  [<ffffffff8101a849>] ? save_stack_trace+0x2c/0x49
[   93.815947]  [<ffffffff8108d55c>] ? print_irq_inversion_bug.part.18+0x1a0/0x1a0
[   93.815947]  [<ffffffff8108dc8a>] mark_lock+0x106/0x220
[   93.815947]  [<ffffffff8108e099>] __lock_acquire+0x2f5/0xd0c
[   93.815947]  [<ffffffff810152af>] ? native_sched_clock+0x34/0x36
[   93.830125]  [<ffffffff810152ba>] ? sched_clock+0x9/0xd
[   93.830125]  [<ffffffff81080181>] ? sched_clock_local+0x12/0x75
[   93.830125]  [<ffffffffa025dad6>] ? rtl_lps_leave+0x26/0x103 [rtlwifi]
[   93.830125]  [<ffffffff8108efb3>] lock_acquire+0xf3/0x13e
[   93.830125]  [<ffffffffa025dad6>] ? rtl_lps_leave+0x26/0x103 [rtlwifi]
[   93.830125]  [<ffffffff814e981d>] _raw_spin_lock+0x45/0x79
[   93.830125]  [<ffffffffa025dad6>] ? rtl_lps_leave+0x26/0x103 [rtlwifi]
[   93.830125]  [<ffffffff81422467>] ? skb_dequeue+0x62/0x6d
[   93.830125]  [<ffffffffa025dad6>] rtl_lps_leave+0x26/0x103 [rtlwifi]
[   93.830125]  [<ffffffffa025f677>] _rtl_pci_ips_leave_tasklet+0xe/0x10 [rtlwifi]
[   93.830125]  [<ffffffff8106281f>] tasklet_action+0x8d/0xee
[   93.830125]  [<ffffffff810629ce>] __do_softirq+0x112/0x25a
[   93.830125]  [<ffffffff814f327c>] call_softirq+0x1c/0x30
[   93.830125]  [<ffffffff81010bf6>] do_softirq+0x4b/0xa1
[   93.830125]  [<ffffffff81062d7d>] irq_exit+0x5d/0xcf
[   93.830125]  [<ffffffff814f3b7e>] do_IRQ+0x8e/0xa5
[   93.830125]  [<ffffffff814ea533>] common_interrupt+0x73/0x73
[   93.830125]  <EOI>  [<ffffffff8108b825>] ? trace_hardirqs_off+0xd/0xf
[   93.830125]  [<ffffffff812bb6d5>] ? intel_idle+0xe5/0x10c
[   93.830125]  [<ffffffff812bb6d1>] ? intel_idle+0xe1/0x10c
[   93.830125]  [<ffffffff813f8d5e>] cpuidle_idle_call+0x11c/0x1fe
[   93.830125]  [<ffffffff8100e2ef>] cpu_idle+0xab/0x101
[   93.830125]  [<ffffffff814c6373>] rest_init+0xd7/0xde
[   93.830125]  [<ffffffff814c629c>] ? csum_partial_copy_generic+0x16c/0x16c
[   93.830125]  [<ffffffff81d4bbb0>] start_kernel+0x3dd/0x3ea
[   93.830125]  [<ffffffff81d4b2c4>] x86_64_start_reservations+0xaf/0xb3
[   93.830125]  [<ffffffff81d4b140>] ? early_idt_handlers+0x140/0x140
[   93.830125]  [<ffffffff81d4b3ca>] x86_64_start_kernel+0x102/0x111

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=755154

Reported-by: vjain02@students.poly.edu
Reported-and-tested-by: Oliver Paukstadt <pstadt@sourcentral.org>
Cc: stable@vger.kernel.org
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28 13:46:41 -05:00
..
ath ath: Fix NULL ptr dereference in ath_reg_apply_world_flags 2011-11-08 15:02:45 -05:00
b43 b43: HT-PHY: report signal to mac80211 2011-11-07 13:19:12 -05:00
b43legacy mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
brcm80211 brcm80211: smac: eliminate a null pointer dereference in dma.c 2011-11-07 13:19:13 -05:00
hostap net: remove use of ndo_set_multicast_list in drivers 2011-08-17 20:22:03 -07:00
ipw2x00 Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 2011-10-25 15:18:39 +02:00
iwlegacy mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
iwlwifi iwlwifi: avoid a panic when unloading the module with RF Kill 2011-11-11 11:03:24 -05:00
iwmc3200wifi iwmc3200wifi: add a range check to iwm_cfg80211_get_key() 2011-10-14 14:48:15 -04:00
libertas Net, libertas: Resolve memory leak in if_spi_host_to_card() 2011-11-15 10:02:57 -05:00
libertas_tf libertas_tf: deb_defs.h: Fix typo in include guard 2011-09-15 14:34:14 +02:00
mwifiex mwifiex: fix association issue with AP configured in hidden SSID mode 2011-11-11 11:03:25 -05:00
orinoco Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2011-08-22 14:28:50 -04:00
p54 p54spi: Fix workqueue deadlock 2011-11-17 14:40:37 -05:00
prism54 prism54: potential memory corruption in prism54_get_essid() 2011-11-21 14:45:21 -05:00
rt2x00 Revert "rt2800pci: handle spurious interrupts" 2011-11-22 16:38:19 -05:00
rtl818x mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
rtlwifi rtlwifi: fix lps_lock deadlock 2011-11-28 13:46:41 -05:00
wl12xx wl12xx: fix wl12xx_scan_sched_scan_ssid_list() check that all given ssids are in filters 2011-11-08 15:02:45 -05:00
wl1251 mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
zd1211rw mac80211: add ieee80211_vif param to tsf functions 2011-09-27 14:27:48 -04:00
Kconfig net: wireless: add brcm80211 drivers 2011-10-11 15:55:30 -04:00
Makefile net: wireless: add brcm80211 drivers 2011-10-11 15:55:30 -04:00
adm8211.c mac80211: add ieee80211_vif param to tsf functions 2011-09-27 14:27:48 -04:00
adm8211.h
airo.c net: remove use of ndo_set_multicast_list in drivers 2011-08-17 20:22:03 -07:00
airo.h
airo_cs.c
at76c50x-usb.c wireless: at76c50x: use native hex_pack_byte() method 2011-09-30 15:16:25 -04:00
at76c50x-usb.h
atmel.c
atmel.h
atmel_cs.c
atmel_pci.c
mac80211_hwsim.c mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
mac80211_hwsim.h
mwl8k.c mac80211: pass vif param to conf_tx() callback 2011-10-03 15:22:41 -04:00
ray_cs.c net: remove use of ndo_set_multicast_list in drivers 2011-08-17 20:22:03 -07:00
ray_cs.h
rayctl.h
rndis_wlan.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2011-08-22 14:28:50 -04:00
wl3501.h
wl3501_cs.c wl3501_cs: min_t() cast truncates high bits 2011-09-27 14:36:04 -04:00
zd1201.c net: remove use of ndo_set_multicast_list in drivers 2011-08-17 20:22:03 -07:00
zd1201.h