From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F256C369A2 for ; Tue, 8 Apr 2025 14:33:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wy3Km0AVXCTI4DrQJkFCQiFPROUoaPoc5lNFfKuzy6A=; b=PuzOthM6XLazKaXA+p2b6gjg+5 HGHku3ULjOMEEUuQOcDBbjbv5he+zHOboph++CCRDBs0/krJmkke9wkXgKYdnTB5mglGxO7gMR/R/ vq0xshqqX5QnkafDloHgG7mKPknBAMhs6xG3Q7K2w/2P0PNXmLGTkeCroA6o1XnOzfphdfU/nybIt heStk2XZLXoJv2Ik1A/QzE29Ex5RjFuwHjMwqGH41CvBaM3xrT8iM9rhTbXRQ3Ow4ARi/sUzKIoU4 okhXXAntClXtOrSAOx9V38isz+HYVqu01APtrPGybZYSiXFAK5SOY/YiBB2i3dJrlgpD39OSgmJnA cLc5Rmhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1u2A11-00000004Ors-0n01; Tue, 08 Apr 2025 14:33:27 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u29wn-00000004O2V-2o3I for linux-arm-kernel@lists.infradead.org; Tue, 08 Apr 2025 14:29:07 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 74EF144351; Tue, 8 Apr 2025 14:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744122543; 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=wy3Km0AVXCTI4DrQJkFCQiFPROUoaPoc5lNFfKuzy6A=; b=gxVrnn/JVh0iC4BPAsAridJn4qT7FAvRDSKdNs6dH7buDlSemR54nzZAPf3tIIgziWPivZ owfGzS3t8eTMAXID8Ioi7sBsZdU89YTITi0SEbf8OqVFObyYjO+ht1vLjc5sY+ZyvqoT1K XbseKEUk2rLd/GRjaBGXXD4ZWxucg5+n12Wvsu4S5CSPYu5QmT6BNMavIW1w1SbZQReccT qUUpAhhXYCUUmyEmRSVEe1j6vwK02/srrDJfFTL7lpFtxTtMFeLk14cSsFkAKRvzUyYHkM gSlm2nGbIp2xmGhocUyVGi1ZV+VblO56FfmKtmdd8n0wwK2H7ES6ZJo6/49MhQ== Date: Tue, 8 Apr 2025 16:29:00 +0200 From: Herve Codina To: Andy Shevchenko Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Michael Turquette , Stephen Boyd , Andi Shyti , Wolfram Sang , Peter Rosin , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Rob Herring , Saravana Kannan , Bjorn Helgaas , Mark Brown , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus , Wolfram Sang , Geert Uytterhoeven , linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-spi@vger.kernel.org, linux-acpi@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: Re: [PATCH 08/16] i2c: core: Introduce i2c_get_adapter_supplier() Message-ID: <20250408162900.41b6bc08@bootlin.com> In-Reply-To: References: <20250407145546.270683-1-herve.codina@bootlin.com> <20250407145546.270683-9-herve.codina@bootlin.com> <20250408150836.327a337d@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdeffeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfgjfhhoofggtgfgsehtkeertdertdejnecuhfhrohhmpefjvghrvhgvucevohguihhnrgcuoehhvghrvhgvrdgtohguihhnrgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepveeiffefgeeitdelleeigefhjeelueeuveekveetgeffheeltdekgeduiefggfdvnecukfhppedvrgdtudemvgdtrgemvdegieemjeejledtmedviegtgeemvgdvvdemiedtfegumeehkegrnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddumegvtdgrmedvgeeimeejjeeltdemvdeitgegmegvvddvmeeitdefugemheekrgdphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhephhgvrhhvvgdrtghoughinhgrsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeegtddprhgtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgvlhdrohhrghdprhgtphhtthhop egurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhhrgifnhhguhhosehkvghrnhgvlhdrohhrghdprhgtphhtthhopehsrdhhrghuvghrsehpvghnghhuthhrohhnihigrdguvgdprhgtphhtthhopehkvghrnhgvlhesphgvnhhguhhtrhhonhhigidruggvpdhrtghpthhtohepfhgvshhtvghvrghmsehgmhgrihhlrdgtohhm X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250408_072905_836430_03C89537 X-CRM114-Status: GOOD ( 31.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 8 Apr 2025 16:47:51 +0300 Andy Shevchenko wrote: > On Tue, Apr 08, 2025 at 03:08:36PM +0200, Herve Codina wrote: > > On Mon, 7 Apr 2025 18:27:07 +0300 > > Andy Shevchenko wrote: > > > On Mon, Apr 07, 2025 at 04:55:37PM +0200, Herve Codina wrote: > > ... > > > > > + return get_device(adapter->supplier ?: adapter->dev.parent); > > > > > > What will be the meaning when both are set? Why dev.parent is not the same > > > as supplier in this case? Looking at the commit message example, it seems > > > like you want to provide a physdev or sysdev (as term supplier seems more > > > devlink:ish), like it's done elsewhere. And in the same way _always_ initialise > > > it. In such a case, the ambiguity will be gone. > > > > When both are set (this is case for i2c muxes), the adapter->supplier the > > device that register the I2C adapter using i2c_add_adapter() or variant. > > In other word, the device that creates the I2C adapter. > > > > The adapter->dev.parent is most of the time the device that register the > > I2C adapter except for i2c muxes. For I2C muxes, this adapter->dev.parent > > is the adapter the i2c mux is connected to. > > > > Between physdev and sysdev, I really prefer physdev and, if renaming from > > supplier to physdev is still needed (and wanted), I will rename it. Let me > > know. > > The terms supplier/consumer are widely used in terms of power and devlink. > I think here should not be used the term supplier. physdev seems good. I will use that. > > > For initialization, I don't want to modify all the I2C controller drivers. > > What I can do is to initialize adapter->supplier using adapter->dev.parent > > during the i2c_register_adapter() call if it was not already initialize by > > the caller (i.e. the I2C controller driver). > > This can be done in the I²C core, but I'm not insisting on this part. > We can start from your function only and then decide later on how to > proceed (depending on how many users of that field appear and what > they want to do with it). > Right I think I can keep my function as it. Wolfram any opinion? Best regards, Hervé