Commit e064466c authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Greg Kroah-Hartman

mt76: mt76x0u: do not reset radio on resume

commit 8f2d163c upstream.

On some machines mt76x0u firmware can hung during resume,
what result on messages like below:

[  475.480062] mt76x0 1-8:1.0: Error: MCU response pre-completed!
[  475.990066] mt76x0 1-8:1.0: Error: send MCU cmd failed:-110
[  475.990075] mt76x0 1-8:1.0: Error: MCU response pre-completed!
[  476.500003] mt76x0 1-8:1.0: Error: send MCU cmd failed:-110
[  476.500012] mt76x0 1-8:1.0: Error: MCU response pre-completed!
[  477.010046] mt76x0 1-8:1.0: Error: send MCU cmd failed:-110
[  477.010055] mt76x0 1-8:1.0: Error: MCU response pre-completed!
[  477.529997] mt76x0 1-8:1.0: Error: send MCU cmd failed:-110
[  477.530006] mt76x0 1-8:1.0: Error: MCU response pre-completed!
[  477.824907] mt76x0 1-8:1.0: Error: send MCU cmd failed:-71
[  477.824916] mt76x0 1-8:1.0: Error: MCU response pre-completed!
[  477.825029] usb 1-8: USB disconnect, device number 6

and possible whole system freeze.

This can be avoided, if we do not perform mt76x0_chip_onoff() reset.

Cc: stable@vger.kernel.org
Fixes: 134b2d0d ("mt76x0: init files")
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b307f99d
...@@ -369,7 +369,7 @@ static void mt76x0_stop_hardware(struct mt76x0_dev *dev) ...@@ -369,7 +369,7 @@ static void mt76x0_stop_hardware(struct mt76x0_dev *dev)
mt76x0_chip_onoff(dev, false, false); mt76x0_chip_onoff(dev, false, false);
} }
int mt76x0_init_hardware(struct mt76x0_dev *dev) int mt76x0_init_hardware(struct mt76x0_dev *dev, bool reset)
{ {
static const u16 beacon_offsets[16] = { static const u16 beacon_offsets[16] = {
/* 512 byte per beacon */ /* 512 byte per beacon */
...@@ -382,7 +382,7 @@ int mt76x0_init_hardware(struct mt76x0_dev *dev) ...@@ -382,7 +382,7 @@ int mt76x0_init_hardware(struct mt76x0_dev *dev)
dev->beacon_offsets = beacon_offsets; dev->beacon_offsets = beacon_offsets;
mt76x0_chip_onoff(dev, true, true); mt76x0_chip_onoff(dev, true, reset);
ret = mt76x0_wait_asic_ready(dev); ret = mt76x0_wait_asic_ready(dev);
if (ret) if (ret)
......
...@@ -279,7 +279,7 @@ void mt76x0_addr_wr(struct mt76x0_dev *dev, const u32 offset, const u8 *addr); ...@@ -279,7 +279,7 @@ void mt76x0_addr_wr(struct mt76x0_dev *dev, const u32 offset, const u8 *addr);
/* Init */ /* Init */
struct mt76x0_dev *mt76x0_alloc_device(struct device *dev); struct mt76x0_dev *mt76x0_alloc_device(struct device *dev);
int mt76x0_init_hardware(struct mt76x0_dev *dev); int mt76x0_init_hardware(struct mt76x0_dev *dev, bool reset);
int mt76x0_register_device(struct mt76x0_dev *dev); int mt76x0_register_device(struct mt76x0_dev *dev);
void mt76x0_cleanup(struct mt76x0_dev *dev); void mt76x0_cleanup(struct mt76x0_dev *dev);
void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset); void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset);
......
...@@ -300,7 +300,7 @@ static int mt76x0_probe(struct usb_interface *usb_intf, ...@@ -300,7 +300,7 @@ static int mt76x0_probe(struct usb_interface *usb_intf,
if (!(mt76_rr(dev, MT_EFUSE_CTRL) & MT_EFUSE_CTRL_SEL)) if (!(mt76_rr(dev, MT_EFUSE_CTRL) & MT_EFUSE_CTRL_SEL))
dev_warn(dev->mt76.dev, "Warning: eFUSE not present\n"); dev_warn(dev->mt76.dev, "Warning: eFUSE not present\n");
ret = mt76x0_init_hardware(dev); ret = mt76x0_init_hardware(dev, true);
if (ret) if (ret)
goto err; goto err;
...@@ -354,7 +354,7 @@ static int mt76x0_resume(struct usb_interface *usb_intf) ...@@ -354,7 +354,7 @@ static int mt76x0_resume(struct usb_interface *usb_intf)
struct mt76x0_dev *dev = usb_get_intfdata(usb_intf); struct mt76x0_dev *dev = usb_get_intfdata(usb_intf);
int ret; int ret;
ret = mt76x0_init_hardware(dev); ret = mt76x0_init_hardware(dev, false);
if (ret) if (ret)
return ret; return ret;
......
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