[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9919964-236c-4f2e-a7ec-9fe7969aaa55@linux.dev>
Date: Mon, 1 Dec 2025 10:28:15 +0000
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Kory Maincent <kory.maincent@...tlin.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, Russell King
<linux@...linux.org.uk>, Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>, Andrew Lunn <andrew@...n.ch>,
Simon Horman <horms@...nel.org>, Vladimir Oltean <vladimir.oltean@....com>,
Jacob Keller <jacob.e.keller@...el.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 3/4] net: phy: microchip_rds_ptp: improve HW
ts config logic
On 01/12/2025 09:34, Kory Maincent wrote:
> On Sat, 29 Nov 2025 19:53:33 +0000
> Vadim Fedorenko <vadim.fedorenko@...ux.dev> wrote:
>
>> The driver stores new HW timestamping configuration values
>> unconditionally and may create inconsistency with what is actually
>> configured in case of error. Improve the logic to store new values only
>> once everything is configured.
>>
>> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
>> ---
>> drivers/net/phy/microchip_rds_ptp.c | 21 ++++++++++++++++-----
>> 1 file changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/phy/microchip_rds_ptp.c
>> b/drivers/net/phy/microchip_rds_ptp.c index 4c6326b0ceaf..6a7a0bb95301 100644
>> --- a/drivers/net/phy/microchip_rds_ptp.c
>> +++ b/drivers/net/phy/microchip_rds_ptp.c
>> @@ -488,9 +488,6 @@ static int mchp_rds_ptp_hwtstamp_set(struct
>> mii_timestamper *mii_ts, unsigned long flags;
>> int rc;
>>
>> - clock->hwts_tx_type = config->tx_type;
>> - clock->rx_filter = config->rx_filter;
>> -
>> switch (config->rx_filter) {
>> case HWTSTAMP_FILTER_NONE:
>> clock->layer = 0;
>> @@ -518,6 +515,15 @@ static int mchp_rds_ptp_hwtstamp_set(struct
>> mii_timestamper *mii_ts, return -ERANGE;
>> }
>>
>> + switch (config->rx_filter) {
>
> You want to check tx_type here not rx_filter.
Damn it, copy-paste didn't work well :(
>
>> + case HWTSTAMP_TX_ONESTEP_SYNC:
>> + case HWTSTAMP_TX_ON:
>> + case HWTSTAMP_TX_OFF:
>> + break;
>> + default:
>> + return -ERANGE;
>> + }
>> +
>
> Regards,
Powered by blists - more mailing lists