From: Ivan Vecera <ivecera@redhat.com>
To: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Jiri Pirko <jiri@resnulli.us>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Donald Hunter <donald.hunter@gmail.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"Lobakin, Aleksander" <aleksander.lobakin@intel.com>,
Richard Cochran <richardcochran@gmail.com>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>, Min Li <min.li@microchip.com>,
"Nitka, Grzegorz" <grzegorz.nitka@intel.com>,
Karol Kolacinski <karol.kolacinski@intel.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>, "Oros, Petr" <poros@redhat.com>
Subject: Re: [PATCH RFC net-next 00/19] dpll: single-owner pins, board wiring as pin links
Date: Fri, 4 Dec 2026 18:24:27 +0100 [thread overview]
Message-ID: <7f61b962-b2ac-4aee-b009-559c4c47deec@redhat.com> (raw)
In-Reply-To: <MW4PR11MB6984F03386BB443ABE4CD5309B4A2@MW4PR11MB6984.namprd11.prod.outlook.com>
On 12/4/26 13:00, Kubalewski, Arkadiusz wrote:
> [...]
>
> Hi Ivan, Looks good at least in theory :)
Thanks for looking at it.
>> For a driver
>> TX reference and recovered clock, before and after (the first PF of the
>> adapter creates the muxes):
>>
>
> This is where first confusion comes, I don't get the examples, you
> Mention 'before and after', don't see this here, probably needs a fix
> on a proper submission.
Right, the labels got lost. The first block is the ice code today, the
second one is the code after the series. I'll mark them.
>> pin = fwnode_dpll_pin_find(fwnode, &tracker); /* or wait for it */
>> dpll_pin_register(txc_dpll, pin, &txclk_ops, priv);
>> dpll_pin_on_pin_register(zl_input, rclk_pin, &rclk_ops, priv);
>>
>> pin = dpll_pin_get(txc_clock_id, idx, THIS_MODULE, &prop, &tracker);
>> dpll_pin_link_add(pin, fwnode);
>> dpll_pin_register(txc_dpll, pin, &txclk_ops, priv);
>> dpll_device_register(mux, DPLL_TYPE_GENERIC, &mux_ops, adapter_mux);
>> dpll_pin_link_add(mux_out, rclk_fwnode);
>> dpll_pin_register(mux, mux_out, &out_ops, adapter_mux);
>> dpll_pin_register(mux, rclk_pin, &rclk_ops, priv);
>>
>
> Why mux is a device if we already have mux type pins?
> Without a dpll-device the pins are not visible? It is the only reason?
It is the main one. A pin is shown only while it is registered with a
DPLL, or under a parent pin that is, and its state always belongs to
such a parent: setting the state on a parent pin calls the driver once
for each DPLL of that parent. Under I1 the DPLL has to be one of ice,
and ice has none that the CGU mux feeds. I looked at registering the
mux with TXC, but TXC is per PF and selects the TX reference, so the
recovered clock would show up as a TXC input, which it is not.
>> For user space (ids from the GNR-D below)
>> The zl3073x output OUT3 (id 36) no longer lists the ice TXC DPLLs as
>> parents; it is linked with the EXT_SYNCE pins of the eight PFs, which
>> are inputs of their TXC DPLLs:
>>
>> {'id': 36, 'module-name': 'zl3073x', 'package-label': 'OUT3',
>> 'parent-device': [{'parent-id': 11, 'direction': 'output', ...}],
>> 'link': [{'id': 4}, {'id': 8}, ..., {'id': 26}]}
>
> A attribute name 'link' seems a bit confusing as id is used for both
> dplls and pins, we could make sure that link refers explicitly only
> to pins and means only that within docs.
Agreed. I'll rename it to 'linked-pin', like 'parent-pin', so the name
says what the nested id is, and the docs will say it is a pin id.
>> {'id': 4, 'module-name': 'ice', 'board-label': 'EXT_SYNCE',
>> 'parent-device': [{'parent-id': 1, 'direction': 'input', ...}],
>> 'link': [{'id': 36}]}
>
>>
>> The port pin of eno1np0 (id 2) had the zl3073x inputs as parent pins.
>> It is now an input of the muxes 2 and 3, and RCLK0 (id 0) is linked
>> with REF1P (id 29):
>>
>> {'id': 2, 'module-name': 'ice', 'type': 'synce-eth-port',
>> 'parent-device': [{'parent-id': 2, 'state': 'connected', ...},
>> {'parent-id': 3, 'state': 'disconnected', ...}]}
>> {'id': 0, 'board-label': 'RCLK0', 'link': [{'id': 29}], ...}
>>
>> pin-set {"id": 2, "parent-device": {"parent-id": 2, "state":
>> "connected"}} routes the port and disconnects the one routed before.
>> The clock-id of the port pin is the adapter index instead of the DSN.
>> The E825 pins exist without zl3073x too.
>>
>> What it removes
>> Core: everything under driver API above, cross-owner on-pin registration
>> is rejected. ice: the notifier work, the firmware node parent pins and
>> the foreign pin references. The tolerance for a DPLL without
>> registrations (33f016b23a21) stays: on E810 the recovered clock pins of
>> the PFs without the CGU stay registered with the DPLLs of the PF with
>> the CGU when that PF goes first.
>>
>> core (dpll_core, dpll_netlink, dpll.h) +224/-173
>> ice +727/-503
>> KUnit tests and build +563
>> docs, spec, uapi +69
>> exported symbols 21 -> 20 (+2 for KUnit only), ops unchanged
>>
>> ice grows, as the PFs of an ASIC share the muxes and the adapter
>> records the routing. An E825 with N ports had N+1 DPLL devices (TXC per
>> port, TSPLL) and 2N ice pins, now N+3 devices and 3N+3 ice pins. A mux
>> is not a DPLL, but the generic type is for devices outside the EEC and
>> PPS classes, and two driver-local devices replace two core mechanisms:
>> cross-owner on-pin registration and a MUX parent of another driver.
>>
>> Locking series: v3 is on hold until the direction is agreed. On top of
>> this the rule for drivers becomes "your callbacks run under your lock",
>> and options A-E are not needed.
>>
>> Status: W=1 build at every patch, full build, sparse, kernel-doc,
>> ynl-regen, htmldocs, KUnit (12 tests, UML, lockdep). Tested on a GNR-D
>> platform with a dual NAC E825 and a ZL80132B: links, routing of all
>> eight ports with notifications, the recovered clock at the zl3073x
>> inputs, PF reset, CORER, GLOBR, PF unbind and bind, zl3073x reload and
>> the TX reference; the test script and its results are in [5]. Not
>> tested: EMPR, and the recovered clock of the second NAC, whose ports had
>> no link. Prepared with the help of an AI coding assistant.
>>
>> Questions
>> 1. The E825 TX reference and recovered clock views change. Fine, or
>> should netlink translate the old view?
>
> We shall never break userspace, right?
Agreed. Both views are in releases already: the recovered clock pins
under the zl3073x inputs since v7.0 (ad1df4f2d591), the zl3073x output
pins on the TXC DPLLs since v7.2 (5db36ee62849, c191b319f208), and the
time reference on TSPLL comes with v7.4 (41dfc378867f). I'll look at
keeping the old view next to the new one, translated in netlink from
the links:
- a port pin would also be reported under the zl3073x input that its
mux output is linked with, and setting its state there would route
the mux
- a zl3073x pin linked with EXT_SYNCE or TIME_REF would also be
reported on the TXC or TSPLL DPLL, and setting its state there would
set the state of the ice pin
Both would run only ice callbacks, so the objects would stay
single-owner.
>> 2. Is a mux fine as a generic DPLL device that reports locked while it
>> routes a port, and are N+3 DPLL devices for N ports fine?
>
> Not sure if the number of dplls itself is problematic but number of the
> same type could be, in the end user needs a way to determine which is which.
>
> Mux type pin is still there, why not use it, could link the pin and
> such linked pin is available for userspace as long as the linked is?
That would give the link a meaning beyond the wire (I4) and tie the
ice objects to zl3073x again: the mux pin and the routing of all ports
would come and go with the zl3073x pin. With the device, the ice pins
exist on their own, also without zl3073x loaded, and a request about
them runs only ice callbacks.
>> 3. The two muxes share module, clock-id and type, so device-id-get
>> finds neither. Is finding them through their output pins enough?
>
> Yeah, that's some issue I was thinking ad.2, seems a bit problematic to me.
device-id-get cannot tell apart DPLLs that differ only in the index
the driver gives them. That is already so for a zl3073x with more
channels of one type, for example all channels are PPS when the
firmware has no dpll-types. User space can find a mux through its
pins: from the netdev, its port pin lists both muxes as parents, and
from the zl3073x side, the input is linked with RCLK0 or RCLK1, whose
parent is the mux. For a direct lookup, device-id-get would need
another key, such as the device index or a label. Do you see a user
that needs it, or is the lookup through the pins enough?
>> 4. The firmware still types the zl3073x inputs as MUX. Leave it?
>
> The idea is that mux is moved away from zl right? But this seems fine as
> long as it links with mux-type something.
Yes, the mux is in the NIC, so it moves to ice. The zl3073x input is
linked with RCLK0 or RCLK1, the output pin of the mux device. Those
are typed EXT, as they have no child pins. I'll leave the firmware
type as it is.
>> 5. The ice pin does not know the frequency on the wire. Omit it, as
>> now, or read it from a firmware node property?
>
> This could be also a problem for some designs, frequency may change due to
> link speed changes, as we design time-critical stuff we shall be sure that
> it would be possible in the future to read/write the frequency from driver
> over the linked pin?
Each end of a link stays a normal pin of its driver, so frequency ops
can be added to it at any time. ice sets the divider of the recovered
clock by the link speed, so if the frequency is to be reported, ice
can do it on RCLK0 and RCLK1, its own pins, and user space reads both
ends of the link. What the series rules out is one driver reading or
setting the frequency of a pin of another driver through the link.
Nothing passes the frequency between the two drivers today either:
the recovered clock pin of ice has no frequency ops, and zl3073x does
not listen to the notifier chain.
The link is a nest, so a link attribute can be added later if one is
needed - or a link attribute with path delay (in ps) between two pins
could be useful for userspace to compute proper delay compensation.
>> 6. Should the locking series be rebased on top of this?
>>
>
> Those needs to be serialized?
Yes, this series first. With single-owner pins a request runs the
callbacks of one driver only, so the locking series shrinks to the
model from the other thread: dpll_lock protects only the objects and
each driver serializes its own callbacks, as PTP drivers do. Without
this series it needs one of the options A-E.
Thanks,
Ivan
prev parent reply other threads:[~2026-12-04 17:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 20:32 [PATCH RFC net-next 00/19] dpll: single-owner pins, board wiring as pin links Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 01/19] dpll: add " Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 02/19] dpll: report " Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 03/19] dpll: notify linked pins when a pin is registered or unregistered Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 04/19] dpll: add KUnit tests for pin links Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 05/19] ice: dpll: use own pins for the TX and time references Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 06/19] ice: dpll: drop the filter of notifications from own registrations Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 07/19] dpll: register pins only with a DPLL of their owner Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 08/19] dpll: drop the state change exception for pins with a firmware node Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 09/19] dpll: drop the source clock id from pin notifications Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 10/19] dpll: drop device events from the in-kernel notifier Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 11/19] dpll: drop the cached module name of a pin Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 12/19] ice: dpll: track the E825 recovered clock routing in the adapter Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 13/19] ice: dpll: register the E825 recovered clock muxes as DPLL devices Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 14/19] ice: dpll: route the E825 recovered clock through the mux devices Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 15/19] dpll: register pins only with a parent pin of their owner Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 16/19] dpll: drop the in-kernel notifier chain Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 17/19] dpll: require a registered DPLL for pin registration Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 18/19] dpll: drop the owner reference selection of pins Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 19/19] dpll: add KUnit tests for the pin owner checks Ivan Vecera
2026-12-04 12:00 ` [PATCH RFC net-next 00/19] dpll: single-owner pins, board wiring as pin links Kubalewski, Arkadiusz
2026-12-04 17:24 ` Ivan Vecera [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f61b962-b2ac-4aee-b009-559c4c47deec@redhat.com \
--to=ivecera@redhat.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@kernel.org \
--cc=grzegorz.nitka@intel.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jiri@resnulli.us \
--cc=karol.kolacinski@intel.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=min.li@microchip.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rdunlap@infradead.org \
--cc=richardcochran@gmail.com \
--cc=saeedm@nvidia.com \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@nvidia.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox