From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) (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 D180A1DE2D8 for ; Fri, 7 Nov 2025 02:23:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.207.19.206 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762482200; cv=none; b=NfEljUTPPAcNGvg0Jlo+5/5HZxwawU89iU6OCXCb9QXajyTST9q7uoHhOiV1iNgvcx0wM7y9kL84tNw1ZJs8Y4AgeeM+cyy1l6o1SayU9Qa+9jivRivjFVXUgsTiNjgqIRpsu9wNnoBLvnjV3QmP7lhU8NbqkwrnhdPxE4OU0g0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762482200; c=relaxed/simple; bh=v2YWqnCq3BoAzNq27ROrOCMT/qzVUerObh5rQwSo16I=; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=Xm3JQNMB+4R6DAwEvG16T5sGXxD+KxixilW2kyIeBHbP9g5FRQjSuMlAYtQC+A5EhvDFEzE2dLTVRnrXJKf7qjwRW2XQCpUiJu/LAHJTjhqg7irv/f917tKWhwwXuT+KDAqOadboaJK6DO6F/Qv2XqyvTSjUnM7NHU2UlISxZJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=trustnetic.com; spf=pass smtp.mailfrom=trustnetic.com; arc=none smtp.client-ip=54.207.19.206 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=trustnetic.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=trustnetic.com X-QQ-mid:Yeas1t1762482107t440t63233 Received: from 3DB253DBDE8942B29385B9DFB0B7E889 (jiawenwu@trustnetic.com [125.120.71.67]) X-QQ-SSF:0000000000000000000000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 3816815724803750602 To: "'Vadim Fedorenko'" , , "'Andrew Lunn'" , "'David S. Miller'" , "'Eric Dumazet'" , "'Jakub Kicinski'" , "'Paolo Abeni'" , "'Richard Cochran'" , "'Simon Horman'" , "'Jacob Keller'" , , "'Andrew Lunn'" , "'David S. Miller'" , "'Eric Dumazet'" , "'Jakub Kicinski'" , "'Paolo Abeni'" , "'Richard Cochran'" , "'Simon Horman'" , "'Jacob Keller'" Cc: "'Mengyuan Lou'" , , "'Mengyuan Lou'" , References: <17A4943B0AAA971B+20251105020752.57931-1-jiawenwu@trustnetic.com> <09a701dc4ec1$d0cc3210$72649630$@trustnetic.com> <04492fd4-4808-421a-b082-a05503b1d714@linux.dev> In-Reply-To: <04492fd4-4808-421a-b082-a05503b1d714@linux.dev> Subject: RE: [PATCH net] net: txgbe: remove wx_ptp_init() in device reset flow Date: Fri, 7 Nov 2025 10:21:46 +0800 Message-ID: <0a7601dc4f8d$44034400$cc09cc00$@trustnetic.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQExXBZeSPIacREnfT1C8jsshPjwPgIYC4qlAnOcZc8CJ2bJhbYGxueA Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz6b-0 X-QQ-XMAILINFO: N0mS+7D7RQfjlvgxBQqrELjrdCuZYndkJj0jP8FWYJLHmDAagc0j8+Ss ZWqEjyIoIi7SNknN5KQPKIj2fchxu3xlvjhFIiuVDjMLnNYZsjxGsKt2/X6M1PiEbyW3INw 27mjFzDTfIfdHlMpn9t8mqNENAly1x7Ze6vDP9m1dEbz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025 4:03 AM, Vadim Fedorenko wrote: > >> On 05/11/2025 02:07, Jiawen Wu wrote: > >>> The functions txgbe_up() and txgbe_down() are called in pairs to reset > >>> hardware configurations. PTP stop function is not called in > >>> txgbe_down(), so there is no need to call PTP init function in > >>> txgbe_up(). > >>> > >> > >> txgbe_reset() is called during txgbe_down(), and it calls > >> wx_ptp_reset(), which I believe is the reason for wx_ptp_init() call > > > > wx_ptp_reset() just reset the hardware bits, but does not destroy the PTP clock. > > wx_ptp_init() should be called after wx_ptp_stop() has been called. > > wx_ptp_init()/wx_ptp_reset() recalculate shift/mul configuration based > on link speed. link down/link up sequence may bring new link speed, > where these values have to reconfigured, right? I kinda agree > that full procedure of wx_ptp_init() might not be needed, but we have to > be sure not to reuse old ptp configuration. This indicates that the original approach was also wrong. wx_ptp_init() would return here: if (wx_ptp_create_clock(wx)). But for the changing of link speed, wx_ptp_reset_cyclecounter() is called in .mac_link_up() and .mac_link_down().