All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH 1/6] fm10k: disable service task during suspend
@ 2015-06-15 22:00 Jacob Keller
  2015-06-15 22:00 ` [Intel-wired-lan] [PATCH 2/6] [TRIVIAL] fm10k: remove comment about rtnl_lock around mbx operations Jacob Keller
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Jacob Keller @ 2015-06-15 22:00 UTC (permalink / raw)
  To: intel-wired-lan

The service task reads some registers as part of its normal routine,
even while the interface is down. Normally this is ok. However, during
suspend we have disabled the PCI device. Due to this, registers will
read in the same way as a surprise-remove event. Disable the service
task while we suspend, and re-enable it after we resume. If we don't do
this, the device could be UP when you suspend and come back from resume
as closed (since fm10k closes the device when it gets a surprise
remove).

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 0381c8d192aa..c7ffb2635f92 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1983,6 +1983,16 @@ static int fm10k_resume(struct pci_dev *pdev)
 	if (err)
 		return err;
 
+	/* assume host is not ready, to prevent race with watchdog incase we
+	 * actually don't have connection to the switch
+	 */
+	interface->host_ready = false;
+	fm10k_watchdog_host_not_ready(interface);
+
+	/* clear the service task disable bit to allow service task to start */
+	clear_bit(__FM10K_SERVICE_DISABLE, &interface->state);
+	fm10k_service_event_schedule(interface);
+
 	/* restore SR-IOV interface */
 	fm10k_iov_resume(pdev);
 
@@ -2010,6 +2020,15 @@ static int fm10k_suspend(struct pci_dev *pdev,
 
 	fm10k_iov_suspend(pdev);
 
+	/* the watchdog tasks may read registers, which will appear like a
+	 * surprise-remove event once the PCI device is disabled. This will
+	 * cause us to close the netdevice, so we don't retain the open/closed
+	 * state post-resume. Prevent this by disabling the service task while
+	 * suspended, until we actually resume.
+	 */
+	set_bit(__FM10K_SERVICE_DISABLE, &interface->state);
+	cancel_work_sync(&interface->service_task);
+
 	rtnl_lock();
 
 	if (netif_running(netdev))
-- 
2.4.2


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

end of thread, other threads:[~2015-09-02  2:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-15 22:00 [Intel-wired-lan] [PATCH 1/6] fm10k: disable service task during suspend Jacob Keller
2015-06-15 22:00 ` [Intel-wired-lan] [PATCH 2/6] [TRIVIAL] fm10k: remove comment about rtnl_lock around mbx operations Jacob Keller
2015-09-02  1:56   ` Singh, Krishneil K
2015-09-02  2:16   ` Singh, Krishneil K
2015-06-15 22:00 ` [Intel-wired-lan] [PATCH 3/6] fm10k: only prevent removal of default VID rules Jacob Keller
2015-09-02  1:57   ` Singh, Krishneil K
2015-09-02  2:17   ` Singh, Krishneil K
2015-06-15 22:00 ` [Intel-wired-lan] [PATCH 4/6] fm10k: reset Tx FIFO head and tail pointers as part of reset_work Jacob Keller
2015-06-24 20:03   ` Keller, Jacob E
2015-06-15 22:00 ` [Intel-wired-lan] [PATCH 5/6] fm10k: update fm10k_slot_warn to use pcie_get_minimum link Jacob Keller
2015-06-19  2:22   ` Alexander Duyck
2015-06-19 15:31     ` Keller, Jacob E
2015-09-02  1:58   ` Singh, Krishneil K
2015-09-02  2:18   ` Singh, Krishneil K
2015-06-15 22:00 ` [Intel-wired-lan] [PATCH 6/6] fm10k: update netdev perm_addr during reinit, instead of at up Jacob Keller
2015-09-02  1:59   ` Singh, Krishneil K
2015-09-02  2:18   ` Singh, Krishneil K
2015-09-02  1:55 ` [Intel-wired-lan] [PATCH 1/6] fm10k: disable service task during suspend Singh, Krishneil K
2015-09-02  2:16 ` Singh, Krishneil K

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.