Skip to contentSkip to conversation

ath: move spin_lock_bh to spin_lock in tasklet

PATCH In review Zhiwei Jiang 2 participants 2 messages Jan 19, 2019 – Jan 22, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath: move spin_lock_bh to spin_lock in tasklet

as you are already in a tasklet, it is unnecessary to call spin_lock_bh, because softirq already disable BH.

---
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +2 -2
index 799010ed04e0..4e38276ed0d3 100644
@@ -574,12 +574,12 @@ void ath9k_tx_failed_tasklet(unsigned long data)
 {
 	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
 
-	spin_lock_bh(&priv->tx.tx_lock);
+	spin_lock(&priv->tx.tx_lock);
 	if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) {
 		spin_unlock_bh(&priv->tx.tx_lock);
 		return;
 	}
-	spin_unlock_bh(&priv->tx.tx_lock);
+	spin_unlock(&priv->tx.tx_lock);
 
 	ath9k_htc_tx_drainq(priv, &priv->tx.tx_failed);
 }
Signature · 1 line
2.19.0
#1 lore raw

Hi Zhiwei,

Thank you for the patch! Perhaps something to improve:

url:    https://github.com/0day-ci/linux/commits/Zhiwei-Jiang/ath-move-spin_lock_bh-to-spin_lock-in-tasklet/20190121-185529
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master

smatch warnings:
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:584 ath9k_tx_failed_tasklet() warn: inconsistent returns 'bottom_half:'.
Locked on: line 584
Unlocked on: line 580

# https://github.com/0day-ci/linux/commit/953929a8fc22ae7ab9adafed62c84a11c4be2270
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 953929a8fc22ae7ab9adafed62c84a11c4be2270
vim +584 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c

27876a29 Sujith Manoharan 2011-04-13  572  
27876a29 Sujith Manoharan 2011-04-13  573  void ath9k_tx_failed_tasklet(unsigned long data)
27876a29 Sujith Manoharan 2011-04-13  574  {
27876a29 Sujith Manoharan 2011-04-13  575  	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
b587fc81 Sujith Manoharan 2011-04-13  576  
953929a8 Zhiwei Jiang     2019-01-19  577  	spin_lock(&priv->tx.tx_lock);
27876a29 Sujith Manoharan 2011-04-13  578  	if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) {
27876a29 Sujith Manoharan 2011-04-13  579  		spin_unlock_bh(&priv->tx.tx_lock);
                                                                   ^^^

Missed this one.

27876a29 Sujith Manoharan 2011-04-13  580  		return;
b587fc81 Sujith Manoharan 2011-04-13  581  	}
953929a8 Zhiwei Jiang     2019-01-19  582  	spin_unlock(&priv->tx.tx_lock);
b587fc81 Sujith Manoharan 2011-04-13  583  

27876a29 Sujith Manoharan 2011-04-13 @584 ath9k_htc_tx_drainq(priv, &priv->tx.tx_failed);
b587fc81 Sujith Manoharan 2011-04-13 585 }
27876a29 Sujith Manoharan 2011-04-13 586

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation