Skip to content

Commit

Permalink
net/hns3: fix RTC time after reset
Browse files Browse the repository at this point in the history
[ upstream commit 14d9281d9c65afd743354737b8c70555161d4a69 ]

The enabled status of RTC time will be cleared after global
or IMP reset, which cause the local RTC time doesn't work.
So this patch fix it.

Fixes: 38b539d ("net/hns3: support IEEE 1588 PTP")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
  • Loading branch information
LiHuiSong1 authored and kevintraynor committed Jul 11, 2023
1 parent bf28f06 commit d2ec3c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/net/hns3/hns3_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,12 @@ hns3_init_hardware(struct hns3_adapter *hns)
goto err_mac_init;
}

ret = hns3_ptp_init(hw);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to init PTP, ret = %d", ret);
goto err_mac_init;
}

return 0;

err_mac_init:
Expand Down Expand Up @@ -4605,10 +4611,6 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
goto err_intr_callback_register;
}

ret = hns3_ptp_init(hw);
if (ret)
goto err_get_config;

/* Enable interrupt */
rte_intr_enable(pci_dev->intr_handle);
hns3_pf_enable_irq0(hw);
Expand Down

0 comments on commit d2ec3c3

Please sign in to comment.