[net-next,19/25] fm10k: start service timer on probe
diff mbox

Message ID 1428092835-16834-19-git-send-email-jeffrey.t.kirsher@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Jeff Kirsher April 3, 2015, 8:27 p.m. UTC
Since the service task handles varying work that doesn't all require the
interface to be up, launch the service timer immediately. This ensures
that we continually check the mailbox, as well as handle other tasks
while the device is down.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Matthew Vick <matthew.vick@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Jeff Kirsher April 3, 2015, 9:05 p.m. UTC | #1
On Fri, 2015-04-03 at 13:27 -0700, Jeff Kirsher wrote:
> Since the service task handles varying work that doesn't all require
> the
> interface to be up, launch the service timer immediately. This ensures
> that we continually check the mailbox, as well as handle other tasks
> while the device is down.
> 
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Acked-by: Matthew Vick <matthew.vick@intel.com>
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

I have applied to my queue.
Singh, Krishneil K April 14, 2015, 7:50 p.m. UTC | #2
-----Original Message-----
From: Kirsher, Jeffrey T 
Sent: Friday, April 3, 2015 2:06 PM
To: intel-wired-lan@lists.osuosl.org
Cc: Keller, Jacob E; Singh, Krishneil K
Subject: Re: [net-next 19/25] fm10k: start service timer on probe

On Fri, 2015-04-03 at 13:27 -0700, Jeff Kirsher wrote:
> Since the service task handles varying work that doesn't all require 
> the interface to be up, launch the service timer immediately. This 
> ensures that we continually check the mailbox, as well as handle other 
> tasks while the device is down.
> 
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Acked-by: Matthew Vick <matthew.vick@intel.com>
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

I have applied to my queue.
--
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
dev-queue

Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>

Patch
diff mbox

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 25458ca..cc527dd 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1489,7 +1489,7 @@  void fm10k_up(struct fm10k_intfc *interface)
 	/* enable transmits */
 	netif_tx_start_all_queues(interface->netdev);
 
-	/* kick off the service timer */
+	/* kick off the service timer now */
 	hw->mac.get_host_state = 1;
 	mod_timer(&interface->service_timer, jiffies);
 }
@@ -1529,8 +1529,6 @@  void fm10k_down(struct fm10k_intfc *interface)
 	/* disable polling routines */
 	fm10k_napi_disable_all(interface);
 
-	del_timer_sync(&interface->service_timer);
-
 	/* capture stats one last time before stopping interface */
 	fm10k_update_stats(interface);
 
@@ -1656,6 +1654,9 @@  static int fm10k_sw_init(struct fm10k_intfc *interface,
 		    (unsigned long)interface);
 	INIT_WORK(&interface->service_task, fm10k_service_task);
 
+	/* kick off service timer now, even when interface is down */
+	mod_timer(&interface->service_timer, (HZ * 2) + jiffies);
+
 	/* Intitialize timestamp data */
 	fm10k_ts_init(interface);
 
@@ -1872,6 +1873,8 @@  static void fm10k_remove(struct pci_dev *pdev)
 	struct fm10k_intfc *interface = pci_get_drvdata(pdev);
 	struct net_device *netdev = interface->netdev;
 
+	del_timer_sync(&interface->service_timer);
+
 	set_bit(__FM10K_SERVICE_DISABLE, &interface->state);
 	cancel_work_sync(&interface->service_task);