Skip to content

Commit

Permalink
mt7603: improve recovery from PSE reset failure
Browse files Browse the repository at this point in the history
Only clear reset status and switch to DMA reset after 3 tries.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Dec 5, 2018
1 parent da00af0 commit 417ab77
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mt7603/mac.c
Expand Up @@ -1197,20 +1197,27 @@ wait_for_wpdma(struct mt7603_dev *dev)

static void mt7603_pse_reset(struct mt7603_dev *dev)
{
/* Clear previous reset result */
if (!dev->reset_cause[RESET_CAUSE_RESET_FAILED])
mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_PSE_S);

/* 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);

if (!mt76_poll_msec(dev, MT_MCU_DEBUG_RESET,
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->reset_cause[RESET_CAUSE_RESET_FAILED]++;
} else {
dev->reset_cause[RESET_CAUSE_RESET_FAILED] = 0;
}

mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_QUEUES);

if (dev->reset_cause[RESET_CAUSE_RESET_FAILED] >= 3) {
dev->reset_cause[RESET_CAUSE_RESET_FAILED] = 0;
mt76_clear(dev, MT_MCU_DEBUG_RESET, MT_MCU_DEBUG_RESET_PSE);
}
}

void mt7603_mac_dma_start(struct mt7603_dev *dev)
Expand Down

0 comments on commit 417ab77

Please sign in to comment.