From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796405088; b=AQ1h/nb+/5TZUDtBEYiy60atFRS+QbEXCrZWrNNneTEKtRK35W/N9az0Xo1Z0374rGZD RyrnbgGPtq7j5yhESIUeYBIjsWCYn45Wa/ixBe3X4I+SYsvP8QWl1bUzhXn67fvfe+sJQ S2StZgKk+6rxfcsImAGKl5TikfAHgrd7r0CXbtsSUYc7tu2GR2DkDLvBh2tiuLMgJmf1L BvcRJBZ9IBu3JvE2tRhjS79cMOXLAhIFeltc7hd6MX5hnh8CJgDK4qPRzWG0RTNMUuDgj hh7tSLHfI79cnMvRTUpr2MCwiKjPvde7+lx2dZ03yjlkl3caGI858IJ5b84njfg7kIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796405088; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-Scanned-By; bh=MreJQmfiCmmLNj1A4/Pu4HJbS8QTFaAqBSuX/bPZ7LQ=; b=u2aMrQLfHIO0aixPVnEPpwdog0O+kxxeOB5PacRMtbXnwfYH4fKJx52r7CH2eBdelTSj kZcEuQaTpGKy+oGfod6SfSWDmUlnH5Kb+4lycQnopV2J7eFCMIIUKErp5fMwv1+L8FndV PRvpaPy7/R2TLC8VJZq6dZa+OqV7iF3UMx/Z8eCI9r+qmyb+0JWhfaiYPkn/q497aB82x ntoo/OAnfu9mMpXtb8jcQN+zdctm0u108w1V7KyZ8DI64lLUDpL3C1rXo2i5DNmwMSeiH /GHSU4rQoUfiR41fLChtAN9zQlw+zf5xLuBqXKBVAAwxAR/LqLmRh8EOQWJHF/tFQAQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ee8udiSD; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADEB8606A33A for ; Fri, 4 Dec 2026 17:24:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ADEB8606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ee8udiSD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796405087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MreJQmfiCmmLNj1A4/Pu4HJbS8QTFaAqBSuX/bPZ7LQ=; b=ee8udiSDBNBiGIcS9vM6YEBauNDk5GIMad6nWf9lKrQHybWaJcMbnQRoiPWhng8+p3sV4h 0NRUUdWbVn9agBnngEBea8dP1DAmDf3EwtKzNWI8dmEB/e/EsdYhu0DLIRgKpU9rOE+p6F /qxsYY9m8GYv8zbXByNrrrtWfpGJewY= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS with 8BITMIME (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-57-3YVOdKMBM-2Ph7fca9j-ug-1; Fri, 4 Dec 2026 17:24:39 +0000 X-MC-Unique: 3YVOdKMBM-2Ph7fca9j-ug-1 X-Mimecast-MFC-AGG-ID: 3YVOdKMBM-2Ph7fca9j-ug_1796405076 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AA7F5187A679; Fri, 4 Dec 2026 17:24:35 +0000 (UTC) Received: from [100.91.101.41] (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D06EBAF; Fri, 4 Dec 2026 17:24:28 +0000 (UTC) Message-ID: <7f61b962-b2ac-4aee-b009-559c4c47deec@redhat.com> Date: Fri, 4 Dec 2026 18:24:27 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC net-next 00/19] dpll: single-owner pins, board wiring as pin links To: "Kubalewski, Arkadiusz" , "netdev@vger.kernel.org" Cc: Vadim Fedorenko , Jiri Pirko , Jonathan Corbet , Shuah Khan , Randy Dunlap , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter , "Nguyen, Anthony L" , "Kitszel, Przemyslaw" , Andrew Lunn , "Lobakin, Aleksander" , Richard Cochran , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , Min Li , "Nitka, Grzegorz" , Karol Kolacinski , Saeed Mahameed , Tariq Toukan , "Oros, Petr" References: <20261126203231.934632-1-ivecera@redhat.com> Content-Language: en-US From: Ivan Vecera In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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