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 87D7EC3DA45 for ; Thu, 11 Jul 2024 17:09:56 +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=IX4sM0WOpoNrCSACJOimSNvIyQZkyKJmDu8f/v4Elf8=; b=aeSPStH3RKnnhWWpfF5MQFwcna Y6PddkPmd3Ft7r01peyxrebuFkTj3bNVIPL2cnWsHIOoyz6cWTmUF5rLwHn/LUtOvOKMy1XmTFxuR y8pk6scYuz0m8P6Zq5CkY9tf3NkO/Fl9a+Owr/L6gqPz/l2Umw6LmZ9IpfeFaLbzDSKqOo49CHzCR HkIW1iD2/0au0Eb2kikNQkFH3NtczfMve+D6/I+I0HcPebQTHYcwopugAdu1xeTmPl+2BNRQY8/Ci pzEZrnBW/dntZPxL8blxG7lq4fNbnvAQzXqh8pInitm6eSezfQjPdPWSipleYJGSWslMIuxwpddzN oTZUa1aA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRxIb-0000000EoMw-1BpX; Thu, 11 Jul 2024 17:09:41 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRxII-0000000EoG1-3qRb for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 17:09:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8088DCE190B; Thu, 11 Jul 2024 17:09:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EF51C116B1; Thu, 11 Jul 2024 17:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720717759; bh=4AsmtB1c0/haUg/T+xK8LCVjZIWcIFk1GR+agnIeol0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=npMBJKAK7s69Z/WDXZvryOrC1AXCklNKsLLxOCs3gsJfApoz0/Ox9lYee1sJ6JwFC lzx5PgO1lGRj2EKUh3icE9RHKreJLdJFw+BKutxdCPSHRfth/k1X0ATH8iFfNL9fcK AI83yw0uN4QfyYXRNmqakAMB+ri/2WvgtUJy8Mjvte/exqSdq9GP9l6B0P7O2MzXBy YOUJ1fOXUHj22VvxXuP2nytibhRZMRTAMgjS3uLsA1nwarmZ1yF+vWOcbIiKCKhuJR dY8lY7THLhQ9ec1bS3ImuG5ExziA3ve8s3lT6skT1KkhFWulvX1K9EsKrDDU/OQ5Bc qrs9k3Yd9wRMQ== Date: Thu, 11 Jul 2024 18:09:10 +0100 From: Lee Jones To: Herve Codina Cc: Markus Elfring , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , devicetree@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, linux-arm-kernel@lists.infradead.org, Andy Shevchenko , Arnd Bergmann , Bjorn Helgaas , Conor Dooley , Daniel Machon , Krzysztof Kozlowski , Lars Povlsen , Philipp Zabel , Rob Herring , Saravana Kannan , Simon Horman , Steen Hegelund , LKML , Allan Nielsen , Andrew Lunn , "David S. Miller" , Eric Dumazet , Horatiu Vultur , Jakub Kicinski , Luca Ceresoli , Paolo Abeni , Thomas Petazzoni Subject: Re: [PATCH v3 1/7] mfd: syscon: Add reference counting and device managed support Message-ID: <20240711170910.GN501857@google.com> References: <20240627091137.370572-2-herve.codina@bootlin.com> <91cfc410-744f-49f8-8331-733c41a43121@web.de> <20240711182528.1402892d@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240711182528.1402892d@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_100923_156412_7B73B314 X-CRM114-Status: GOOD ( 13.69 ) 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 Thu, 11 Jul 2024, Herve Codina wrote: > Hi Markus, > > On Thu, 11 Jul 2024 18:09:26 +0200 > Markus Elfring wrote: > > > … > > > +++ b/drivers/mfd/syscon.c > > … > > > +static struct syscon *syscon_from_regmap(struct regmap *regmap) > > +{ > > > + struct syscon *entry, *syscon = NULL; > > > + > > > + spin_lock(&syscon_list_slock); > > > + > > > + list_for_each_entry(entry, &syscon_list, list) > > … > > > + spin_unlock(&syscon_list_slock); > > > + > > > + return syscon; > > > +} > > … > > > > Under which circumstances would you become interested to apply a statement > > like “guard(spinlock)(&syscon_list_slock);”? > > https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/spinlock.h#L561 > > > > I used the spin_{lock,unlock}() pattern call already present in syscon.c. > Of course, I can add a new patch in this series converting syscon.c to > the guard() family and use guard() in my introduced lock/unlock. > > Lee, any opinion ? I'm intentionally leaving this one for Arnd. -- Lee Jones [李琼斯]