diff options
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h index ccb43d343543..807807d62387 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf.h +++ b/drivers/net/ethernet/intel/i40evf/i40evf.h | |||
@@ -211,6 +211,7 @@ struct i40evf_adapter { | |||
211 | #define I40EVF_FLAG_NEED_LINK_UPDATE (u32)(1 << 7) | 211 | #define I40EVF_FLAG_NEED_LINK_UPDATE (u32)(1 << 7) |
212 | #define I40EVF_FLAG_PF_COMMS_FAILED (u32)(1 << 8) | 212 | #define I40EVF_FLAG_PF_COMMS_FAILED (u32)(1 << 8) |
213 | #define I40EVF_FLAG_RESET_PENDING (u32)(1 << 9) | 213 | #define I40EVF_FLAG_RESET_PENDING (u32)(1 << 9) |
214 | #define I40EVF_FLAG_RESET_NEEDED (u32)(1 << 10) | ||
214 | /* duplcates for common code */ | 215 | /* duplcates for common code */ |
215 | #define I40E_FLAG_FDIR_ATR_ENABLED 0 | 216 | #define I40E_FLAG_FDIR_ATR_ENABLED 0 |
216 | #define I40E_FLAG_DCB_ENABLED 0 | 217 | #define I40E_FLAG_DCB_ENABLED 0 |
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index d3eafa320ba9..51c84c19d2be 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c | |||
@@ -169,9 +169,7 @@ static void i40evf_tx_timeout(struct net_device *netdev) | |||
169 | adapter->tx_timeout_count++; | 169 | adapter->tx_timeout_count++; |
170 | dev_info(&adapter->pdev->dev, "TX timeout detected.\n"); | 170 | dev_info(&adapter->pdev->dev, "TX timeout detected.\n"); |
171 | if (!(adapter->flags & I40EVF_FLAG_RESET_PENDING)) { | 171 | if (!(adapter->flags & I40EVF_FLAG_RESET_PENDING)) { |
172 | dev_info(&adapter->pdev->dev, "Requesting reset from PF\n"); | 172 | adapter->flags |= I40EVF_FLAG_RESET_NEEDED; |
173 | i40evf_request_reset(adapter); | ||
174 | adapter->flags |= I40EVF_FLAG_RESET_PENDING; | ||
175 | schedule_work(&adapter->reset_task); | 173 | schedule_work(&adapter->reset_task); |
176 | } | 174 | } |
177 | } | 175 | } |
@@ -1484,6 +1482,12 @@ static void i40evf_reset_task(struct work_struct *work) | |||
1484 | while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK, | 1482 | while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK, |
1485 | &adapter->crit_section)) | 1483 | &adapter->crit_section)) |
1486 | udelay(500); | 1484 | udelay(500); |
1485 | |||
1486 | if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) { | ||
1487 | dev_info(&adapter->pdev->dev, "Requesting reset from PF\n"); | ||
1488 | i40evf_request_reset(adapter); | ||
1489 | } | ||
1490 | |||
1487 | /* poll until we see the reset actually happen */ | 1491 | /* poll until we see the reset actually happen */ |
1488 | for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) { | 1492 | for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) { |
1489 | rstat_val = rd32(hw, I40E_VFGEN_RSTAT) & | 1493 | rstat_val = rd32(hw, I40E_VFGEN_RSTAT) & |