diff options
author | Ryder Lee <ryder.lee@mediatek.com> | 2020-05-11 18:06:38 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-05-12 19:52:37 +0200 |
commit | 57b9df6fa5f56b98baa73f62ed92db81db3de391 (patch) | |
tree | d140154fddf5c0fa914fb16adb01299762990024 /drivers/net/wireless/mediatek/mt76/mt7915/init.c | |
parent | mt76: mt7915: allocate proper size for tlv tags (diff) | |
download | linux-57b9df6fa5f56b98baa73f62ed92db81db3de391.tar.xz linux-57b9df6fa5f56b98baa73f62ed92db81db3de391.zip |
mt76: mt7915: fix possible deadlock in mt7915_stop
make mac_work per phy instead of per device and fix a possible deadlock
in mt7915_stop since mt7915_mac_work runs holding mt76 mutex
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7915/init.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index e2b0ea33053c..6f200ab3ac28 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -592,6 +592,7 @@ int mt7915_register_ext_phy(struct mt7915_dev *dev) if (phy) return 0; + INIT_DELAYED_WORK(&phy->mac_work, mt7915_mac_work); mt7915_cap_dbdc_enable(dev); mphy = mt76_alloc_phy(&dev->mt76, sizeof(*phy), &mt7915_ops); if (!mphy) @@ -642,7 +643,7 @@ int mt7915_register_device(struct mt7915_dev *dev) dev->phy.dev = dev; dev->phy.mt76 = &dev->mt76.phy; dev->mt76.phy.priv = &dev->phy; - INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7915_mac_work); + INIT_DELAYED_WORK(&dev->phy.mac_work, mt7915_mac_work); INIT_LIST_HEAD(&dev->sta_poll_list); spin_lock_init(&dev->sta_poll_lock); |