RE: [PATCH RFC net-next 00/19] dpll: single-owner pins, board wiring as pin links
From: Kubalewski, Arkadiusz
Date: Fri Dec 04 2026 - 07:01:20 EST
>From: Ivan Vecera <ivecera@xxxxxxxxxx>
>Sent: Thursday, November 26, 2026 9:32 PM
>
>Sorry for the size, I know 19 patches is over the netdev limit of 15.
>For the RFC I kept each step in its own patch, so all the changes are
>easy to see one by one. The final series will squash some of them.
>
>In the thread on "dpll: do not serialize driver callbacks under global
>dpll_lock" [1], Jakub was not convinced: relations between DPLL objects
>are hard to follow, objects of one driver plug into objects of another,
>and the driver API should be much more "dummy-proof" [2]. Vadim agreed
>and asked to step back, because the subsystem was shaped to model one
>NIC family and is getting more complex for its next generation [3].
>Jiri agreed with Vadim [4]. This RFC removes the sharing of pin objects
>between drivers instead of picking a lock scheme for it.
>
>Problems in DPLL today
>Model:
>- One pin, two owners: on E825, ice registers zl3073x output pins with
> its DPLLs (c191b319f208) and hangs its recovered clock pins under
> zl3073x inputs, so one request runs callbacks of two drivers.
>- Per-registration needs on one object: a state change bypass for
> firmware node pins (521b6d5de08d), zl3073x inputs typed MUX although
> the mux is in the NIC, one pin that is both an output and an input.
>Driver API:
>- ice waits for the zl3073x pins on a notifier chain (2be467588d6b) and
> holds references to them, so probe order and lifetime are its job.
>- Core code exists only for that: the owner check exception, the
> notifier source id (0bf47f722fa9), the owner ref selection
> (2c1bd78dc8e2, 84e85c325e5e) and a cached module name.
>- Callbacks run under dpll_lock and must use __dpll_*_change_ntf(),
> notifications go out without driver locks. Only comments say so.
>Locking:
>- dpll_lock serializes every callback of every driver. With a dual NAC
> E825 and a ZL80132B, ice DPLL requests during zl3073x ToD writes took
> a median of 1448 ms, at most 3.9 s (idle 0.1 ms). zl3073x is narrowing
> its waits, but callbacks that wait for hardware stay (planned zl3073x
> resync, up to 1 s; mlx5 commands, 60 s timeout).
>- No lock scheme fits pins shared between drivers. Options A-E from the
> thread each cost something, from callbacks invisible to lockdep (A)
> to one domain for everything connected, the global lock again (D).
>Fragility: 13 fixes in a year in the (un)register, on-pin and
>notification paths, e.g. 32239d600236, df0ba51ccf87, 1a2292101c0d.
>
>All of these come from one dpll_pin being both a pad of a chip and a
>wire on the board, so two drivers end up sharing one object.
>
>Proposal
>- I1: a pin is registered only with DPLLs and parent pins of its owner,
> the module and clock_id it was created with. The core enforces it.
>- I2: so a request about an object runs only its owner's callbacks.
>- I3: a wire between pins of two devices is a link. The driver of one
> end adds it to its own pin with dpll_pin_link_add() and names the
> other end by its firmware node, so no driver holds a pin of another.
>- I4: a link is only a wire, with no state and no callbacks. pin-get
> reports DPLL_A_PIN_LINK with the peer id for both pins while both are
> registered, the peer is notified when one of them comes or goes.
>On E825 this covers the TX reference (zl3073x output to the ice TXC
>DPLL), the time reference (zl3073x output to the ice TSPLL) and the
>recovered clock crossbar: two ice mux devices, one per CGU output, with
>the port pins as inputs and outputs linked with zl3073x inputs.
>
>This removes the model and driver API problems and options A-E. The
>code of one fix is gone, the cross-owner cases behind other fixes cannot
>happen. The stall and unenforced rules stay, per-owner locks become
>possible. Not addressed: a netdev names only its recovered clock pin.
>
Hi Ivan, Looks good at least in theory :)
>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.
> 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?
>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.
> {'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?
>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?
>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.
>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.
>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?
>6. Should the locking series be rebased on top of this?
>
Those needs to be serialized?
Thanks!
Arkadiusz
>[1] https://lore.kernel.org/netdev/20261111164021.273409-1-
>ivecera@xxxxxxxxxx/
>[2] https://lore.kernel.org/netdev/20261119133851.3f25074c@xxxxxxxxxx/
>[3] https://lore.kernel.org/netdev/ff8b63b7-b943-444a-bd37-
>b6fb493b5d9f@xxxxxxxxx/
>[4] https://lore.kernel.org/netdev/awMP9Gj3Xhia0ZeI@FV6GYCPJ69/
>[5] https://gist.github.com/ivecera/b31f67adac6deac318719bbe0f282707
>
>Ivan Vecera (19):
> dpll: add pin links
> dpll: report pin links
> dpll: notify linked pins when a pin is registered or unregistered
> dpll: add KUnit tests for pin links
> ice: dpll: use own pins for the TX and time references
> ice: dpll: drop the filter of notifications from own registrations
> dpll: register pins only with a DPLL of their owner
> dpll: drop the state change exception for pins with a firmware node
> dpll: drop the source clock id from pin notifications
> dpll: drop device events from the in-kernel notifier
> dpll: drop the cached module name of a pin
> ice: dpll: track the E825 recovered clock routing in the adapter
> ice: dpll: register the E825 recovered clock muxes as DPLL devices
> ice: dpll: route the E825 recovered clock through the mux devices
> dpll: register pins only with a parent pin of their owner
> dpll: drop the in-kernel notifier chain
> dpll: require a registered DPLL for pin registration
> dpll: drop the owner reference selection of pins
> dpll: add KUnit tests for the pin owner checks
>
> Documentation/driver-api/dpll.rst | 53 +
> Documentation/netlink/specs/dpll.yaml | 15 +
> drivers/dpll/.kunitconfig | 5 +
> drivers/dpll/Kconfig | 18 +
> drivers/dpll/Makefile | 2 +
> drivers/dpll/dpll_core.c | 253 ++--
> drivers/dpll/dpll_core.h | 20 +-
> drivers/dpll/dpll_netlink.c | 82 +-
> drivers/dpll/dpll_netlink.h | 10 +-
> drivers/dpll/tests/dpll_kunit.c | 538 ++++++++
> drivers/net/ethernet/intel/ice/ice_adapter.c | 3 +-
> drivers/net/ethernet/intel/ice/ice_adapter.h | 33 +
> drivers/net/ethernet/intel/ice/ice_dpll.c | 1175 ++++++++++--------
> drivers/net/ethernet/intel/ice/ice_dpll.h | 11 +-
> drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 8 -
> include/linux/dpll.h | 32 +-
> include/uapi/linux/dpll.h | 1 +
> 17 files changed, 1583 insertions(+), 676 deletions(-)
> create mode 100644 drivers/dpll/.kunitconfig
> create mode 100644 drivers/dpll/tests/dpll_kunit.c
>
>
>base-commit: 2388bb763e323442f4dd8189238ac0c5f334c4a0
>--
>2.56.1
>