mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
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 <[email protected]>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user