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=1795725272; b=HJwYBdI0CJeIALSmJUp9OBbw9LrxIe+o9ElDK5CNbIBAUQBKI9GlneLdoI6BnQIJf7I4 hu8rJDoWnQPcb206/a2n8TG7W2FIlVfpqcWS/p2OpC48U2sAMKjkaydffrgjYzVIw1s3m nD18n6bxK2MANt3xd6GHk9TE+m6uR6YHB09oiLk3phbY4saaPk7AnBe7/9W7l71Bz3yLg LTYKECJKGxgKOF1jqVPhTdvkS/22tdzBmlG9vFv/3DN1AMVjo+3ortguaCmkig5jIWzFr 7AZxJuMxaeXKXKl6oLyAg0LiPkHmjEGMuZKjJfWRhrdJTFmDTAoNjP5MlKtzxMiUnUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795725272; 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=Of65ISojKJqWaOLF+/EswMF/JIi4EquHU0GW0LE/Y71ZzTRa/m8Mh+2AcTiVY+M7wcex wFO0ZU2Wy9CqPpuF9vaCumyOVdZ51Iq02cfoUBAeNrFiamAJSycz0G62OP43OlRmFYbl0 WZsurPDjcYNc2imXFn3SB3ozPfAs+N0q9oI5tY1f1fK/5UXwQ/gFKziZzjp1JuBh7H1Ek V0J25C9Vb9XqVM82bwbOEA1YO3mgRRcmPaYzOCA72RWMsnrb6nPHnoq29CETGVFDHF63D m7vv9hOzWulrSODPfcn2zpaP1Fx8qtcbqesgvUVZVQy08u7rLXhwNayyyCKPnNqb0ow== 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=hxNZbH6b; 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 E85EE606A337 for ; Thu, 26 Nov 2026 20:34:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E85EE606A337 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=hxNZbH6b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795725271; 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=hxNZbH6bxxqpFKPh53oXvgZ/s7LAPy14fqx6IzrUueLc2RLGIaTClRnDCmgCgc1uBPVGzd M1ezWODhzdSCh0QEUwMRebRmTOg4jztlE69aVPxVDWMCSzbf4+1a1TDWXuiNNedzN/QReo aURfJn+Xqyn7otYlFzwpp5hV6fUxNzY= 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-doc@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