linux_dsm_epyc7002/drivers/net/wireless
Michal Kazior 4eb2e16487 ath10k: avoid possible deadlock with scan timeout
This should prevent deadlock predicted by the
following splat:

 ======================================================
 [ INFO: possible circular locking dependency detected ]
 3.17.0-wl-ath+ #67 Not tainted
 -------------------------------------------------------
 kworker/u32:1/7230 is trying to acquire lock:
  (&ar->conf_mutex){+.+.+.}, at: [<ffffffffa040a57d>] ath10k_scan_timeout_work+0x2d/0x50 [ath10k_core]

 but task is already holding lock:
  ((&(&ar->scan.timeout)->work)){+.+...}, at: [<ffffffff8106dae1>] process_one_work+0x151/0x470

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -> #1 ((&(&ar->scan.timeout)->work)){+.+...}:
        [<ffffffff810a12e5>] lock_acquire+0x85/0x100
        [<ffffffff8106cb4d>] flush_work+0x3d/0x270
        [<ffffffff8106e49d>] __cancel_work_timer+0x7d/0x110
        [<ffffffff8106e543>] cancel_delayed_work_sync+0x13/0x20
        [<ffffffffa0409f16>] ath10k_cancel_remain_on_channel+0x36/0x60 [ath10k_core]
        [<ffffffffa028c75c>] ieee80211_cancel_roc+0x1cc/0x2f0 [mac80211]
        [<ffffffffa028c8a2>] ieee80211_mgmt_tx_cancel_wait+0x22/0x30 [mac80211]
        [<ffffffffa0132288>] nl80211_tx_mgmt_cancel_wait+0xa8/0x130 [cfg80211]
        [<ffffffff816654a5>] genl_family_rcv_msg+0x1a5/0x3c0
        [<ffffffff81665749>] genl_rcv_msg+0x89/0xc0
        [<ffffffff81664e91>] netlink_rcv_skb+0xb1/0xc0
        [<ffffffff816650bc>] genl_rcv+0x2c/0x40
        [<ffffffff8166474d>] netlink_unicast+0x18d/0x200
        [<ffffffff81664add>] netlink_sendmsg+0x31d/0x430
        [<ffffffff8161a9ac>] sock_sendmsg+0x9c/0xd0
        [<ffffffff8161b469>] ___sys_sendmsg+0x389/0x3a0
        [<ffffffff8161bed9>] __sys_sendmsg+0x49/0x90
        [<ffffffff8161bf32>] SyS_sendmsg+0x12/0x20
        [<ffffffff8174c456>] system_call_fastpath+0x1a/0x1f

 -> #0 (&ar->conf_mutex){+.+.+.}:
        [<ffffffff810a0bde>] __lock_acquire+0x1b6e/0x1ce0
        [<ffffffff810a12e5>] lock_acquire+0x85/0x100
        [<ffffffff817491eb>] mutex_lock_nested+0x4b/0x370
        [<ffffffffa040a57d>] ath10k_scan_timeout_work+0x2d/0x50 [ath10k_core]
        [<ffffffff8106db41>] process_one_work+0x1b1/0x470
        [<ffffffff8106df63>] worker_thread+0x123/0x460
        [<ffffffff81073f34>] kthread+0xe4/0x100
        [<ffffffff8174c3ac>] ret_from_fork+0x7c/0xb0

 other info that might help us debug this:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock((&(&ar->scan.timeout)->work));
                                lock(&ar->conf_mutex);
                                lock((&(&ar->scan.timeout)->work));
   lock(&ar->conf_mutex);

  *** DEADLOCK ***

Reported-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-10-31 02:16:30 +02:00
..
ath ath10k: avoid possible deadlock with scan timeout 2014-10-31 02:16:30 +02:00
b43 b43: N-PHY: support setting custom TX power 2014-08-25 16:00:43 -04:00
b43legacy
brcm80211 brcmfmac: fix memory leakage in msgbuf 2014-08-11 14:43:51 -04:00
cw1200 cw1200: Introduce the use of devm_kzalloc 2014-08-25 16:00:43 -04:00
hostap PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
ipw2x00 net: wireless: ipw2x00: ipw2200.c: Cleaning up missing null-terminate in conjunction with strncpy 2014-08-25 16:17:40 -04:00
iwlegacy PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
iwlwifi PCI changes for the v3.17 merge window (part 2): 2014-08-14 18:10:33 -06:00
libertas net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
libertas_tf
mwifiex mwifiex: use firmware API revision from GET_HW_SPEC response 2014-08-28 14:41:56 -04:00
orinoco orinoco_usb: use USB API functions rather than constants 2014-08-25 16:17:42 -04:00
p54 PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
prism54 PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
rsi rsi: fix memory leaks and error handling in rsi_91x_usb 2014-07-01 14:26:26 -04:00
rt2x00 rt2x00: support Ralink 5362. 2014-08-28 14:49:39 -04:00
rtl818x PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
rtlwifi PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
ti wireless: wlcore: Use devm_kzalloc 2014-08-25 16:17:39 -04:00
zd1211rw wireless: zd1211rw: new url for fw, remove experimental 2014-07-15 16:00:17 -04:00
adm8211.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
adm8211.h
airo_cs.c airo_cs: Remove typedef local_info_t 2014-08-11 12:19:53 -07:00
airo.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
airo.h
at76c50x-usb.c mac80211: support more than one band in scan request 2014-06-25 09:10:42 +02:00
at76c50x-usb.h
atmel_cs.c atmel_cs: Remove typedef local_info_t 2014-08-25 16:17:41 -04:00
atmel_pci.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
atmel.c atmel: Remove typedef atmel_priv_ioctl 2014-08-11 12:19:53 -07:00
atmel.h
Kconfig net: fix USB network driver config option. 2014-08-06 16:00:20 -07:00
mac80211_hwsim.c Merge tag 'master-2014-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next 2014-07-28 17:36:25 -07:00
mac80211_hwsim.h
Makefile
mwl8k.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
ray_cs.c
ray_cs.h ray_cs: Add include guards 2014-08-28 14:41:56 -04:00
rayctl.h ray_cs: Add include guards 2014-08-28 14:41:56 -04:00
rndis_wlan.c
wl3501_cs.c
wl3501.h
zd1201.c
zd1201.h