Skip to contentSkip to conversation

ath11k: dump SRNG stats during FW assert

PATCH In review Manikanta Pubbisetty 2 participants 3 messages Mar 17, 2020 – Mar 18, 2020 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: dump SRNG stats during FW assert

Dumping the SRNG stats during FW assert, this would help in debugging ring stuck issues.

---
 drivers/net/wireless/ath/ath11k/ahb.c  |  6 ++++
 drivers/net/wireless/ath/ath11k/ce.h   |  1 +
 drivers/net/wireless/ath/ath11k/core.h |  1 +
 drivers/net/wireless/ath/ath11k/hal.c  | 66 ++++++++++++++++++++++++++++++++--
 drivers/net/wireless/ath/ath11k/hal.h  |  9 +++++
 drivers/net/wireless/ath/ath11k/qmi.c  |  1 +
 6 files changed, 82 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +6 -0
index e7e3e64..eab7ed6 100644
@@ -681,6 +681,9 @@ static irqreturn_t ath11k_ahb_ce_interrupt_handler(int irq, void *arg)
 {
 	struct ath11k_ce_pipe *ce_pipe = arg;
 
+	/* last interrupt received for this CE */
+	ce_pipe->timestamp = jiffies;
+
 	ath11k_ahb_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num);
 
 	tasklet_schedule(&ce_pipe->intr_tq);
@@ -712,6 +715,9 @@ static irqreturn_t ath11k_ahb_ext_interrupt_handler(int irq, void *arg)
 {
 	struct ath11k_ext_irq_grp *irq_grp = arg;
 
+	/* last interrupt received for this group */
+	irq_grp->timestamp = jiffies;
+
 	ath11k_ahb_ext_grp_disable(irq_grp);
 
 	napi_schedule(&irq_grp->napi);
drivers/net/wireless/ath/ath11k/ce.h +1 -0
index e355dfda..688f357 100644
@@ -161,6 +161,7 @@ struct ath11k_ce_pipe {
 	struct ath11k_ce_ring *src_ring;
 	struct ath11k_ce_ring *dest_ring;
 	struct ath11k_ce_ring *status_ring;
+	u64 timestamp;
 };
 
 struct ath11k_ce {
drivers/net/wireless/ath/ath11k/core.h +1 -0
index af04e12..83f1f77 100644
@@ -110,6 +110,7 @@ struct ath11k_ext_irq_grp {
 	u32 irqs[ATH11K_EXT_IRQ_NUM_MAX];
 	u32 num_irq;
 	u32 grp_id;
+	u64 timestamp;
 	struct napi_struct napi;
 	struct net_device napi_ndev;
 	/* Queue of pending packets, not expected to be accessed concurrently
drivers/net/wireless/ath/ath11k/hal.c +64 -2

96 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/hal.h +9 -0
index 4cfd934..36df374 100644
@@ -529,6 +529,8 @@ struct hal_srng {
 	 */
 	u32 hwreg_base[HAL_SRNG_NUM_REG_GRP];
 
+	u64 timestamp;
+
 	/* Source or Destination ring */
 	enum hal_srng_dir ring_dir;
 
@@ -554,6 +556,9 @@ struct hal_srng {
 
 			/* max transfer size */
 			u16 max_buffer_length;
+
+			/* head pointer at access end */
+			u32 last_hp;
 		} dst_ring;
 
 		struct {
@@ -577,6 +582,9 @@ struct hal_srng {
 
 			/* Low threshold - in number of ring entries */
 			u32 low_threshold;
+
+			/* tail pointer at access end */
+			u32 last_tp;
 		} src_ring;
 	} u;
 };
@@ -893,5 +901,6 @@ int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type,
 			  struct hal_srng_params *params);
 int ath11k_hal_srng_init(struct ath11k_base *ath11k);
 void ath11k_hal_srng_deinit(struct ath11k_base *ath11k);
+void ath11k_hal_dump_srng_stats(struct ath11k_base *ab);
 
 #endif
drivers/net/wireless/ath/ath11k/qmi.c +1 -0
index 2377895..c00a99a 100644
@@ -2365,6 +2365,7 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
 			break;
 		case ATH11K_QMI_EVENT_FW_READY:
 			if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) {
+				ath11k_hal_dump_srng_stats(ab);
 				queue_work(ab->workqueue, &ab->restart_work);
 				break;
 			}
Signature · 6 lines
2.7.4

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 7 lines · Manikanta Pubbisetty

Dumping the SRNG stats during FW assert, this would help in debugging ring stuck issues.

Patch applied to ath-next branch of ath.git, thanks.

5118935b1bc2 ath11k: dump SRNG stats during FW assert

Signature · 3 lines
https://patchwork.kernel.org/patch/11442081/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Manikanta Pubbisetty
Quoted 7 lines · Manikanta Pubbisetty

Dumping the SRNG stats during FW assert, this would help in debugging ring stuck issues.

Patch applied to ath-next branch of ath.git, thanks.

5118935b1bc2 ath11k: dump SRNG stats during FW assert

Signature · 8 lines
https://patchwork.kernel.org/patch/11442081/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k