developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 1 | From ad7d61fd7de176ea7bec5b675ddfc355070833f7 Mon Sep 17 00:00:00 2001 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Tue, 29 Aug 2023 09:22:18 +0800 |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 50/76] wifi: mt76: update debugfs knob to dump token pending |
| 5 | time |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 6 | |
| 7 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 8 | --- |
| 9 | mt76.h | 2 ++ |
| 10 | mt7915/mac.c | 6 ++++++ |
| 11 | mt7915/mtk_debugfs.c | 6 ++---- |
| 12 | 3 files changed, 10 insertions(+), 4 deletions(-) |
| 13 | |
| 14 | diff --git a/mt76.h b/mt76.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 15 | index c322135..4704c50 100644 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 16 | --- a/mt76.h |
| 17 | +++ b/mt76.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 18 | @@ -401,6 +401,8 @@ struct mt76_txwi_cache { |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 19 | struct list_head list; |
| 20 | dma_addr_t dma_addr; |
| 21 | |
| 22 | + unsigned long jiffies; |
| 23 | + |
| 24 | union { |
| 25 | struct sk_buff *skb; |
| 26 | void *ptr; |
| 27 | diff --git a/mt7915/mac.c b/mt7915/mac.c |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 28 | index 07f0e30..170a51b 100644 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 29 | --- a/mt7915/mac.c |
| 30 | +++ b/mt7915/mac.c |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 31 | @@ -803,6 +803,8 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 32 | if (id < 0) |
| 33 | return id; |
| 34 | |
| 35 | + t->jiffies = jiffies; |
| 36 | + |
| 37 | pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb); |
| 38 | mt7915_mac_write_txwi(mdev, txwi_ptr, tx_info->skb, wcid, pid, key, |
| 39 | qid, 0); |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 40 | @@ -1001,6 +1003,8 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len) |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 41 | if (!txwi) |
| 42 | continue; |
| 43 | |
| 44 | + txwi->jiffies = 0; |
| 45 | + |
| 46 | mt76_connac2_txwi_free(mdev, txwi, sta, &free_list); |
| 47 | } |
| 48 | } |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 49 | @@ -1033,6 +1037,8 @@ mt7915_mac_tx_free_v0(struct mt7915_dev *dev, void *data, int len) |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 50 | if (!txwi) |
| 51 | continue; |
| 52 | |
| 53 | + txwi->jiffies = 0; |
| 54 | + |
| 55 | mt76_connac2_txwi_free(mdev, txwi, NULL, &free_list); |
| 56 | } |
| 57 | |
| 58 | diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 59 | index 671791e..f4bc89c 100644 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 60 | --- a/mt7915/mtk_debugfs.c |
| 61 | +++ b/mt7915/mtk_debugfs.c |
| 62 | @@ -2211,10 +2211,8 @@ static int mt7915_token_read(struct seq_file *s, void *data) |
| 63 | seq_printf(s, "Cut through token:\n"); |
| 64 | spin_lock_bh(&dev->mt76.token_lock); |
| 65 | idr_for_each_entry(&dev->mt76.token, txwi, id) { |
| 66 | - seq_printf(s, "%4d ", id); |
| 67 | - count++; |
| 68 | - if (count % 8 == 0) |
| 69 | - seq_printf(s, "\n"); |
| 70 | + seq_printf(s, "%4d (token pending %u ms)\n", id, |
| 71 | + jiffies_to_msecs(jiffies - txwi->jiffies)); |
| 72 | } |
| 73 | spin_unlock_bh(&dev->mt76.token_lock); |
| 74 | seq_printf(s, "\n"); |
| 75 | -- |
| 76 | 2.18.0 |
| 77 | |