@@ -72,6 +72,8 @@ static void hclge_restore_hw_table(struct hclge_dev *hdev);
72
72
static void hclge_sync_promisc_mode (struct hclge_dev * hdev );
73
73
static void hclge_sync_fd_table (struct hclge_dev * hdev );
74
74
static void hclge_update_fec_stats (struct hclge_dev * hdev );
75
+ static int hclge_mac_link_status_wait (struct hclge_dev * hdev , int link_ret ,
76
+ int wait_cnt );
75
77
76
78
static struct hnae3_ae_algo ae_algo ;
77
79
@@ -7656,10 +7658,9 @@ static void hclge_phy_link_status_wait(struct hclge_dev *hdev,
7656
7658
} while (++ i < HCLGE_PHY_LINK_STATUS_NUM );
7657
7659
}
7658
7660
7659
- static int hclge_mac_link_status_wait (struct hclge_dev * hdev , int link_ret )
7661
+ static int hclge_mac_link_status_wait (struct hclge_dev * hdev , int link_ret ,
7662
+ int wait_cnt )
7660
7663
{
7661
- #define HCLGE_MAC_LINK_STATUS_NUM 100
7662
-
7663
7664
int link_status ;
7664
7665
int i = 0 ;
7665
7666
int ret ;
@@ -7672,21 +7673,24 @@ static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret)
7672
7673
return 0 ;
7673
7674
7674
7675
msleep (HCLGE_LINK_STATUS_MS );
7675
- } while (++ i < HCLGE_MAC_LINK_STATUS_NUM );
7676
+ } while (++ i < wait_cnt );
7676
7677
return - EBUSY ;
7677
7678
}
7678
7679
7679
7680
static int hclge_mac_phy_link_status_wait (struct hclge_dev * hdev , bool en ,
7680
7681
bool is_phy )
7681
7682
{
7683
+ #define HCLGE_MAC_LINK_STATUS_NUM 100
7684
+
7682
7685
int link_ret ;
7683
7686
7684
7687
link_ret = en ? HCLGE_LINK_STATUS_UP : HCLGE_LINK_STATUS_DOWN ;
7685
7688
7686
7689
if (is_phy )
7687
7690
hclge_phy_link_status_wait (hdev , link_ret );
7688
7691
7689
- return hclge_mac_link_status_wait (hdev , link_ret );
7692
+ return hclge_mac_link_status_wait (hdev , link_ret ,
7693
+ HCLGE_MAC_LINK_STATUS_NUM );
7690
7694
}
7691
7695
7692
7696
static int hclge_set_app_loopback (struct hclge_dev * hdev , bool en )
0 commit comments