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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 56B46EB7ECA for ; Wed, 4 Mar 2026 11:07:57 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fQqdl3TDQz30hq; Wed, 04 Mar 2026 22:07:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772622475; cv=none; b=MOZizPyaF7JWU02bMAu2ewnrJlDwnKs3vvY/wHzdGG/InKoi6kwaKU2l+MyZrKiz2x889yjyMURvGplzHBbWfoiin0yMOK2MRueXOe+L8psgDhqJ/C0RUretfupfg9GhCQ+V9vc51wuYYOgnBhhsCVAwptsLauTfbYBBn+Z72LvQI1P61NC0pvTnbAbbjUfemLk/H3RXuEW8O/x2Vbqmp9XilYHy2ENUbYvN4sRKL/vG838lwMl0A/aK5ec70rMjjydppbz0pFGHBA3TRSKWNrdsl3ShAPKDFmARdfQ8VJV3ePAYrV6C32bQ15GWQEKZgwVCztK8ANFzgGyuZsKITQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772622475; c=relaxed/relaxed; bh=Go6Wehmyci0DJ/MCAqPt3GYrNoZxkU13L6zOAdfar8s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OYSQBt0yah4/KY/+i4D54r2LVMPwBmIDYWELy7qTmM48UzSGsFZqWRCOGiC6EWNsbOtiAHb9JwBL9Sku4HjpzlRsu0xAOj/o7IhVYtuTjah4Wr205FJ+SFtJlZNfa1QNBaYsVwjqWa85kjRR4QK1/pmYAF7NDtABhidtE8wffywKYC4ivvaT5aqVXyaRCl4exWYFCHKq0BLuYIlfgsYbz1TUIkrDsiLjEEWCvdg1J5kRENKIfrm0Cij4XNVw28nQq3PuesvnXTaZWsdl7WMd6muACdOxjlaMLlkXuyuHGAHxIodKiTBORQqip0YYnSxXZCC8OQzKEhuqdL8Y6OaBLg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; dkim=pass (2048-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.a=rsa-sha256 header.s=k1 header.b=kkivlZzP; dkim-atps=neutral; spf=pass (client-ip=194.117.254.33; helo=mail.zeus03.de; envelope-from=wsa+renesas@sang-engineering.com; receiver=lists.ozlabs.org) smtp.mailfrom=sang-engineering.com Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.a=rsa-sha256 header.s=k1 header.b=kkivlZzP; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sang-engineering.com (client-ip=194.117.254.33; helo=mail.zeus03.de; envelope-from=wsa+renesas@sang-engineering.com; receiver=lists.ozlabs.org) Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4fQqdf0R7pz2yY0 for ; Wed, 04 Mar 2026 22:07:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=k1; bh=Go6W ehmyci0DJ/MCAqPt3GYrNoZxkU13L6zOAdfar8s=; b=kkivlZzPtMJBXQH/hPQ3 qPCcLeyBPW7V9igmfr58nDc4NCvyUwzGdvAK/tIsS18FsNK2UOl2llVTiRyIQDH8 zX64j6IFxhKiwPtP0mCvWQDqKyem0mxivks65IsLnnGgzejW/UbORNu6fVqegwke soPJOCFJ7fO6ci9/sJyDjtt088/mH1PBt4uWsN00gJaSRvz9Au+P3PzXZXC69AQP o8aYQwbaVu/COFNWlQy6UP9/ZIekJc+opAnXSKLR7fisH2iL1s29I5lgFHiz/p98 hoBGmoA0+RlVDSglIYUHHdWMlv+mJvwKcdfR4PVQ3LULl54pUz5Sc+EoC7/JEe0n tw== Received: (qmail 702506 invoked from network); 4 Mar 2026 12:07:40 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 4 Mar 2026 12:07:40 +0100 X-UD-Smtp-Session: l3s3148p1@BIQK1DBMcBptKXG7 Date: Wed, 4 Mar 2026 12:07:39 +0100 From: Wolfram Sang To: Bartosz Golaszewski Cc: Johan Hovold , Bartosz Golaszewski , Andi Shyti , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Khalil Blaiech , Asmaa Mnebhi , Jean Delvare , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Andreas =?utf-8?Q?F=C3=A4rber?= , Manivannan Sadhasivam , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-actions@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: [PATCH v2 00/13] i2c: add and start using i2c_adapter-specific printk helpers Message-ID: References: <20260223-i2c-printk-helpers-v2-0-13b2a97762af@oss.qualcomm.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Bart, hi Johan, > And I agree: doing the above would be even better but you'd need - for every > driver - to move the i2c_adapter struct out of driver data and make it a > pointer. That's in addition to providing new APIs and using them. I2C drivers > are spread treewide. There's a reason why nobody attempted it for decades. I'm > proposing something a bit less complex: allow drivers to free i2c_adapter at > unbind but make i2c core keep a private, reference-counted structure for as > long as it's needed. I am still with Bart, the above paragraph sums it up extremly well IMO. I also recall that the outcome of the Plumbers session 2024 was "go for it!". Nobody said the approach would be "fighting" the driver model. There were a lot of experienced developers in the room. > I'm frustrated because I'm spending time working on an actual solution. I've > explained what I'm doing and what the end result will look like based on what > works for GPIO (struct gpio_chip's lifetime is bound to device's "bound" state, > struct gpio_device is refcounted, I want to mirror it with i2c_adapter and > whatever we eventually call its refcounted counterpart - let's say: > i2c_bus_device). I am super-happy and thankful that Bart volunteers to spend all this time on fixing this decade old problem. I know this alone is not a reason to accept a technically bad solution. But I think it isn't. I think it is a viable approach to keep the churn and potential regressions lower than a theoretically ideal solution which is nobody to do anyways because you'd need to refactor drivers from the 90s in a quite intrusive way. All the best, Wolfram