All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ath11k: remove superflous memset
@ 2019-11-18 12:12 John Crispin
  2019-11-18 12:12 ` [PATCH 2/3] ath11k: remove superflous locking John Crispin
  2019-11-18 12:12 ` [PATCH 3/3] ath11k: drop memset when setting up a tx cmd desc John Crispin
  0 siblings, 2 replies; 3+ messages in thread
From: John Crispin @ 2019-11-18 12:12 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, John Crispin

We set all values inside the struct making the memset pointless.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 670e253476a3..2d6255888cfb 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -463,7 +463,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
 
 	spin_lock_bh(&tx_ring->tx_status_lock);
 	while (kfifo_get(&tx_ring->tx_status_fifo, &tx_status)) {
-		memset(&ts, 0, sizeof(ts));
 		ath11k_hal_tx_status_parse(ab, &tx_status, &ts);
 
 		mac_id = FIELD_GET(DP_TX_DESC_ID_MAC_ID, ts.desc_id);
-- 
2.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] ath11k: remove superflous locking
  2019-11-18 12:12 [PATCH 1/3] ath11k: remove superflous memset John Crispin
@ 2019-11-18 12:12 ` John Crispin
  2019-11-18 12:12 ` [PATCH 3/3] ath11k: drop memset when setting up a tx cmd desc John Crispin
  1 sibling, 0 replies; 3+ messages in thread
From: John Crispin @ 2019-11-18 12:12 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, John Crispin

The access to the fifo happens inside a napi context, which is an atomic
operation. Locking is therefore not required.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/dp.c    | 4 ----
 drivers/net/wireless/ath/ath11k/dp.h    | 4 ----
 drivers/net/wireless/ath/ath11k/dp_tx.c | 8 --------
 3 files changed, 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index 72c21cf6a352..d62115e9b41b 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -822,10 +822,7 @@ void ath11k_dp_free(struct ath11k_base *ab)
 			     ath11k_dp_tx_pending_cleanup, ab);
 		idr_destroy(&dp->tx_ring[i].txbuf_idr);
 		spin_unlock_bh(&dp->tx_ring[i].tx_idr_lock);
-
-		spin_lock_bh(&dp->tx_ring[i].tx_status_lock);
 		kfifo_free(&dp->tx_ring[i].tx_status_fifo);
-		spin_unlock_bh(&dp->tx_ring[i].tx_status_lock);
 	}
 
 	/* Deinit any SOC level resource */
@@ -872,7 +869,6 @@ int ath11k_dp_alloc(struct ath11k_base *ab)
 		spin_lock_init(&dp->tx_ring[i].tx_idr_lock);
 		dp->tx_ring[i].tcl_data_ring_id = i;
 
-		spin_lock_init(&dp->tx_ring[i].tx_status_lock);
 		ret = kfifo_alloc(&dp->tx_ring[i].tx_status_fifo, size,
 				  GFP_KERNEL);
 		if (ret)
diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h
index db216f055c42..5f98c5a49791 100644
--- a/drivers/net/wireless/ath/ath11k/dp.h
+++ b/drivers/net/wireless/ath/ath11k/dp.h
@@ -66,10 +66,6 @@ struct dp_tx_ring {
 	/* Protects txbuf_idr and num_pending */
 	spinlock_t tx_idr_lock;
 	DECLARE_KFIFO_PTR(tx_status_fifo, struct hal_wbm_release_ring);
-	/* lock to protect tx_status_fifo because tx_status_fifo can be
-	 * accessed concurrently.
-	 */
-	spinlock_t tx_status_lock;
 };
 
 struct ath11k_pdev_mon_stats {
diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 2d6255888cfb..8005ad60fda1 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -445,7 +445,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
 
 	ath11k_hal_srng_access_begin(ab, status_ring);
 
-	spin_lock_bh(&tx_ring->tx_status_lock);
 	while (!kfifo_is_full(&tx_ring->tx_status_fifo) &&
 	       (desc = ath11k_hal_srng_dst_get_next_entry(ab, status_ring)))
 		kfifo_in(&tx_ring->tx_status_fifo, (void *)desc, sizeof(struct hal_wbm_release_ring));
@@ -456,12 +455,9 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
 		ath11k_warn(ab, "Unable to process some of the tx_status ring desc because status_fifo is full\n");
 	}
 
-	spin_unlock_bh(&tx_ring->tx_status_lock);
-
 	ath11k_hal_srng_access_end(ab, status_ring);
 	spin_unlock_bh(&status_ring->lock);
 
-	spin_lock_bh(&tx_ring->tx_status_lock);
 	while (kfifo_get(&tx_ring->tx_status_fifo, &tx_status)) {
 		ath11k_hal_tx_status_parse(ab, &tx_status, &ts);
 
@@ -492,12 +488,8 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
 		if (atomic_dec_and_test(&ar->dp.num_tx_pending))
 			wake_up(&ar->dp.tx_empty_waitq);
 
-		/* TODO: Locking optimization so that tx_completion for an msdu
-		 * is not called with tx_status_lock acquired
-		 */
 		ath11k_dp_tx_complete_msdu(ar, msdu, &ts);
 	}
-	spin_unlock_bh(&tx_ring->tx_status_lock);
 }
 
 int ath11k_dp_tx_send_reo_cmd(struct ath11k_base *ab, struct dp_rx_tid *rx_tid,
-- 
2.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] ath11k: drop memset when setting up a tx cmd desc
  2019-11-18 12:12 [PATCH 1/3] ath11k: remove superflous memset John Crispin
  2019-11-18 12:12 ` [PATCH 2/3] ath11k: remove superflous locking John Crispin
@ 2019-11-18 12:12 ` John Crispin
  1 sibling, 0 replies; 3+ messages in thread
From: John Crispin @ 2019-11-18 12:12 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, John Crispin

There is no point in zero'ing out the structure if we set all values in the
following line.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c  | 2 --
 drivers/net/wireless/ath/ath11k/hal_tx.c | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 8005ad60fda1..18ede21f3cbc 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -167,8 +167,6 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
 	skb_cb->vif = arvif->vif;
 	skb_cb->ar = ar;
 
-	memset(cached_desc, 0, HAL_TCL_DESC_LEN);
-
 	ath11k_hal_tx_cmd_desc_setup(ab, cached_desc, &ti);
 
 	hal_ring_id = tx_ring->tcl_data_ring.ring_id;
diff --git a/drivers/net/wireless/ath/ath11k/hal_tx.c b/drivers/net/wireless/ath/ath11k/hal_tx.c
index b1aa716610b9..3813edaadd40 100644
--- a/drivers/net/wireless/ath/ath11k/hal_tx.c
+++ b/drivers/net/wireless/ath/ath11k/hal_tx.c
@@ -71,6 +71,7 @@ void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,
 				    ti->dscp_tid_tbl_idx) |
 			 FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX,
 				    ti->bss_ast_hash);
+	tcl_cmd->info4 = 0;
 }
 
 /* Commit the descriptor to hardware */
-- 
2.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-18 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 12:12 [PATCH 1/3] ath11k: remove superflous memset John Crispin
2019-11-18 12:12 ` [PATCH 2/3] ath11k: remove superflous locking John Crispin
2019-11-18 12:12 ` [PATCH 3/3] ath11k: drop memset when setting up a tx cmd desc John Crispin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.