All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt7601u: Fix system freeze after resuming from hibernation
@ 2018-02-14 11:34 cantabile
  2018-02-15  0:45 ` Jakub Kicinski
  0 siblings, 1 reply; 24+ messages in thread
From: cantabile @ 2018-02-14 11:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: kubakici

The firmware running on the device sometimes survives a reboot 
(firmware_running returns 1). When this happens the driver never calls 
request_firmware, which means the kernel's firmware handling code 
doesn't know this firmware should be cached before hibernating. Upon 
resuming from several hours of hibernation, the firmware is no longer 
running on the device, so the driver calls request_firmware. Since the 
firmware was never cached, it needs to be loaded from disk, and this is 
when the system freezes, somewhere in the xfs driver. Fix this by always 
requesting the firmware, whether it's already running on the device or not.

Signed-off-by: John Smith <cantabile.desu@gmail.com>
---
--- a/drivers/net/wireless/mediatek/mt7601u/mcu.c
+++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c
@@ -420,13 +420,15 @@
  	mt7601u_wr(dev, MT_USB_DMA_CFG, (MT_USB_DMA_CFG_RX_BULK_EN |
  					 MT_USB_DMA_CFG_TX_BULK_EN));

-	if (firmware_running(dev))
-		return 0;
-
  	ret = request_firmware(&fw, MT7601U_FIRMWARE, dev->dev);
  	if (ret)
  		return ret;

+	if (firmware_running(dev)) {
+		release_firmware(fw);
+		return 0;
+	}
+
  	if (!fw || !fw->data || fw->size < sizeof(*hdr))
  		goto err_inv_fw;

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-03-02 10:43 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 11:34 [PATCH] mt7601u: Fix system freeze after resuming from hibernation cantabile
2018-02-15  0:45 ` Jakub Kicinski
2018-02-15 11:38   ` cantabile
2018-02-15 21:47     ` Jakub Kicinski
2018-02-17 11:23       ` cantabile
2018-02-19  5:55         ` Jakub Kicinski
2018-02-19 15:01           ` cantabile
2018-02-25 17:54             ` Luis R. Rodriguez
2018-02-27  2:28               ` Jakub Kicinski
2018-02-27 12:25                 ` cantabile
2018-02-27 16:54                   ` Luis R. Rodriguez
2018-02-27 18:22                     ` Jakub Kicinski
2018-02-27 20:42                       ` Luis R. Rodriguez
2018-02-28 18:02                         ` cantabile
2018-02-28 18:48                           ` Luis R. Rodriguez
2018-02-28 19:18                             ` Arend van Spriel
2018-02-28 20:41                               ` Luis R. Rodriguez
2018-02-28 21:18                             ` cantabile
2018-03-01  0:28                               ` Luis R. Rodriguez
2018-03-01 14:05                                 ` cantabile
2018-03-01 17:29                                   ` Luis R. Rodriguez
2018-03-01 20:11                                     ` cantabile
2018-03-01 21:01                                       ` Luis R. Rodriguez
2018-03-02 10:43                                         ` cantabile

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.