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=1795725273; b=vzQD+1vRkrIVSWogEYGs3ikmEMcLsD0xV5W2paabqK16B5VAAc+YMLrK6XZlhFNDdfcQ PBcq5tdF5TJOxCJ+MNvApFoXCRedXYJudWrtlh3yGLT7F0IhWsgQ/lh65wWiF4m7XnC3O BWnZKo7SZNX0UZB5/JZCKBGlGq0TDc0jyz3mUgBTLSZ64p5ABVpUxPsVttCvnx9LFNBzZ Lq8hw8ORl8X/OALtaNN6LNzl6FP9ezj9+tEGrgmwK4kI37p7t0KemDBeteZzgbAaVTFmh Ju36eJn3c8LAOKugLvIMRGnOgxcsw+i4emUJiAUT6hEIirMj5IPGvwDyAPuykFiz+MQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795725273; 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=t22PrL6VXe9jacK2rbIoFVcbGYrq91uVggWMiKAZH3+8Gl+UdddSjseHAqhFd2TD6OHl mN6ChpaYKZCOCQow+K1o7GfaPmroX6PRblVJqrhbiq2ISEs11iv+CZdmUHWkMSja1wTx3 dQSXcfL47cBkspxyHPTKk0djYjqpXXeHmC80TzYdIWpbXs8dJL5zFa8wGVqajTK9N1cwn 7/jbTa4nuuU3kLouWekwW/AMoFTwNeoeQOcnumhHr39Bwazz3IxVzPshweylN/kdMltce X7NXRJyMCZe9k1nJZ+ZLxBw+P80mbxVVhuxTSRjXe1HDsii/NlMT1Lr/vh2GWZ5TUwg== 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=XmBoga+4; 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 DE74E606A32A for ; Thu, 26 Nov 2026 20:34:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE74E606A32A 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=XmBoga+4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795725272; 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=XmBoga+4FBQn4d1gS9R+VhHojlaDqCZltW02/J8cHVOhEKHglTLpcj8GZrOF/DVBR8dDvB FJRZmqh0KLscDl3O0+jTp3IvmhQeg7d0Es+/8Z/aG79TNhfyhIOy8O0oBtz4lAtptKmHFj SnEePXpykqXqhKzVuCYiQ+t3xn7lYaI= 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: netdev@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