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 22209EED60D for ; Thu, 12 Sep 2024 14:39: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:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References: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=gfrHsHqrKqEy0K57E7lT0b6Rs6kOfyFPjh0LRBOq+OI=; b=IeQBkEH+CrIZ3UnFPG8kNYCgwa Rcs0t0ts0yABT7pv/9mgPeN4qBmw4w10hcsDAdmf8b/x0FMrZ/k16T4omdFdUNIlR8EZZ+elVbrn4 tcXDWimhqHK0ERYhXK10+qnUGJ5ZY/H+qcn1uquFyp8VkoCuXJsRaHSG/ky1XiIf0b7ew28aggaz4 771gzjeItwRkY1WxNU1thUmeWAy0yL9oKl8PhiU5waXRkMrBu9zdFKX84uWlrBZ1azzNBptHmU1nS emxLDiuzJh4q58ET/XulqLABuJ8uiDZ8hwyLbC5xyri9hO7ktfI5fViBQte7F9TpE18MZ7UUU5Fy2 +i6hMWjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sokyo-0000000DOSY-2l7m; Thu, 12 Sep 2024 14:39:30 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sokxC-0000000DO3d-2fTu for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2024 14:37:51 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id E55F8A4336B; Thu, 12 Sep 2024 14:37:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63210C4CEC3; Thu, 12 Sep 2024 14:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726151869; bh=aaWSOI6MHJpLiPOnj5+JUWz8WRVEzc2V3HK4lxMCrXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UqmkcdBva718XKuLTmddQooosXpq27yFyMFL567h3OryjxwVrDJOdtHm5QJaKCxcm 93KB1ZBPVPNnvAtgJDn1WHP9ywGz+muzfZorn2eHYEmO1kCCd7e1K6wRph5z9yE6Ve GvjMTETF6ht/xp8V5qLMdt1aYPVSBmiDt0GE9/aNzg1JAMwFYoc1WNVHZC/aMTUbsG RUj4a4KfesifilOHjhd81AGQhorbOiKV1m+Ri/V/X4egcafHZpHZ7/m+Lu0k2a5jER XNFJMwDf8ZMPCYPcpNQFAgR16FubTNv5NRBuJo49G68/ghUhWQc6Znzxr8urVYRXF0 6y4w7XLpj3RoQ== Date: Thu, 12 Sep 2024 15:37:40 +0100 From: Lee Jones To: Herve Codina , Arnd Bergmann Cc: Geert Uytterhoeven , Andy Shevchenko , Simon Horman , Arnd Bergmann , Derek Kiernan , Dragan Cvetic , Greg Kroah-Hartman , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Rob Herring , Saravana Kannan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , Andrew Lunn , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Allan Nielsen , Luca Ceresoli , Thomas Petazzoni , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Subject: Re: [PATCH v5 3/8] mfd: syscon: Add reference counting and device managed support Message-ID: <20240912143740.GD24460@google.com> References: <20240808154658.247873-1-herve.codina@bootlin.com> <20240808154658.247873-4-herve.codina@bootlin.com> <20240903153839.GB6858@google.com> <20240903180116.717a499b@bootlin.com> <20240909095203.3d6effdb@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240909095203.3d6effdb@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240912_073750_827858_C56428C7 X-CRM114-Status: GOOD ( 31.65 ) 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 Mon, 09 Sep 2024, Herve Codina wrote: > Hi Lee, Arnd, > > On Tue, 3 Sep 2024 18:01:16 +0200 > Herve Codina wrote: > > > Hi Lee, > > > > On Tue, 3 Sep 2024 16:38:39 +0100 > > Lee Jones wrote: > > > > > On Thu, 08 Aug 2024, Herve Codina wrote: > > > > > > > From: Clément Léger > > > > > > > > Syscon releasing is not supported. > > > > Without release function, unbinding a driver that uses syscon whether > > > > explicitly or due to a module removal left the used syscon in a in-use > > > > state. > > > > > > > > For instance a syscon_node_to_regmap() call from a consumer retrieves a > > > > syscon regmap instance. Internally, syscon_node_to_regmap() can create > > > > syscon instance and add it to the existing syscon list. No API is > > > > available to release this syscon instance, remove it from the list and > > > > free it when it is not used anymore. > > > > > > > > Introduce reference counting in syscon in order to keep track of syscon > > > > usage using syscon_{get,put}() and add a device managed version of > > > > syscon_regmap_lookup_by_phandle(), to automatically release the syscon > > > > instance on the consumer removal. > > > > > > > > Signed-off-by: Clément Léger > > > > Signed-off-by: Herve Codina > > > > --- > > > > drivers/mfd/syscon.c | 138 ++++++++++++++++++++++++++++++++++--- > > > > include/linux/mfd/syscon.h | 16 +++++ > > > > 2 files changed, 144 insertions(+), 10 deletions(-) > > > > > > This doesn't look very popular. > > > > > > What are the potential ramifications for existing users? > > > > > > > Existing user don't use devm_syscon_regmap_lookup_by_phandle() nor > > syscon_put_regmap(). > > > > So refcount is incremented but never decremented. syscon is never > > released. Exactly the same as current implementation. > > Nothing change for existing users. > > > > Best regards, > > Hervé > > I hope I answered to Lee's question related to possible impacts on > existing drivers. > > Is there anything else that blocks this patch from being applied ? Arnd usually takes care of Syscon reviews. Perhaps he's out on vacation. Let's wait a little longer, since it's too late for this cycle anyway. -- Lee Jones [李琼斯]