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 9DD962FDC25; Tue, 12 Aug 2025 17:39:17 +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=1755020357; cv=none; b=JtaBFqKJf+BsQQhz69rMQ4lcBQi7RjOcn/7NDHiOudAQ9Zj4vnXKAT+tYhkfmoVN0TtG90/YywND92KohuMVxtT79R6ELjKXOkds36UoUk5acvQzV2foGUb/GmHmgQc8Al2heSHHrmWbEEGw74tzyQ9tEKlVT9ZFQibz9qSGUSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755020357; c=relaxed/simple; bh=wLrPYmLKn7+SG/0IJM1mfYToyuJ1/y6+HJXp3LI/AEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rSJuMHBL7YkV3UUD4tG47GQXb5tqohAzOv8C7XHJQfh9Tej9lIQu0kaFUOEMIyhstYJKtOAg3x0+7ggHH3FRWs0R+zHULqGHI4DC2oqfZWJ3tE7d6a665cVZUTpd5IPemz/e76QnIkR0nLXMIEKZNSWlw/xtZLiCtCd49E/H//c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eu5dV7iQ; 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="eu5dV7iQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26526C4CEF0; Tue, 12 Aug 2025 17:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755020357; bh=wLrPYmLKn7+SG/0IJM1mfYToyuJ1/y6+HJXp3LI/AEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eu5dV7iQ+enkt9xz02vogxYoWFM+nWOBf1dbVjxINfK1rIp6gu6uSH9eY4BORzbZe 1MzRrbTFQubDn+1Uc4aFoYN5XFsNhGby0RiP+oq2COv3nWfPEPCLOGrheMANsd+iF/ YjqchoQFi0BRQRnAK8aFnMiIfLRYNlRvN7zFHFdU= 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.1 024/253] net: hns3: disable interrupt when ptp init failed Date: Tue, 12 Aug 2025 19:26:52 +0200 Message-ID: <20250812172949.758102632@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812172948.675299901@linuxfoundation.org> References: <20250812172948.675299901@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 b7cf9fbf97183..6d7aeac600128 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c @@ -509,14 +509,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); @@ -524,7 +524,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); @@ -532,6 +532,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