diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2018-05-15 14:20:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-16 11:33:08 -0400 |
commit | be8d8cdb8ebf3afd841c109dd035fd789a0c7d53 (patch) | |
tree | aeb0bcd87a019519d101ba12a49704cb6fed53b7 | |
parent | 67bf2541f4b9a091e928d75eca544bca4c5db142 (diff) |
net: hns3: Fix for fiber link up problem
When hclge_ae_start is called, hdev->hw.mac.link may be set
to one after up/down multi-times, which does not correspond to
the link state of netdev when the netdev is up.
This fixes it by setting hdev->hw.mac.link to zero when
hclge_ae_start is called.
Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index d060903f47e0..75d9b8c5793a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | |||
@@ -3756,6 +3756,7 @@ static int hclge_ae_start(struct hnae3_handle *handle) | |||
3756 | hclge_cfg_mac_mode(hdev, true); | 3756 | hclge_cfg_mac_mode(hdev, true); |
3757 | clear_bit(HCLGE_STATE_DOWN, &hdev->state); | 3757 | clear_bit(HCLGE_STATE_DOWN, &hdev->state); |
3758 | mod_timer(&hdev->service_timer, jiffies + HZ); | 3758 | mod_timer(&hdev->service_timer, jiffies + HZ); |
3759 | hdev->hw.mac.link = 0; | ||
3759 | 3760 | ||
3760 | /* reset tqp stats */ | 3761 | /* reset tqp stats */ |
3761 | hclge_reset_tqp_stats(handle); | 3762 | hclge_reset_tqp_stats(handle); |
@@ -3792,7 +3793,6 @@ static void hclge_ae_stop(struct hnae3_handle *handle) | |||
3792 | 3793 | ||
3793 | /* reset tqp stats */ | 3794 | /* reset tqp stats */ |
3794 | hclge_reset_tqp_stats(handle); | 3795 | hclge_reset_tqp_stats(handle); |
3795 | hclge_update_link_status(hdev); | ||
3796 | } | 3796 | } |
3797 | 3797 | ||
3798 | static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport, | 3798 | static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport, |