Commit a86d5c68 authored by Dany Madden's avatar Dany Madden Committed by Jakub Kicinski

ibmvnic: no reset timeout for 5 seconds after reset

Reset timeout is going off right after adapter reset. This patch ensures
that timeout is scheduled if it has been 5 seconds since the last reset.
5 seconds is the default watchdog timeout.

Fixes: ed651a10 ("ibmvnic: Updated reset handling")
Signed-off-by: default avatarDany Madden <drt@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c98d9cc4
...@@ -2252,6 +2252,7 @@ static void __ibmvnic_reset(struct work_struct *work) ...@@ -2252,6 +2252,7 @@ static void __ibmvnic_reset(struct work_struct *work)
rc = do_reset(adapter, rwi, reset_state); rc = do_reset(adapter, rwi, reset_state);
} }
kfree(rwi); kfree(rwi);
adapter->last_reset_time = jiffies;
if (rc) if (rc)
netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc); netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc);
...@@ -2355,7 +2356,13 @@ static void ibmvnic_tx_timeout(struct net_device *dev, unsigned int txqueue) ...@@ -2355,7 +2356,13 @@ static void ibmvnic_tx_timeout(struct net_device *dev, unsigned int txqueue)
"Adapter is resetting, skip timeout reset\n"); "Adapter is resetting, skip timeout reset\n");
return; return;
} }
/* No queuing up reset until at least 5 seconds (default watchdog val)
* after last reset
*/
if (time_before(jiffies, (adapter->last_reset_time + dev->watchdog_timeo))) {
netdev_dbg(dev, "Not yet time to tx timeout.\n");
return;
}
ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT); ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT);
} }
...@@ -5282,7 +5289,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -5282,7 +5289,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
adapter->state = VNIC_PROBED; adapter->state = VNIC_PROBED;
adapter->wait_for_reset = false; adapter->wait_for_reset = false;
adapter->last_reset_time = jiffies;
return 0; return 0;
ibmvnic_register_fail: ibmvnic_register_fail:
......
...@@ -1087,6 +1087,8 @@ struct ibmvnic_adapter { ...@@ -1087,6 +1087,8 @@ struct ibmvnic_adapter {
unsigned long resetting; unsigned long resetting;
bool napi_enabled, from_passive_init; bool napi_enabled, from_passive_init;
bool login_pending; bool login_pending;
/* last device reset time */
unsigned long last_reset_time;
bool failover_pending; bool failover_pending;
bool force_reset_recovery; bool force_reset_recovery;
......
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