summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2021-06-18 13:30:47 +0300
committerFelix Fietkau <nbd@nbd.name>2021-06-19 10:22:52 +0300
commit61a1f99dd1e3c145fce9d601b52e7adb8f37322a (patch)
tree974a1bbac95194310c836946473456cf51157029 /drivers/net/wireless/mediatek
parenta27238a0488e14b2e558053b8b8a9a501e9385c6 (diff)
downloadlinux-61a1f99dd1e3c145fce9d601b52e7adb8f37322a.tar.xz
mt76: mt7921: allow chip reset during device restart
Disable chip full reset just during device probing but allow it during hw restart. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/init.c8
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/mac.c8
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h3
3 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 9925c15ac9df..a9ce10b98827 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -236,7 +236,13 @@ int mt7921_register_device(struct mt7921_dev *dev)
if (ret)
return ret;
- return mt76_connac_mcu_set_deep_sleep(&dev->mt76, dev->pm.ds_enable);
+ ret = mt76_connac_mcu_set_deep_sleep(&dev->mt76, dev->pm.ds_enable);
+ if (ret)
+ return ret;
+
+ dev->hw_init_done = true;
+
+ return 0;
}
void mt7921_unregister_device(struct mt7921_dev *dev)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index 143dae97ef77..7fe2e3a50428 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -1390,11 +1390,13 @@ void mt7921_reset(struct mt76_dev *mdev)
{
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
- if (!test_bit(MT76_STATE_RUNNING, &dev->mphy.state))
+ if (!dev->hw_init_done)
return;
- if (!dev->hw_full_reset)
- queue_work(dev->mt76.wq, &dev->reset_work);
+ if (dev->hw_full_reset)
+ return;
+
+ queue_work(dev->mt76.wq, &dev->reset_work);
}
static void
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
index 92cf38444b46..2d8bd6bfc820 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
@@ -160,7 +160,8 @@ struct mt7921_dev {
u16 chainmask;
struct work_struct reset_work;
- bool hw_full_reset;
+ bool hw_full_reset:1;
+ bool hw_init_done:1;
struct list_head sta_poll_list;
spinlock_t sta_poll_lock;