diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-12-05 13:36:51 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-02-14 12:06:00 +0300 |
commit | c3c25d09d4ac1fc5eb8795f8904b2f0d42bca1d3 (patch) | |
tree | c1732c3c2d9f7818425928c3629e62c59a858238 /drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c | |
parent | f0305d182c020d8c6300af461a5b606316b096e8 (diff) | |
download | linux-c3c25d09d4ac1fc5eb8795f8904b2f0d42bca1d3.tar.xz |
mt76: mt7615: defer mcu initialization via workqueue
Loading the mcu firmware and waiting for it to boot takes a long time,
which adds a significant amount to the system boot time.
Fix this by running the mcu init from a workqueue and waiting for it to
complete before starting the phy or issuing mcu commands via debugfs
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c index f75b3f66cdb4..783f145b7d02 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c @@ -7,6 +7,9 @@ mt7615_radar_pattern_set(void *data, u64 val) { struct mt7615_dev *dev = data; + if (!mt7615_wait_for_mcu_init(dev)) + return 0; + return mt7615_mcu_rdd_send_pattern(dev); } @@ -18,6 +21,9 @@ mt7615_scs_set(void *data, u64 val) { struct mt7615_dev *dev = data; + if (!mt7615_wait_for_mcu_init(dev)) + return 0; + mt7615_mac_set_scs(dev, val); return 0; @@ -41,6 +47,9 @@ mt7615_dbdc_set(void *data, u64 val) { struct mt7615_dev *dev = data; + if (!mt7615_wait_for_mcu_init(dev)) + return 0; + if (val) mt7615_register_ext_phy(dev); else @@ -131,6 +140,9 @@ static int mt7615_read_temperature(struct seq_file *s, void *data) struct mt7615_dev *dev = dev_get_drvdata(s->private); int temp; + if (!mt7615_wait_for_mcu_init(dev)) + return 0; + /* cpu */ temp = mt7615_mcu_get_temperature(dev, 0); seq_printf(s, "Temperature: %d\n", temp); |