Skip to content

Commit cde3046

Browse files
liuyonglong86Paolo Abeni
authored andcommitted
net: hns3: disable interrupt when ptp init failed
When ptp init failed, we'd better disable the interrupt and clear the flag, to avoid early report interrupt at next probe. Fixes: 0bf5eb7 ("net: hns3: add support for PTP") Signed-off-by: Yonglong Liu <[email protected]> Signed-off-by: Jijie Shao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 4555f8f commit cde3046

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,29 +497,32 @@ int hclge_ptp_init(struct hclge_dev *hdev)
497497
if (ret) {
498498
dev_err(&hdev->pdev->dev,
499499
"failed to init freq, ret = %d\n", ret);
500-
goto out;
500+
goto out_clear_int;
501501
}
502502

503503
ret = hclge_ptp_set_ts_mode(hdev, &hdev->ptp->ts_cfg);
504504
if (ret) {
505505
dev_err(&hdev->pdev->dev,
506506
"failed to init ts mode, ret = %d\n", ret);
507-
goto out;
507+
goto out_clear_int;
508508
}
509509

510510
ktime_get_real_ts64(&ts);
511511
ret = hclge_ptp_settime(&hdev->ptp->info, &ts);
512512
if (ret) {
513513
dev_err(&hdev->pdev->dev,
514514
"failed to init ts time, ret = %d\n", ret);
515-
goto out;
515+
goto out_clear_int;
516516
}
517517

518518
set_bit(HCLGE_STATE_PTP_EN, &hdev->state);
519519
dev_info(&hdev->pdev->dev, "phc initializes ok!\n");
520520

521521
return 0;
522522

523+
out_clear_int:
524+
clear_bit(HCLGE_PTP_FLAG_EN, &hdev->ptp->flags);
525+
hclge_ptp_int_en(hdev, false);
523526
out:
524527
hclge_ptp_destroy_clock(hdev);
525528

0 commit comments

Comments
 (0)