[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6be53466-fd53-44e9-b83a-b714737865dc@prolan.hu>
Date: Mon, 30 Sep 2024 10:20:04 +0200
From: Csókás Bence <csokas.bence@...lan.hu>
To: Wei Fang <wei.fang@....com>, Frank Li <frank.li@....com>
CC: Shenwei Wang <shenwei.wang@....com>, Clark Wang <xiaoning.wang@....com>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, "Paolo
Abeni" <pabeni@...hat.com>, Richard Cochran <richardcochran@...il.com>,
"David S. Miller" <davem@...emloft.net>, "imx@...ts.linux.dev"
<imx@...ts.linux.dev>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net 1/2] net: fec: Restart PPS after link state change
On 2024. 09. 25. 6:37, Wei Fang wrote:
>> -----Original Message-----
>> From: Csókás, Bence <csokas.bence@...lan.hu>
>> Sent: 2024年9月24日 17:37
>> To: Frank Li <Frank.Li@...escale.com>; David S. Miller
>> <davem@...emloft.net>; imx@...ts.linux.dev; netdev@...r.kernel.org;
>> linux-kernel@...r.kernel.org
>> Cc: Csókás, Bence <csokas.bence@...lan.hu>; Wei Fang <wei.fang@....com>;
>> Shenwei Wang <shenwei.wang@....com>; Clark Wang
>> <xiaoning.wang@....com>; Eric Dumazet <edumazet@...gle.com>; Jakub
>> Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; Richard
>> Cochran <richardcochran@...il.com>
>> Subject: [PATCH net 1/2] net: fec: Restart PPS after link state change
>>
> The "v2" descriptor is missing in the subject, and correct the mail address
> of Frank.
My bad, sorry. get_maintainer.pl spat out the old email address, as that
was their former committer address, and I wasn't paying attention.
>> +/* Restore PTP functionality after a reset */ void
>> +fec_ptp_restore_state(struct fec_enet_private *fep) {
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&fep->tmreg_lock, flags);
>> +
>> + /* Reset turned it off, so adjust our status flag */
>> + fep->pps_enable = 0;
>> +
>> + spin_unlock_irqrestore(&fep->tmreg_lock, flags);
>> +
>> + /* Restart PPS if needed */
>> + if (fep->ptp_saved_state.pps_enable) {
>
> It's better to put " fep->pps_enable = 0" here so that it does
> not need to be set when PPS is disabled.
It doesn't hurt to set it to 0 when it's already 0, and it saves us
having to unlock separately in the if {} and else blocks. Plus, after
reset, PPS will be turned off unconditionally, since the actual HW gets
reset.
Bence
Powered by blists - more mailing lists