Commit cde30465 authored by Yonglong Liu's avatar Yonglong Liu Committed by Paolo Abeni
Browse files

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: 0bf5eb78 ("net: hns3: add support for PTP")
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250722125423.1270673-3-shaojijie@huawei.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4555f8f8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -497,14 +497,14 @@ int hclge_ptp_init(struct hclge_dev *hdev)
	if (ret) {
		dev_err(&hdev->pdev->dev,
			"failed to init freq, ret = %d\n", ret);
		goto out;
		goto out_clear_int;
	}

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

	ktime_get_real_ts64(&ts);
@@ -512,7 +512,7 @@ int hclge_ptp_init(struct hclge_dev *hdev)
	if (ret) {
		dev_err(&hdev->pdev->dev,
			"failed to init ts time, ret = %d\n", ret);
		goto out;
		goto out_clear_int;
	}

	set_bit(HCLGE_STATE_PTP_EN, &hdev->state);
@@ -520,6 +520,9 @@ int hclge_ptp_init(struct hclge_dev *hdev)

	return 0;

out_clear_int:
	clear_bit(HCLGE_PTP_FLAG_EN, &hdev->ptp->flags);
	hclge_ptp_int_en(hdev, false);
out:
	hclge_ptp_destroy_clock(hdev);