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: <20250325054956.3f62eef8@kernel.org>
Date: Tue, 25 Mar 2025 05:49:56 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
 andrew+netdev@...n.ch, netdev@...r.kernel.org, Milena Olech
 <milena.olech@...el.com>, przemyslaw.kitszel@...el.com,
 karol.kolacinski@...el.com, richardcochran@...il.com, Alexander Lobakin
 <aleksander.lobakin@...el.com>, Willem de Bruijn <willemb@...gle.com>, Mina
 Almasry <almasrymina@...gle.com>, Samuel Salin <Samuel.salin@...el.com>
Subject: Re: [PATCH net-next 04/10] idpf: negotiate PTP capabilities and get
 PTP clock

On Tue, 18 Mar 2025 09:13:19 -0700 Tony Nguyen wrote:
> +/**
> + * idpf_ptp_read_src_clk_reg_direct - Read directly the main timer value
> + * @adapter: Driver specific private structure
> + * @sts: Optional parameter for holding a pair of system timestamps from
> + *	 the system clock. Will be ignored when NULL is given.
> + *
> + * Return: the device clock time on success, -errno otherwise.

I don't see no -errno in this function.
The whole kdoc looks like complete boilerplate, but I guess 
it's required of your internal coding style :(

> + */
> +static u64 idpf_ptp_read_src_clk_reg_direct(struct idpf_adapter *adapter,
> +					    struct ptp_system_timestamp *sts)
> +{
> +	struct idpf_ptp *ptp = adapter->ptp;
> +	u32 hi, lo;
> +
> +	/* Read the system timestamp pre PHC read */
> +	ptp_read_system_prets(sts);
> +
> +	idpf_ptp_enable_shtime(adapter);
> +	lo = readl(ptp->dev_clk_regs.dev_clk_ns_l);
> +
> +	/* Read the system timestamp post PHC read */
> +	ptp_read_system_postts(sts);
> +
> +	hi = readl(ptp->dev_clk_regs.dev_clk_ns_h);

So hi is latched when lo is read? Or the timer may wrap between 
the reads? Can reads happen in parallel (re-latching hi)?

> +	return ((u64)hi << 32) | lo;
> +}

> +#if IS_ENABLED(CONFIG_X86)
> +	system->cycles = ns_time_sys;
> +	system->cs_id = CSID_X86_ART;
> +#endif /* CONFIG_X86 */
> +
> +	return 0;

Please split the cross-stamping into separate patches.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ