From b38fe7d531c65c6d8ad94fd566997e7562542631 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 21 Nov 2018 15:04:46 +0100 Subject: [PATCH] mt7603: only issue PSE reset on PSE stuck The reset can take quite a bit of time, so only issue it when necessary Signed-off-by: Felix Fietkau --- mt7603/mac.c | 6 +++++- mt7603/mt7603.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mt7603/mac.c b/mt7603/mac.c index 5526e1977..62dec4c02 100644 --- a/mt7603/mac.c +++ b/mt7603/mac.c @@ -1293,7 +1293,10 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev) mt7603_beacon_set_timer(dev, -1, 0); - mt7603_pse_reset(dev); + if (dev->reset_cause[RESET_CAUSE_RESET_FAILED] || + dev->cur_reset_cause == RESET_CAUSE_RX_PSE_BUSY) + mt7603_pse_reset(dev); + if (dev->reset_cause[RESET_CAUSE_RESET_FAILED]) goto skip_dma_reset; @@ -1442,6 +1445,7 @@ mt7603_watchdog_check(struct mt7603_dev *dev, u8 *counter, if (*counter < MT7603_WATCHDOG_TIMEOUT) return false; trigger: + dev->cur_reset_cause = cause; dev->reset_cause[cause]++; return true; } diff --git a/mt7603/mt7603.h b/mt7603/mt7603.h index 5e15f4445..27ac2f4a5 100644 --- a/mt7603/mt7603.h +++ b/mt7603/mt7603.h @@ -135,6 +135,8 @@ struct mt7603_dev { u8 rx_pse_check; u8 mcu_hang; + enum mt7603_reset_cause cur_reset_cause; + u16 tx_dma_idx[4]; u16 rx_dma_idx;