Skip to content

Commit 5690087

Browse files
LorenzoBianconinbd168
authored andcommitted
mt76: mt7921: always wake device if necessary in debugfs
Add missing device wakeup in debugfs code if we are accessing chip registers. Fixes: 1d8efc7 ("mt76: mt7921: introduce Runtime PM support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 6e5ceaf commit 5690087

File tree

1 file changed

+8
-0
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7921

1 file changed

+8
-0
lines changed

drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ mt7921_tx_stats_show(struct seq_file *file, void *data)
9595
struct mt7921_dev *dev = file->private;
9696
int stat[8], i, n;
9797

98+
mt7921_mutex_acquire(dev);
99+
98100
mt7921_ampdu_stat_read_phy(&dev->phy, file);
99101

100102
/* Tx amsdu info */
@@ -104,6 +106,8 @@ mt7921_tx_stats_show(struct seq_file *file, void *data)
104106
n += stat[i];
105107
}
106108

109+
mt7921_mutex_release(dev);
110+
107111
for (i = 0; i < ARRAY_SIZE(stat); i++) {
108112
seq_printf(file, "AMSDU pack count of %d MSDU in TXD: 0x%x ",
109113
i + 1, stat[i]);
@@ -124,6 +128,8 @@ mt7921_queues_acq(struct seq_file *s, void *data)
124128
struct mt7921_dev *dev = dev_get_drvdata(s->private);
125129
int i;
126130

131+
mt7921_mutex_acquire(dev);
132+
127133
for (i = 0; i < 16; i++) {
128134
int j, acs = i / 4, index = i % 4;
129135
u32 ctrl, val, qlen = 0;
@@ -143,6 +149,8 @@ mt7921_queues_acq(struct seq_file *s, void *data)
143149
seq_printf(s, "AC%d%d: queued=%d\n", acs, index, qlen);
144150
}
145151

152+
mt7921_mutex_release(dev);
153+
146154
return 0;
147155
}
148156

0 commit comments

Comments
 (0)