lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211223011358.4031459-40-davidm@egauge.net>
Date:   Thu, 23 Dec 2021 01:14:07 +0000 (UTC)
From:   David Mosberger-Tang <davidm@...uge.net>
To:     Ajay Singh <ajay.kathat@...rochip.com>
Cc:     Claudiu Beznea <claudiu.beznea@...rochip.com>,
        Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        David Mosberger-Tang <davidm@...uge.net>
Subject: [PATCH v2 39/50] wilc1000: eliminate txq_add_to_head_cs mutex

Since the tx queue handler is no longer peeking at the transmit
queues, we don't need this mutex anymore.

Signed-off-by: David Mosberger-Tang <davidm@...uge.net>
---
 drivers/net/wireless/microchip/wilc1000/cfg80211.c |  2 --
 drivers/net/wireless/microchip/wilc1000/netdev.h   |  3 ---
 drivers/net/wireless/microchip/wilc1000/wlan.c     | 13 +------------
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
index 6d3635864569f..d87358ca71cf9 100644
--- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c
+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
@@ -1670,7 +1670,6 @@ static void wlan_init_locks(struct wilc *wl)
 	mutex_init(&wl->vif_mutex);
 	mutex_init(&wl->deinit_lock);
 
-	mutex_init(&wl->txq_add_to_head_cs);
 	mutex_init(&wl->tx_q_limit_lock);
 
 	init_waitqueue_head(&wl->txq_event);
@@ -1685,7 +1684,6 @@ void wlan_deinit_locks(struct wilc *wilc)
 	mutex_destroy(&wilc->hif_cs);
 	mutex_destroy(&wilc->rxq_cs);
 	mutex_destroy(&wilc->cfg_cmd_lock);
-	mutex_destroy(&wilc->txq_add_to_head_cs);
 	mutex_destroy(&wilc->vif_mutex);
 	mutex_destroy(&wilc->deinit_lock);
 	mutex_destroy(&wilc->tx_q_limit_lock);
diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h
index e168f8644c678..086b9273bb117 100644
--- a/drivers/net/wireless/microchip/wilc1000/netdev.h
+++ b/drivers/net/wireless/microchip/wilc1000/netdev.h
@@ -225,9 +225,6 @@ struct wilc {
 	struct srcu_struct srcu;
 	u8 open_ifcs;
 
-	/* protect head of transmit queue */
-	struct mutex txq_add_to_head_cs;
-
 	/* protect rxq_entry_t receiver queue */
 	struct mutex rxq_cs;
 
diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index eefc0d18c1b5c..67f5293370d35 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -70,12 +70,9 @@ static void wilc_wlan_txq_add_to_head(struct wilc_vif *vif, u8 type, u8 q_num,
 
 	init_txq_entry(tqe, type, q_num);
 
-	mutex_lock(&wilc->txq_add_to_head_cs);
-
 	skb_queue_head(&wilc->txq[q_num], tqe);
 	atomic_inc(&wilc->txq_entries);
 
-	mutex_unlock(&wilc->txq_add_to_head_cs);
 	wake_up_interruptible(&wilc->txq_event);
 }
 
@@ -848,9 +845,6 @@ static int send_vmm_table(struct wilc *wilc,
  *
  * Copy a number of packets to the transmit buffer.
  *
- * Context: The txq_add_to_head_cs mutex must still be held when
- * calling this function.
- *
  * Return: Number of bytes copied to the transmit buffer (always
  *	non-negative).
  */
@@ -940,8 +934,6 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count)
 	if (wilc->quit)
 		goto out_update_cnt;
 
-	mutex_lock(&wilc->txq_add_to_head_cs);
-
 	srcu_idx = srcu_read_lock(&wilc->srcu);
 	list_for_each_entry_rcu(vif, &wilc->vif_list, list)
 		wilc_wlan_txq_filter_dup_tcp_ack(vif->ndev);
@@ -949,7 +941,7 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count)
 
 	vmm_table_len = fill_vmm_table(wilc, vmm_table);
 	if (vmm_table_len == 0)
-		goto out_unlock;
+		goto out_update_cnt;
 
 	acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP);
 
@@ -967,9 +959,6 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count)
 	if (ret >= 0 && entries < vmm_table_len)
 		ret = WILC_VMM_ENTRY_FULL_RETRY;
 
-out_unlock:
-	mutex_unlock(&wilc->txq_add_to_head_cs);
-
 out_update_cnt:
 	*txq_count = atomic_read(&wilc->txq_entries);
 	return ret;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ