Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp397780lqp; Tue, 11 Jun 2024 07:43:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWR6fkyiK9HwSfjBfusfveaA99BPabJJvYxewpi+62oVwGcoNurITZBBC7HjVqAULH2d3G8gFnEQ4zYJNugPOlG6LfImZd1xKhZrsO/Yg== X-Google-Smtp-Source: AGHT+IFCRLxNpRdSpJtAUESA1BbKtcpxIJ6paPEBR8VtxS+LgZhFJp7y0uvx/SNJNRQBYFgC5PU3 X-Received: by 2002:a17:903:1d1:b0:1eb:6527:707f with SMTP id d9443c01a7336-1f6d031f82bmr142964155ad.39.1718117012798; Tue, 11 Jun 2024 07:43:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718117012; cv=pass; d=google.com; s=arc-20160816; b=oorrC/SRsCkP6z4/yOpshfq3UjkVnarIMZQ+Wh5sRxuUor0b867RguOzI4hzIN90nb kXauJAetnBMg6lsk2gVRCeASNfpnoqvtY9Dp0AJR/50N99mQFeLNFA5u4+zpqFAhCwtl zFo9KPAQ1w5dDuCfgqdELjEVnTaSXYTQgNbNU7XTcLFaFdlslgUJdt8JqRmhd4alsH64 FeNOlILslcDmpVSPy2NN8vyzJ7oFpaq8yvXF8XRjj3pkIv8Y2JyUMcvIadjTAZ1HYSqf Q3tOfmvioRwCFd519RMewYIisAyBlaboovIit5P+k8xJnKmnvuXhO0eglwN58xVvIXJI lNCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=qWHfpv+jXiy2o9uspnLye8WVPnOeDHAl++BqV0w7CAE=; fh=3jF2rTvRVYESiLbaoVIwyPMnH0xFBxTKctdFxJA7/mE=; b=PrsPEXZRcfd4jEohLDXdADq2IT/lo984C79EVvP1agf4QwlyDFY/LeN5aE7xAusiV4 sNfFc00oQ2Ycy2Tx+cBc1iDDe7oC2HubF4ilhlP7jrDRYGY+zfV0cFrxvEakK6Z9X2g2 1M7Lw+Yk8JxmtEuWjHNpjzvNlMVBUN8jSyhW2jv1qXAIA5OvC2rutbwZiTeRAjvi14DJ eg9yFh6EW9qpvde2UGXrDC0lmPuH0scimii6h/skEYBkYp69mNYXm6WRP2WCPyoQVzqf 5wGZodeI1mMdhJD4/LMYQXM1psCtA7AsjWCavFylxxrOI4lc+b/o4XqQwGvMrXmLWhor 5Zbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=O5UyJSFe; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-210075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210075-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd760694si90422165ad.11.2024.06.11.07.43.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 07:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=O5UyJSFe; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-210075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210075-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3126328379B for ; Tue, 11 Jun 2024 14:43:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA1B117DE0A; Tue, 11 Jun 2024 14:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="O5UyJSFe" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3B5B5336D; Tue, 11 Jun 2024 14:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718117005; cv=none; b=mxpnqQIvD1Qp0BYmrWRRf64q4B7z/m4IpsMAncd8dAhxv90GpLHQwRnKOPHY5JEB3ZGw0P6xgg7qW0Xrg4jJTXXHulQiUCF8i89lbqIIdmvl7urHIYPF4h0Gz2tu0WIA5H+BaNtWLqwlI6pjGDQKc6+ks0cKubFMpFVWvf8+H3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718117005; c=relaxed/simple; bh=ku6qOjGqxKvBFbmOLLJ5xchcQT1HGT23J6TUWkvY6NY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lVV1UC2UxIsiPRbI7uEcBUIhYVyqP1dtS2hN1GME29CK0ieFl4y/LZbL7DFULALXANaEkseq76LkmeSimeBYUXLFZIHmbXgO52CAHCrcRiNixWZPtV73oeN/qPSswIFKIzSX3LPDA2xzHMkzMF8vsKopgwr+ZI6V22dOQF4BgBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=O5UyJSFe; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id E372920009; Tue, 11 Jun 2024 14:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718117000; 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=qWHfpv+jXiy2o9uspnLye8WVPnOeDHAl++BqV0w7CAE=; b=O5UyJSFeA2xPnA/OYrMwNbImlf+JqBITKgrNDlruVVA74nZbE8la1RTak3sR+cQPD66/PS ucxHox0AAUqO7xw8PPEgJz0V0Ni771LgSFDfhz/sp0KyDW+lYM/826n3jy4FvoYaM+FFOE 5oeASV2NlTjgEj4F7ed5X3Mtpm+3rsMnay+dOGoBd8+KMCeQjXjQtOYIjLi+pchGVpWpie ElX1jduFhWIqZkkTj45eIdaU20f0QoQO/QA8e1ygU3EpYj7epRCNEiazShVpIWNi2oSDmz +7ZYyOeK9zSqiG68gxeXn5AeXkTnDMos+F+vjy34NXp6OCOIEbnWIX6vnD7PLQ== Date: Tue, 11 Jun 2024 16:43:15 +0200 From: Luca Ceresoli To: Rob Herring Cc: Krzysztof Kozlowski , Conor Dooley , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Saravana Kannan , Paul Kocialkowski , =?UTF-8?Q?Herv=C3=A9?= Codina , Thomas Petazzoni , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Kocialkowski , Srinivas Kandagatla , Miquel Raynal Subject: Re: [PATCH v2 1/5] dt-bindings: connector: add GE SUNH hotplug addon connector Message-ID: <20240611164315.64414552@booty> In-Reply-To: <20240605144531.GA2642279-robh@kernel.org> References: <20240510-hotplug-drm-bridge-v2-0-ec32f2c66d56@bootlin.com> <20240510-hotplug-drm-bridge-v2-1-ec32f2c66d56@bootlin.com> <20240510163625.GA336987-robh@kernel.org> <20240514185125.58225238@booty> <20240605144531.GA2642279-robh@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-GND-Sasl: luca.ceresoli@bootlin.com Hello Rob, thanks for the follow up. I still have a couple questions for you before I see a clear direction forward, see below. On Wed, 5 Jun 2024 08:45:31 -0600 Rob Herring wrote: [...] > > > > + # "base" overlay describing the common components on every add-o= n that > > > > + # are required to read the model ID =20 > > >=20 > > > This is located on the add-on board, right? =20 > >=20 > > Exactly. Each add-on has an EEPROM with the add-on model ID stored > > along with other data. > > =20 > > > Is it really any better to have this as a separate overlay rather tha= n=20 > > > just making it an include? Better to have just 1 overlay per board=20 > > > applied atomically than splitting it up. =20 > >=20 > > (see below) > > =20 > > > > + - | > > > > + &i2c1 { =20 > > >=20 > > > Generally, I think everything on an add-on board should be underneath= =20 > > > the connector node. For starters, that makes controlling probing and= =20 > > > removal of devices easier. For example, you'll want to handle=20 > > > reset-gpios and powergood-gpios before any devices 'appear'. Otherwis= e,=20 > > > you add devices on i2c1, start probing them, and then reset them at s= ome=20 > > > async time? =20 > >=20 > > This is not a problem because the code is asserting reset before > > loading the first overlay. From patch 5/5: =20 >=20 > What if the bootloader happened to load the overlay already? Or you=20 > kexec into a new kernel? When an overlay is loaded by the bootloader, IIRC it becomes an integral part of the live device tree and is not removable anymore. This does not make sense for a physically removable add-on: as the add-on can be physically removed, its device tree representation must be removable as well. And the main board is able to work autonomously without the add-on, so I don't see any reason for loading the overlay in the bootloader. For the kexec case, the main use cases I can think of involves 'kexec --dtb=3D...' to loads its own copy of the base DT (without overlays). So everything will probe again, and the overlays will be loaded again by the connector driver if/whan the add-on is connected. And if there are use cases of kexec when the 2nd kernel finds the DT with the overlays already loaded, this is just as wrong as in the bootloader case. > Keeping things underneath a connector node makes managing the=20 > dependencies easier. It also can allow us to have some control over what= =20 > overlays can and can't modify. It also reflects reality that these=20 > devices sit behind the connector. =46rom my limited point of view, these points appear all nice to have but not strictly needed. About the last one, referring to your example: > > > For i2c, it could look something like this: > > >=20 > > > connector { > > > i2c { > > > i2c-parent =3D <&i2c1>; > > >=20 > > > eeprom@50 {...}; > > > }; > > > }; =20 I definitely understand the usefulness of such an additional level of indirection in the most general case, to decouple the add-on side of the I2C bus from the base board side of it, thus allowing multiple different base board models and even helping with having multiple connectors (multiple add-ons at the same time) on the same main board. But I also see drawbacks. The first one is added complexity. The second is that this representation seems to suggest that the 'i2c' node above is another bus w.r.t. '&i2c1', somewhat similarly to what happens with child busses of an i2c mux being a different node from the parent bus. But in this case they are really the same bus on the same electrical lines (when the add-on is connected). So I think both representations have pros and cons. Back to the specific product I'm working on: there is only one base board model, and also only one connector per main board, and this is by the very nature of the product, i.e. it would not make sense to have two connectors on the same board. So in the specific case of this product, do you think it would be OK to keep the representation I proposed initially? > > > Do you load the first overlay and then from it decide which=20 > > > specific overlay to apply? =20 > >=20 > > Exactly. > >=20 > > The first overlay (the example you quoted above) describes enough to > > reach the model ID in the EEPROM, and this is identical for all add-on > > models. The second add-on is model-specific, there is one for each > > model, and the model ID allows to know which one to load. =20 >=20 > So you don't really need an overlay for this unless the EEPROM model=20 > changes or the model-id offset changes. The EEPROM model is the same on all add-on models, or at least it's fully compatible. Otherwise finding out the model ID would become very annoying. However the EEPROM is on the add-on, so describing it in the main DT would be wrong. Not only conceptually, as hardware not present should not be in the live DT, but also practically, as when the add-on is removed and then a possibly different add-on is connected we need the EEPROM driver to probe again, in order to do any initialization that might be needed in the EEPROM driver probe function. So I see no option but adding the EEPROM in an overlay. But it cannot be the "full" overlay because before accessing the EEPROM we don't know which model is loaded. Do you have in mind a better approach that I just didn't think about? Best regards, Luca --=20 Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com