Commit 05db221e authored by Anthony Romano's avatar Anthony Romano Committed by Kalle Valo

mt7601u: wait for clear rxq when stopping mac

mt7601u_mac_stop_hw should stop polling the rxq once it remains empty
but instead continues polling after the rxq status stays clear; bringing
down the interface takes about six seconds from this alone.

Speed up path by exiting rxq loop once status repeatedly polls empty.
Signed-off-by: default avatarAnthony Romano <anthony.romano@coreos.com>
Reviewed-by: default avatarJakub Kicinski <kubakici@wp.pl>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 53e3a80d
...@@ -293,13 +293,13 @@ static void mt7601u_mac_stop_hw(struct mt7601u_dev *dev) ...@@ -293,13 +293,13 @@ static void mt7601u_mac_stop_hw(struct mt7601u_dev *dev)
ok = 0; ok = 0;
i = 200; i = 200;
while (i--) { while (i--) {
if ((mt76_rr(dev, 0x0430) & 0x00ff0000) || if (!(mt76_rr(dev, MT_RXQ_STA) & 0x00ff0000) &&
(mt76_rr(dev, 0x0a30) & 0xffffffff) || !mt76_rr(dev, 0x0a30) &&
(mt76_rr(dev, 0x0a34) & 0xffffffff)) !mt76_rr(dev, 0x0a34)) {
ok++; if (ok++ > 5)
if (ok > 6) break;
break; continue;
}
msleep(1); msleep(1);
} }
......
...@@ -192,6 +192,9 @@ ...@@ -192,6 +192,9 @@
#define MT_BCN_OFFSET_BASE 0x041c #define MT_BCN_OFFSET_BASE 0x041c
#define MT_BCN_OFFSET(_n) (MT_BCN_OFFSET_BASE + ((_n) << 2)) #define MT_BCN_OFFSET(_n) (MT_BCN_OFFSET_BASE + ((_n) << 2))
#define MT_RXQ_STA 0x0430
#define MT_TXQ_STA 0x0434
#define MT_RF_CSR_CFG 0x0500 #define MT_RF_CSR_CFG 0x0500
#define MT_RF_CSR_CFG_DATA GENMASK(7, 0) #define MT_RF_CSR_CFG_DATA GENMASK(7, 0)
#define MT_RF_CSR_CFG_REG_ID GENMASK(13, 8) #define MT_RF_CSR_CFG_REG_ID GENMASK(13, 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment