mt7603: reset MAC on MCU errors

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2016-02-28 21:14:48 +01:00
parent 429864f233
commit a30aebc985
3 changed files with 5 additions and 2 deletions
+1
View File
@@ -34,6 +34,7 @@
#define MT7603_PRE_TBTT_TIME 5000 /* ms */
#define MT7603_WATCHDOG_TIME 1000 /* ms */
#define MT7603_WATCHDOG_TIMEOUT 10 /* number of checks */
enum {
MT7603_REV_E1 = 0x00,
+3 -2
View File
@@ -1021,10 +1021,11 @@ void mt7603_mac_work(struct work_struct *work)
mutex_lock(&dev->mutex);
if (mt7603_tx_dma_busy(dev)) {
if (mt7603_tx_dma_busy(dev) ||
dev->tx_check >= MT7603_WATCHDOG_TIMEOUT) {
time = MT7603_WATCHDOG_TIME / 10;
if (WARN_ON_ONCE(++dev->tx_check == 10)) {
if (WARN_ON_ONCE(++dev->tx_check >= MT7603_WATCHDOG_TIMEOUT)) {
mt7603_mac_reset(dev);
goto out;
}
+1
View File
@@ -112,6 +112,7 @@ mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd, int qu
skb = mt7603_mcu_get_response(dev, expires);
if (!skb) {
printk("MCU message %d (seq %d) timed out\n", cmd, seq);
dev->tx_check = MT7603_WATCHDOG_TIMEOUT;
ret = -ETIMEDOUT;
break;
}