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 8410C20E6; Wed, 30 Jul 2025 09:46:03 +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=1753868763; cv=none; b=mzGMTkKpgRASS7L1ytIbt4FDFbRDH0Q+8lv7YnYrb7cQaEhrsT/m8TM880RKxWuqdoUTKe0A4fFYP1RxQLsZPnqJsBXn4/iRKsZPxtoaYGXgzTwgixbKwZtBMXXbnf6ex12NK6BOxrf4nC8N30CrC11gGHmBeY31y4U5J3oSE/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753868763; c=relaxed/simple; bh=ckzlDI6GaHxMClgME+xXDKu6gypCmLgkqxMdeTuztlM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AaSSKgkRUdqQHxIdGxe3C1mWyYfxIS81smvMYKk9K3mSP6/eJGncL4KYopg/O8RTZcd4thTae20ONWN0u/fxcBIBaZRdH6783ylovee01FdDj3908j1UmuzN7eV/UrhkW+m3fKg437n4BEefuRqWBFxs4Oc7jv6WJsumPIcxmnM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b3Z1n9xz; 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="b3Z1n9xz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8137C4CEF5; Wed, 30 Jul 2025 09:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753868763; bh=ckzlDI6GaHxMClgME+xXDKu6gypCmLgkqxMdeTuztlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b3Z1n9xz4zsBbSaUvvcCA1hip7Fid6FQoDVKfmibg9U9XbbJm5qhCXQ7DNZrKdhuH 9xDvKipQ5ML1RZhDIP02yXg5K721E/TKxZ+t8sR6rFdacehAGf7gajYOhDLW3dLdG9 xWieAg+9v1m6PWNzChZr0yPzZone73kcO2hN3HzI= 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.12 036/117] net: hns3: disable interrupt when ptp init failed Date: Wed, 30 Jul 2025 11:35:05 +0200 Message-ID: <20250730093234.978950604@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250730093233.592541778@linuxfoundation.org> References: <20250730093233.592541778@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.12-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 0ffda5146bae5..16ef5a584af36 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c @@ -496,14 +496,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); @@ -511,7 +511,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); @@ -519,6 +519,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