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=1795725270; b=ZNNb+vWytAfNPF9ovgX2h89aSqJH6IurVFq8U2KLaTAR27c0D0pf/X4NG2gvJN8P6Ck6 M3jkkJ2QQjaeKn4P4lxrGXWlGMKEDqIaRXyVLQ+MiFeXlD+2UlwDFmH5VMNX/cjue88Cq ubr2ogARIwpfL8wBHQsIM+baEXt9OPNmypUDLHrSC03kK7hTPIG0XPxD3yz263E+hySx3 LMKyzyyVcxRXGEW+Ll6Thm/EBV4j9ZQ98Rg59VravgD8hz0lO5cpN8TLDQ0SFyzHaqv69 L7x0FwInj7PeA+En7yLvnh6jTW2ciKVSEiALbOousg++dLuVlrVLzeLvweVGwTE4i1A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795725270; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=TpW/aO2pRUW8vCTqx+Lq5/2TghrPoKWcvdPUdPz/mZw=; b=xqQCl3Z+lSC96mXx9XWLfTKvGmHtqJZrpaSpRStJJQEkt4A2mwUttzv6hPfuhS9xwtZz mIdEjJHQmYo1Y9tIry2VMVZnFqPnbK2mmiMfJQel9nW/E7AkXZTyGzpLfui4v5c/Jry9r PkncxaTIVcN/zLj3nCCyz9M8jWsYukOoo7nrsdnp0OM++nPs8A7UvWFxp6QeNwFzJno1+ j+etLoEG7Pp+WcqTcnG8MAiB0ZVGF8dUSmledwOURkkcb0rxIJSdQQbtTXbnKynEWLSCq Xfw7P/orsL5Lbh/W8MzZkynAbZE1MSF/pWtUCkC6qHhsYgxJhMv7zIRiXH+1P3MnDTA== 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=A1M3Tnpq; 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 3A779606A321 for ; Thu, 26 Nov 2026 20:34:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3A779606A321 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=A1M3Tnpq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795725269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TpW/aO2pRUW8vCTqx+Lq5/2TghrPoKWcvdPUdPz/mZw=; b=A1M3TnpqDoou2F7MxMPN7QNw4IM8e63IvpvwcCmPDQ/6esb5KTGF92qCiMvEY8mTW+Cewy Q9CaMFZKsncPDxxyM588jpVQ36YkN93Y4zPel4+yp/r/tzjrzvs5MtaQvorVLqzdiRrQjY cG7YJdwp3diwiIOUVSPuEClxgcbWl7U= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-xc2boAwVMticbVqR9qHsJQ-1; Thu, 26 Nov 2026 20:34:25 +0000 X-MC-Unique: xc2boAwVMticbVqR9qHsJQ-1 X-Mimecast-MFC-AGG-ID: xc2boAwVMticbVqR9qHsJQ_1795725262 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A769D1955F74; Thu, 26 Nov 2026 20:34:22 +0000 (UTC) Received: from ivecera-thinkpadp16vgen1.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6A41A1801977; Thu, 26 Nov 2026 20:34:16 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Jonathan Corbet , Shuah Khan , Randy Dunlap , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter , Tony Nguyen , Przemek Kitszel , Andrew Lunn , Alexander Lobakin , Richard Cochran , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Min Li , Grzegorz Nitka , Karol Kolacinski , Saeed Mahameed , Tariq Toukan , Petr Oros Subject: [PATCH RFC net-next 15/19] dpll: register pins only with a parent pin of their owner Date: Thu, 26 Nov 2026 21:32:27 +0100 Message-ID: <20261126203231.934632-16-ivecera@redhat.com> In-Reply-To: <20261126203231.934632-1-ivecera@redhat.com> References: <20261126203231.934632-1-ivecera@redhat.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 dpll_pin_on_pin_register() accepts a parent pin of another owner and then registers the pin with the DPLLs of that owner. Its only user was ice on E825, which now describes its recovered clock muxes with its own DPLL devices linked with the zl3073x pins. Require the same owner for the parent pin, as dpll_pin_register() does for the DPLL, and document how to describe a mux in front of an input of another device. Signed-off-by: Ivan Vecera --- Documentation/driver-api/dpll.rst | 7 +++++-- drivers/dpll/dpll_core.c | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/driver-api/dpll.rst b/Documentation/driver-api/dpll.rst index 90c88fcf21b385..bc34fc83882fac 100644 --- a/Documentation/driver-api/dpll.rst +++ b/Documentation/driver-api/dpll.rst @@ -355,7 +355,8 @@ Pin ownership and links The owner of a dpll device or a pin is identified by the module and the clock_id passed to dpll_device_get() or dpll_pin_get(). dpll_pin_register() -accepts only a dpll device of the same owner as the pin. +accepts only a dpll device and dpll_pin_on_pin_register() only a parent pin +of the same owner as the pin. A pin represents a pad of the device whose driver registers it. When the board connects a pad of one device to a pad of another one, for example an @@ -364,7 +365,9 @@ the driver of one of them describes the connection with dpll_pin_link_add() on its own pin. The link names the pin at the other end by its firmware node, which the driver of that pin sets with dpll_pin_fwnode_set(). Each driver registers only its own pins and the -drivers may probe in any order. +drivers may probe in any order. A mux of one device that feeds an input of +another device is a dpll device of its own driver, with the selectable +signals as input pins and an output pin linked with that input. While both pins are registered, ``DPLL_CMD_PIN_GET`` reports the link for each of them with the id of the pin at the other end: diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 7440b174c3de2b..9b48d289ec7330 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -1081,6 +1081,8 @@ EXPORT_SYMBOL_GPL(dpll_pin_unregister); * * Register a pin with a parent pin, create references between them and * between newly registered pin and dplls connected with a parent pin. + * The @parent and the @pin must have the same owner, they must be created + * with the same module and clock_id. * * Context: Acquires a lock (dpll_lock) * Return: @@ -1097,6 +1099,13 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin, if (WARN_ON(parent->prop.type != DPLL_PIN_TYPE_MUX)) return -EINVAL; + /* A pin of another owner is connected by a link, see + * dpll_pin_link_add(). + */ + if (WARN_ON_ONCE(parent->module != pin->module || + parent->clock_id != pin->clock_id)) + return -EINVAL; + if (WARN_ON(!ops) || WARN_ON(!ops->state_on_pin_get) || WARN_ON(!ops->direction_get)) -- 2.56.1