netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ixgbe: stop PTP before suspending
@ 2014-03-20 19:14 Jakub Kicinski
  2014-03-21  1:36 ` Jeff Kirsher
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2014-03-20 19:14 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Jakub Kicinski, netdev, e1000-devel

Resume path calls .open but suspend path cannot call .stop because
fdirs should not be freed and control over hardware should not be
released until WoL is configured.  To avoid having to duplicate all
changes made in .stop on suspend path split out part of .stop that
is relevant during suspend and call it from .stop and during suspend.

This fixes ixgbe_ptp_stop() not being called on suspend and helps
to avoid similar bugs in the future.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 5029aa9..92bda78 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5530,6 +5530,17 @@ err_setup_tx:
 	return err;
 }
 
+static void ixgbe_close_suspend(struct ixgbe_adapter *adapter)
+{
+	ixgbe_ptp_stop(adapter);
+
+	ixgbe_down(adapter);
+	ixgbe_free_irq(adapter);
+
+	ixgbe_free_all_tx_resources(adapter);
+	ixgbe_free_all_rx_resources(adapter);
+}
+
 /**
  * ixgbe_close - Disables a network interface
  * @netdev: network interface device structure
@@ -5545,16 +5556,10 @@ static int ixgbe_close(struct net_device *netdev)
 {
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
-	ixgbe_ptp_stop(adapter);
-
-	ixgbe_down(adapter);
-	ixgbe_free_irq(adapter);
+	ixgbe_close_suspend(adapter);
 
 	ixgbe_fdir_filter_exit(adapter);
 
-	ixgbe_free_all_tx_resources(adapter);
-	ixgbe_free_all_rx_resources(adapter);
-
 	ixgbe_release_hw_control(adapter);
 
 	return 0;
@@ -5619,12 +5624,8 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
 	netif_device_detach(netdev);
 
 	rtnl_lock();
-	if (netif_running(netdev)) {
-		ixgbe_down(adapter);
-		ixgbe_free_irq(adapter);
-		ixgbe_free_all_tx_resources(adapter);
-		ixgbe_free_all_rx_resources(adapter);
-	}
+	if (netif_running(netdev))
+		ixgbe_close_suspend(adapter);
 	rtnl_unlock();
 
 	ixgbe_clear_interrupt_scheme(adapter);
-- 
1.8.5.3

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

* Re: [PATCH net-next] ixgbe: stop PTP before suspending
  2014-03-20 19:14 [PATCH net-next] ixgbe: stop PTP before suspending Jakub Kicinski
@ 2014-03-21  1:36 ` Jeff Kirsher
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Kirsher @ 2014-03-21  1:36 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, e1000-devel

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On Thu, 2014-03-20 at 20:14 +0100, Jakub Kicinski wrote:
> Resume path calls .open but suspend path cannot call .stop because
> fdirs should not be freed and control over hardware should not be
> released until WoL is configured.  To avoid having to duplicate all
> changes made in .stop on suspend path split out part of .stop that
> is relevant during suspend and call it from .stop and during suspend.
> 
> This fixes ixgbe_ptp_stop() not being called on suspend and helps
> to avoid similar bugs in the future.
> 
> Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 27
> ++++++++++++++-------------
>  1 file changed, 14 insertions(+), 13 deletions(-)

Thanks Jakub, I will add this to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-03-21  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-20 19:14 [PATCH net-next] ixgbe: stop PTP before suspending Jakub Kicinski
2014-03-21  1:36 ` Jeff Kirsher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).