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: <20251119155949.5a69551f@kmaincent-XPS-13-7390>
Date: Wed, 19 Nov 2025 15:59:49 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, Florian Fainelli
 <florian.fainelli@...adcom.com>, 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>, Andrei Botila
 <andrei.botila@....nxp.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>,
 bcm-kernel-feedback-list@...adcom.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v3 9/9] ptp: ptp_ines: add HW timestamp
 configuration reporting

On Wed, 19 Nov 2025 12:47:25 +0000
Vadim Fedorenko <vadim.fedorenko@...ux.dev> wrote:

> The driver partially stores HW timestamping configuration, but missing
> pieces can be read from HW. Add callback to report configuration.
> 
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
> ---
>  drivers/ptp/ptp_ines.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
> index 56c798e77f20..790eb42b78db 100644
> --- a/drivers/ptp/ptp_ines.c
> +++ b/drivers/ptp/ptp_ines.c
> @@ -328,6 +328,28 @@ static u64 ines_find_txts(struct ines_port *port, struct
> sk_buff *skb) return ns;
>  }
>  
> +static int ines_hwtstamp_get(struct mii_timestamper *mii_ts,
> +			     struct kernel_hwtstamp_config *cfg)
> +{
> +	struct ines_port *port = container_of(mii_ts, struct ines_port,
> mii_ts);
> +	unsigned long flags;
> +	u32 port_conf;
> +
> +	cfg->rx_filter = port->rxts_enabled ? HWTSTAMP_FILTER_PTP_V2_EVENT
> +					    : HWTSTAMP_FILTER_NONE;
> +	if (port->txts_enabled) {
> +		spin_lock_irqsave(&port->lock, flags);
> +		port_conf = ines_read32(port, port_conf);
> +		spin_unlock_irqrestore(&port->lock, flags);
> +		cfg->tx_type = (port_conf & CM_ONE_STEP) ?
> HWTSTAMP_TX_ONESTEP_P2P
> +							 : HWTSTAMP_TX_OFF;

You could also update txts_enabled to int and save the tx type as you did in
other patches. I don't know what the best approach is, but in either way, this
is ok to me.

Reviewed-by: Kory Maincent <kory.maincent@...tlin.com>

Thank you!
-- 
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