From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68381293B4F; Wed, 30 Jul 2025 09:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753868311; cv=none; b=V+7dlsr3O2rOX96SYQqRGm2Hg9c0O0Hc7iibZR7W/IqNpur7GV5Hpc1I3JMDVo0nJ8ASE3FbZvN1wdlenVAz0w2rxWcJQHhV/U02HVI9NYSxoYEZoJQLtqXxoyAymDU/ECYYSmqMo2BKWBHg7NdsvesVtivOuwOwWn/JlYfIbHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753868311; c=relaxed/simple; bh=UnAYBY056l2HKb8SX+2NHPKpq3Fvd17jUFDjK8VJ65Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KeK1dTBe/SlF0jtZQjUBpey65F7L40VVqWbDypm+dHsFUSA/X84rnonMH5CtVGxP+Fr4aBvZOvvjV2kYNCgpxJClqHYPLKgpXbIsF5c283fpFyRiizdDm2fp5wgXeaS0JBydg0d28q/3z3W9TbJLtz0VNdQ0MgdjCNMW7wxGY/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2fKTVxnm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2fKTVxnm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7B6DC4CEF5; Wed, 30 Jul 2025 09:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753868311; bh=UnAYBY056l2HKb8SX+2NHPKpq3Fvd17jUFDjK8VJ65Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2fKTVxnm0d951omLGTureLiBZHUEmI47cL71mmJGhXiQ5PrlKlvYgGKAk4oRRUoqK Q9UlViFn/QO+N5Ukm34le1b0eUS441Wwmti38lnFmkRdegxk/L3nis46R7kPcks6f3 Tz5srUPP6GtKun2hcrRfG8ITarJNtAfInK6GdJ/w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yonglong Liu , Jijie Shao , Simon Horman , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 25/76] net: hns3: disable interrupt when ptp init failed Date: Wed, 30 Jul 2025 11:35:18 +0200 Message-ID: <20250730093227.821732853@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250730093226.854413920@linuxfoundation.org> References: <20250730093226.854413920@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yonglong Liu [ Upstream commit cde304655f25d94a996c45b0f9956e7dcc2bc4c0 ] When ptp init failed, we'd better disable the interrupt and clear the flag, to avoid early report interrupt at next probe. Fixes: 0bf5eb788512 ("net: hns3: add support for PTP") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250722125423.1270673-3-shaojijie@huawei.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c index 9a806ac727cf5..c1e88e67ebb65 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c @@ -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); -- 2.39.5