Commit 8c55516d authored by Peter Chiu's avatar Peter Chiu Committed by Felix Fietkau

mt76: mt7615: fix possible deadlock while mt7615_register_ext_phy()

ieee80211_register_hw() is called with rtnl_lock held, and this could be
caused lockdep from a work item that's on a workqueue that is flushed
with the rtnl held.

Move mt7615_register_ext_phy() outside the init_work().
Signed-off-by: default avatarPeter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 2363b6a6
...@@ -28,8 +28,6 @@ static void mt7615_pci_init_work(struct work_struct *work) ...@@ -28,8 +28,6 @@ static void mt7615_pci_init_work(struct work_struct *work)
return; return;
mt7615_init_work(dev); mt7615_init_work(dev);
if (dev->dbdc_support)
mt7615_register_ext_phy(dev);
} }
static int mt7615_init_hardware(struct mt7615_dev *dev) static int mt7615_init_hardware(struct mt7615_dev *dev)
...@@ -160,6 +158,12 @@ int mt7615_register_device(struct mt7615_dev *dev) ...@@ -160,6 +158,12 @@ int mt7615_register_device(struct mt7615_dev *dev)
mt7615_init_txpower(dev, &dev->mphy.sband_2g.sband); mt7615_init_txpower(dev, &dev->mphy.sband_2g.sband);
mt7615_init_txpower(dev, &dev->mphy.sband_5g.sband); mt7615_init_txpower(dev, &dev->mphy.sband_5g.sband);
if (dev->dbdc_support) {
ret = mt7615_register_ext_phy(dev);
if (ret)
return ret;
}
return mt7615_init_debugfs(dev); return mt7615_init_debugfs(dev);
} }
......
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