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>
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)
{
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
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;