Skip to content

Commit

Permalink
mt76: mt7921: always wake device if necessary in debugfs
Browse files Browse the repository at this point in the history
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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Oct 20, 2021
1 parent 6e5ceaf commit 5690087
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ mt7921_tx_stats_show(struct seq_file *file, void *data)
struct mt7921_dev *dev = file->private;
int stat[8], i, n;

mt7921_mutex_acquire(dev);

mt7921_ampdu_stat_read_phy(&dev->phy, file);

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

mt7921_mutex_release(dev);

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

mt7921_mutex_acquire(dev);

for (i = 0; i < 16; i++) {
int j, acs = i / 4, index = i % 4;
u32 ctrl, val, qlen = 0;
Expand All @@ -143,6 +149,8 @@ mt7921_queues_acq(struct seq_file *s, void *data)
seq_printf(s, "AC%d%d: queued=%d\n", acs, index, qlen);
}

mt7921_mutex_release(dev);

return 0;
}

Expand Down

0 comments on commit 5690087

Please sign in to comment.