iavf: increase reset complete wait time
[platform/kernel/linux-starfive.git] / drivers / net / ethernet / intel / iavf / iavf_main.c
index 06c481e..fa82768 100644 (file)
@@ -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");
 }
 
-#define IAVF_RESET_WAIT_MS 10
-#define IAVF_RESET_WAIT_COUNT 500
 /**
  * iavf_reset_task - Call-back task to handle hardware reset
  * @work: pointer to work_struct
@@ -2101,20 +2099,20 @@ static void iavf_reset_task(struct work_struct *work)
        adapter->flags |= IAVF_FLAG_RESET_PENDING;
 
        /* 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) &
                          IAVF_VF_ARQLEN1_ARQENABLE_MASK;
                if (!reg_val)
                        break;
                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");
                goto continue_reset; /* act like the reset happened */
        }
 
        /* 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 */
                msleep(IAVF_RESET_WAIT_MS);
 
@@ -2126,7 +2124,7 @@ static void iavf_reset_task(struct work_struct *work)
 
        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",
                        reg_val);
                iavf_disable_vf(adapter);
@@ -3429,7 +3427,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)
        u32 rstat;
        int i;
 
-       for (i = 0; i < 100; i++) {
+       for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
                rstat = rd32(hw, IAVF_VFGEN_RSTAT) &
                             IAVF_VFGEN_RSTAT_VFR_STATE_MASK;
                if ((rstat == VIRTCHNL_VFR_VFACTIVE) ||