lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251201103321.47cb4ceb@kmaincent-XPS-13-7390>
Date: Mon, 1 Dec 2025 10:33:21 +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 1/4] net: phy: micrel: improve HW
 timestamping config logic

On Sat, 29 Nov 2025 19:53:31 +0000
Vadim Fedorenko <vadim.fedorenko@...ux.dev> wrote:

> The driver was adjusting stored values independently of what was
> actually supported and configured. Improve logic to store values
> once all checks are passing
> 
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
> ---
>  drivers/net/phy/micrel.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 05de68b9f719..1ada05dd305c 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -3157,9 +3157,6 @@ static int lan8814_hwtstamp_set(struct mii_timestamper
> *mii_ts, int txcfg = 0, rxcfg = 0;
>  	int pkt_ts_enable;
>  
> -	ptp_priv->hwts_tx_type = config->tx_type;
> -	ptp_priv->rx_filter = config->rx_filter;
> -
>  	switch (config->rx_filter) {
>  	case HWTSTAMP_FILTER_NONE:
>  		ptp_priv->layer = 0;
> @@ -3187,6 +3184,18 @@ static int lan8814_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_OFF:
> +	case HWTSTAMP_TX_ON:
> +	case HWTSTAMP_TX_ONESTEP_SYNC:
> +		break;
> +	default:
> +		return -ERANGE;
> +	}
> +
> +	ptp_priv->hwts_tx_type = config->tx_type;
> +	ptp_priv->rx_filter = config->rx_filter;
> +
>  	if (ptp_priv->layer & PTP_CLASS_L2) {
>  		rxcfg = PTP_RX_PARSE_CONFIG_LAYER2_EN_;
>  		txcfg = PTP_TX_PARSE_CONFIG_LAYER2_EN_;
> @@ -5051,9 +5060,6 @@ static int lan8841_hwtstamp_set(struct mii_timestamper
> *mii_ts, int txcfg = 0, rxcfg = 0;
>  	int pkt_ts_enable;
>  
> -	ptp_priv->hwts_tx_type = config->tx_type;
> -	ptp_priv->rx_filter = config->rx_filter;
> -
>  	switch (config->rx_filter) {
>  	case HWTSTAMP_FILTER_NONE:
>  		ptp_priv->layer = 0;
> @@ -5081,6 +5087,9 @@ static int lan8841_hwtstamp_set(struct mii_timestamper
> *mii_ts, return -ERANGE;
>  	}
>  
> +	ptp_priv->hwts_tx_type = config->tx_type;
> +	ptp_priv->rx_filter = config->rx_filter;

I there a reason to not add the check in the hwtstamp ops for lan8841 as well?
because the issue is also present.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ