public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux•dev>
To: Jiawen Wu <jiawenwu@trustnetic•com>,
	netdev@vger•kernel.org, 'Andrew Lunn' <andrew+netdev@lunn•ch>,
	"'David S. Miller'" <davem@davemloft•net>,
	'Eric Dumazet' <edumazet@google•com>,
	'Jakub Kicinski' <kuba@kernel•org>,
	'Paolo Abeni' <pabeni@redhat•com>,
	'Richard Cochran' <richardcochran@gmail•com>,
	'Simon Horman' <horms@kernel•org>,
	'Jacob Keller' <jacob.e.keller@intel•com>
Cc: 'Mengyuan Lou' <mengyuanlou@net-swift•com>, stable@vger•kernel.org
Subject: Re: [PATCH net] net: txgbe: remove wx_ptp_init() in device reset flow
Date: Thu, 6 Nov 2025 11:27:19 +0000	[thread overview]
Message-ID: <04492fd4-4808-421a-b082-a05503b1d714@linux.dev> (raw)
In-Reply-To: <09a701dc4ec1$d0cc3210$72649630$@trustnetic.com>

On 06/11/2025 02:05, Jiawen Wu wrote:
> On Thu, Nov 6, 2025 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.

> 
>>
>>> Fixes: 06e75161b9d4 ("net: wangxun: Add support for PTP clock")
>>> Cc: stable@vger•kernel.org
>>> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic•com>
>>> ---
>>>    drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 1 -
>>>    1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
>>> index daa761e48f9d..114d6f46139b 100644
>>> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
>>> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
>>> @@ -297,7 +297,6 @@ void txgbe_down(struct wx *wx)
>>>    void txgbe_up(struct wx *wx)
>>>    {
>>>    	wx_configure(wx);
>>> -	wx_ptp_init(wx);
>>>    	txgbe_up_complete(wx);
>>>    }
>>>
>   
> 


  reply	other threads:[~2025-11-06 11:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  2:07 [PATCH net] net: txgbe: remove wx_ptp_init() in device reset flow Jiawen Wu
2025-11-05 20:02 ` Vadim Fedorenko
2025-11-06  2:05   ` Jiawen Wu
2025-11-06 11:27     ` Vadim Fedorenko [this message]
2025-11-07  2:21       ` Jiawen Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04492fd4-4808-421a-b082-a05503b1d714@linux.dev \
    --to=vadim.fedorenko@linux$(echo .)dev \
    --cc=andrew+netdev@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=jacob.e.keller@intel$(echo .)com \
    --cc=jiawenwu@trustnetic$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=mengyuanlou@net-swift$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=richardcochran@gmail$(echo .)com \
    --cc=stable@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox