Skip to content

Commit

Permalink
mt7603: report PSE reset failures via debugfs
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Nov 21, 2018
1 parent 9428e34 commit b3f82a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions mt7603/debugfs.c
Expand Up @@ -28,6 +28,7 @@ mt7603_reset_read(struct seq_file *s, void *data)
[RESET_CAUSE_RX_PSE_BUSY] = "RX PSE busy stuck",
[RESET_CAUSE_BEACON_STUCK] = "Beacon stuck",
[RESET_CAUSE_MCU_HANG] = "MCU hang",
[RESET_CAUSE_RESET_FAILED] = "PSE reset failed",
};
int i;

Expand Down
8 changes: 4 additions & 4 deletions mt7603/mac.c
Expand Up @@ -1202,9 +1202,9 @@ static void mt7603_pse_reset(struct mt7603_dev *dev)
MT_MCU_DEBUG_RESET_PSE_S,
MT_MCU_DEBUG_RESET_PSE_S, 500)) {
mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_PSE);
dev->pse_reset_failed++;
dev->reset_cause[RESET_CAUSE_RESET_FAILED]++;
} else {
dev->pse_reset_failed = 0;
dev->reset_cause[RESET_CAUSE_RESET_FAILED] = 0;
}

mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_QUEUES);
Expand Down Expand Up @@ -1260,7 +1260,7 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
mutex_lock(&dev->mt76.mutex);

mt7603_pse_reset(dev);
if (dev->pse_reset_failed)
if (dev->reset_cause[RESET_CAUSE_RESET_FAILED])
goto skip_dma_reset;

mt7603_mac_stop(dev);
Expand Down Expand Up @@ -1456,7 +1456,7 @@ void mt7603_mac_work(struct work_struct *work)
mt7603_watchdog_check(dev, &dev->mcu_hang,
RESET_CAUSE_MCU_HANG,
NULL) ||
dev->pse_reset_failed) {
dev->reset_cause[RESET_CAUSE_RESET_FAILED]) {
dev->beacon_check = 0;
dev->tx_dma_check = 0;
dev->tx_hang_check = 0;
Expand Down
2 changes: 1 addition & 1 deletion mt7603/mt7603.h
Expand Up @@ -94,6 +94,7 @@ enum mt7603_reset_cause {
RESET_CAUSE_BEACON_STUCK,
RESET_CAUSE_RX_PSE_BUSY,
RESET_CAUSE_MCU_HANG,
RESET_CAUSE_RESET_FAILED,
__RESET_CAUSE_MAX
};

Expand Down Expand Up @@ -133,7 +134,6 @@ struct mt7603_dev {
u8 rx_dma_check;
u8 rx_pse_check;
u8 mcu_hang;
u8 pse_reset_failed;

u16 tx_dma_idx[4];
u16 rx_dma_idx;
Expand Down

0 comments on commit b3f82a3

Please sign in to comment.