[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251201103440.0ddf9c42@kmaincent-XPS-13-7390>
Date: Mon, 1 Dec 2025 10:34:40 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
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 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.
> + case HWTSTAMP_TX_ONESTEP_SYNC:
> + case HWTSTAMP_TX_ON:
> + case HWTSTAMP_TX_OFF:
> + break;
> + default:
> + return -ERANGE;
> + }
> +
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists