mt7603: retry PSE reset calls

PSE reset can fail and a subsequent reset could recover it again

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2018-04-18 11:53:24 +02:00
parent e08d5dab5d
commit e2eedc9229
2 changed files with 11 additions and 4 deletions
+1
View File
@@ -153,6 +153,7 @@ struct mt7603_dev {
u8 tx_dma_check;
u8 rx_dma_check;
u8 rx_pse_check;
u8 pse_reset_failed;
u16 tx_dma_idx[4];
u16 rx_dma_idx;
+10 -4
View File
@@ -1178,9 +1178,14 @@ static void mt7603_pse_reset(struct mt7603_dev *dev)
/* Reset PSE */
mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_PSE_S);
mt76_set(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_PSE);
WARN_ON_ONCE(!mt76_poll_msec(dev, MT_MCU_DEBUG_RESET,
MT_MCU_DEBUG_RESET_PSE_S,
MT_MCU_DEBUG_RESET_PSE_S, 500));
if (!mt76_poll_msec(dev, MT_MCU_DEBUG_RESET,
MT_MCU_DEBUG_RESET_PSE_S,
MT_MCU_DEBUG_RESET_PSE_S, 500))
dev->pse_reset_failed++;
else
dev->pse_reset_failed = 0;
mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_QUEUES);
}
@@ -1393,7 +1398,8 @@ void mt7603_mac_work(struct work_struct *work)
mt7603_rx_pse_busy) ||
mt7603_watchdog_check(dev, &dev->beacon_check,
RESET_CAUSE_BEACON_STUCK,
NULL)) {
NULL) ||
dev->pse_reset_failed) {
dev->beacon_check = 0;
dev->tx_dma_check = 0;
dev->tx_hang_check = 0;