netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Lior David <liord@codeaurora.org>,
	Maya Erez <merez@codeaurora.org>,
	Kalle Valo <kvalo@codeaurora.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 120/150] wil6210: fix locking in wmi_call
Date: Sat, 16 Nov 2019 10:46:58 -0500	[thread overview]
Message-ID: <20191116154729.9573-120-sashal@kernel.org> (raw)
In-Reply-To: <20191116154729.9573-1-sashal@kernel.org>

From: Lior David <liord@codeaurora.org>

[ Upstream commit dc57731dbd535880fe6ced31c229262c34df7d64 ]

Switch from spin_lock to spin_lock_irqsave, because
wmi_ev_lock is used inside interrupt handler.

Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/wil6210/wmi.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index d63d7c3268018..798516f42f2f9 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -1002,15 +1002,16 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
 {
 	int rc;
 	unsigned long remain;
+	ulong flags;
 
 	mutex_lock(&wil->wmi_mutex);
 
-	spin_lock(&wil->wmi_ev_lock);
+	spin_lock_irqsave(&wil->wmi_ev_lock, flags);
 	wil->reply_id = reply_id;
 	wil->reply_buf = reply;
 	wil->reply_size = reply_size;
 	reinit_completion(&wil->wmi_call);
-	spin_unlock(&wil->wmi_ev_lock);
+	spin_unlock_irqrestore(&wil->wmi_ev_lock, flags);
 
 	rc = __wmi_send(wil, cmdid, buf, len);
 	if (rc)
@@ -1030,11 +1031,11 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
 	}
 
 out:
-	spin_lock(&wil->wmi_ev_lock);
+	spin_lock_irqsave(&wil->wmi_ev_lock, flags);
 	wil->reply_id = 0;
 	wil->reply_buf = NULL;
 	wil->reply_size = 0;
-	spin_unlock(&wil->wmi_ev_lock);
+	spin_unlock_irqrestore(&wil->wmi_ev_lock, flags);
 
 	mutex_unlock(&wil->wmi_mutex);
 
-- 
2.20.1


  parent reply	other threads:[~2019-11-16 16:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191116154729.9573-1-sashal@kernel.org>
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 010/150] brcmsmac: AP mode: update beacon when TIM changes Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 011/150] ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 026/150] qed: Align local and global PTT to propagate through the APIs Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 041/150] net: dsa: mv88e6xxx: Fix 88E6141/6341 2500mbps SERDES speed Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 042/150] net: fix warning in af_unix Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 043/150] net: ena: Fix Kconfig dependency on X86 Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 053/150] SUNRPC: Fix a compile warning for cmpxchg64() Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 054/150] sunrpc: safely reallow resvport min/max inversion Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 055/150] atm: zatm: Fix empty body Clang warnings Sasha Levin
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 061/150] libceph: don't consume a ref on pagelist in ceph_msg_data_add_pagelist() Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 064/150] mISDN: Fix type of switch control variable in ctrl_teimanager Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 065/150] qlcnic: fix a return in qlcnic_dcb_get_capability() Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 066/150] net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 075/150] bpf: devmap: fix wrong interface selection in notifier_call Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 077/150] sparc64: Rework xchg() definition to avoid warnings Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 081/150] macsec: update operstate when lower device changes Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 082/150] macsec: let the administrator set UP state even if lowerdev is down Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 105/150] igb: shorten maximum PHC timecounter update interval Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 106/150] net: hns3: bugfix for buffer not free problem during resetting Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 107/150] ntb_netdev: fix sleep time mismatch Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 113/150] net: do not abort bulk send on BQL status Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 116/150] openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS Sasha Levin
2019-11-16 15:46 ` Sasha Levin [this message]
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 121/150] wlcore: Fix the return value in case of error in 'wlcore_vendor_cmd_smart_config_start()' Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 122/150] rtl8xxxu: Fix missing break in switch Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 123/150] brcmsmac: never log "tid x is not agg'able" by default Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 124/150] wireless: airo: potential buffer overflow in sprintf() Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 125/150] rtlwifi: rtl8192de: Fix misleading REG_MCUFWDL information Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 126/150] net: dsa: bcm_sf2: Turn on PHY to allow successful registration Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 136/150] vrf: mark skb for multicast or link-local as enslaved to VRF Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 138/150] net: bcmgenet: return correct value 'ret' from bcmgenet_power_down Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 139/150] sock: Reset dst when changing sk_mark via setsockopt Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 141/150] cfg80211: Prevent regulatory restore during STA disconnect in concurrent interfaces Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 149/150] ipv6: Fix handling of LLA with VRF and sockets bound to VRF Sasha Levin
2019-11-16 15:47 ` [PATCH AUTOSEL 4.14 150/150] cfg80211: call disconnect_wk when AP stops Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191116154729.9573-120-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=liord@codeaurora.org \
    --cc=merez@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wil6210@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).