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:
 <PAXPR04MB8510085298FE3B1839EF486A8833A@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Wed, 20 Aug 2025 01:44:00 +0000
From: Wei Fang <wei.fang@....com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
CC: "F.S. Peng" <fushi.peng@....com>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>, "robh@...nel.org"
	<robh@...nel.org>, "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
	"conor+dt@...nel.org" <conor+dt@...nel.org>, "richardcochran@...il.com"
	<richardcochran@...il.com>, Claudiu Manoil <claudiu.manoil@....com>, Vladimir
 Oltean <vladimir.oltean@....com>, Clark Wang <xiaoning.wang@....com>,
	"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
	<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
	"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
	Frank Li <frank.li@....com>, "shawnguo@...nel.org" <shawnguo@...nel.org>,
	"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>, "festevam@...il.com"
	<festevam@...il.com>
Subject: RE: [PATCH v4 net-next 04/15] ptp: netc: add NETC V4 Timer PTP driver
 support

> On 19/08/2025 13:36, Wei Fang wrote:
> > NETC V4 Timer provides current time with nanosecond resolution, precise
> > periodic pulse, pulse on timeout (alarm), and time capture on external
> > pulse support. And it supports time synchronization as required for
> > IEEE 1588 and IEEE 802.1AS-2020.
> >
> > Inside NETC, ENETC can capture the timestamp of the sent/received packet
> > through the PHC provided by the Timer and record it on the Tx/Rx BD. And
> > through the relevant PHC interfaces provided by the driver, the enetc V4
> > driver can support PTP time synchronization.
> >
> > In addition, NETC V4 Timer is similar to the QorIQ 1588 timer, but it is
> > not exactly the same. The current ptp-qoriq driver is not compatible with
> > NETC V4 Timer, most of the code cannot be reused, see below reasons.
> >
> > 1. The architecture of ptp-qoriq driver makes the register offset fixed,
> > however, the offsets of all the high registers and low registers of V4
> > are swapped, and V4 also adds some new registers. so extending ptp-qoriq
> > to make it compatible with V4 Timer is tantamount to completely rewriting
> > ptp-qoriq driver.
> >
> > 2. The usage of some functions is somewhat different from QorIQ timer,
> > such as the setting of TCLK_PERIOD and TMR_ADD, the logic of configuring
> > PPS, etc., so making the driver compatible with V4 Timer will undoubtedly
> > increase the complexity of the code and reduce readability.
> >
> > 3. QorIQ is an expired brand. It is difficult for us to verify whether
> > it works stably on the QorIQ platforms if we refactor the driver, and
> > this will make maintenance difficult, so refactoring the driver obviously
> > does not bring any benefits.
> >
> > Therefore, add this new driver for NETC V4 Timer. Note that the missing
> > features like PEROUT, PPS and EXTTS will be added in subsequent patches.
> >
> > Signed-off-by: Wei Fang <wei.fang@....com>
> >
> [...]
> 
> >   drivers/ptp/Kconfig             |  11 +
> >   drivers/ptp/Makefile            |   1 +
> >   drivers/ptp/ptp_netc.c          | 416
> ++++++++++++++++++++++++++++++++
> >   include/linux/fsl/netc_global.h |   3 +-
> >   4 files changed, 430 insertions(+), 1 deletion(-)
> >   create mode 100644 drivers/ptp/ptp_netc.c
> 
> [...]
> 
> > diff --git a/include/linux/fsl/netc_global.h b/include/linux/fsl/netc_global.h
> > index fdecca8c90f0..763b38e05d7d 100644
> > --- a/include/linux/fsl/netc_global.h
> > +++ b/include/linux/fsl/netc_global.h
> > @@ -1,10 +1,11 @@
> >   /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
> > -/* Copyright 2024 NXP
> > +/* Copyright 2024-2025 NXP
> >    */
> >   #ifndef __NETC_GLOBAL_H
> >   #define __NETC_GLOBAL_H
> >
> >   #include <linux/io.h>
> > +#include <linux/pci.h>
> 
> What is the reason to include it header file? You need PCI functions
> only in ptp_netc.c, but this header is also included in a couple of
> other files (netc_blk_ctrl.c, ntmp.c).
> 

oh, my bad, so sorry. I added netc_timer_get_phc_index() to the
header file before, and I removed it since v4, but I forget to remove
the pci.h. Thanks for catching this issue.

> >
> >   static inline u32 netc_read(void __iomem *reg)
> >   {
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ