Commit 8e3e4b9d authored by Paul Greenwalt's avatar Paul Greenwalt Committed by Jeff Kirsher

iavf: increase reset complete wait time

With an increased number of VFs, it's possible to encounter the following
issue during reset.

    iavf b8d4:00:02.0: Hardware reset detected
    iavf b8d4:00:02.0: Reset never finished (0)
    iavf b8d4:00:02.0: Reset task did not complete, VF disabled

Increase the reset complete wait count to allow for 128 VFs to complete
reset.
Signed-off-by: default avatarPaul Greenwalt <paul.greenwalt@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 18c012d9
...@@ -219,6 +219,10 @@ struct iavf_cloud_filter { ...@@ -219,6 +219,10 @@ struct iavf_cloud_filter {
bool add; /* filter needs to be added */ bool add; /* filter needs to be added */
}; };
#define IAVF_RESET_WAIT_MS 10
#define IAVF_RESET_WAIT_DETECTED_COUNT 500
#define IAVF_RESET_WAIT_COMPLETE_COUNT 2000
/* board specific private data structure */ /* board specific private data structure */
struct iavf_adapter { struct iavf_adapter {
struct work_struct reset_task; struct work_struct reset_task;
......
...@@ -2046,8 +2046,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter) ...@@ -2046,8 +2046,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n"); dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n");
} }
#define IAVF_RESET_WAIT_MS 10
#define IAVF_RESET_WAIT_COUNT 500
/** /**
* iavf_reset_task - Call-back task to handle hardware reset * iavf_reset_task - Call-back task to handle hardware reset
* @work: pointer to work_struct * @work: pointer to work_struct
...@@ -2101,20 +2099,20 @@ static void iavf_reset_task(struct work_struct *work) ...@@ -2101,20 +2099,20 @@ static void iavf_reset_task(struct work_struct *work)
adapter->flags |= IAVF_FLAG_RESET_PENDING; adapter->flags |= IAVF_FLAG_RESET_PENDING;
/* poll until we see the reset actually happen */ /* poll until we see the reset actually happen */
for (i = 0; i < IAVF_RESET_WAIT_COUNT; i++) { for (i = 0; i < IAVF_RESET_WAIT_DETECTED_COUNT; i++) {
reg_val = rd32(hw, IAVF_VF_ARQLEN1) & reg_val = rd32(hw, IAVF_VF_ARQLEN1) &
IAVF_VF_ARQLEN1_ARQENABLE_MASK; IAVF_VF_ARQLEN1_ARQENABLE_MASK;
if (!reg_val) if (!reg_val)
break; break;
usleep_range(5000, 10000); usleep_range(5000, 10000);
} }
if (i == IAVF_RESET_WAIT_COUNT) { if (i == IAVF_RESET_WAIT_DETECTED_COUNT) {
dev_info(&adapter->pdev->dev, "Never saw reset\n"); dev_info(&adapter->pdev->dev, "Never saw reset\n");
goto continue_reset; /* act like the reset happened */ goto continue_reset; /* act like the reset happened */
} }
/* wait until the reset is complete and the PF is responding to us */ /* wait until the reset is complete and the PF is responding to us */
for (i = 0; i < IAVF_RESET_WAIT_COUNT; i++) { for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
/* sleep first to make sure a minimum wait time is met */ /* sleep first to make sure a minimum wait time is met */
msleep(IAVF_RESET_WAIT_MS); msleep(IAVF_RESET_WAIT_MS);
...@@ -2126,7 +2124,7 @@ static void iavf_reset_task(struct work_struct *work) ...@@ -2126,7 +2124,7 @@ static void iavf_reset_task(struct work_struct *work)
pci_set_master(adapter->pdev); pci_set_master(adapter->pdev);
if (i == IAVF_RESET_WAIT_COUNT) { if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {
dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n", dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
reg_val); reg_val);
iavf_disable_vf(adapter); iavf_disable_vf(adapter);
...@@ -3429,7 +3427,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw) ...@@ -3429,7 +3427,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)
u32 rstat; u32 rstat;
int i; int i;
for (i = 0; i < 100; i++) { for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
rstat = rd32(hw, IAVF_VFGEN_RSTAT) & rstat = rd32(hw, IAVF_VFGEN_RSTAT) &
IAVF_VFGEN_RSTAT_VFR_STATE_MASK; IAVF_VFGEN_RSTAT_VFR_STATE_MASK;
if ((rstat == VIRTCHNL_VFR_VFACTIVE) || if ((rstat == VIRTCHNL_VFR_VFACTIVE) ||
......
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