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 4C1A2C3DA49 for ; Thu, 11 Jul 2024 16:26:05 +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=T7OhN1orgjkUFZ9VtsQ2SG+/QVH1zaBAK8LCusREEJk=; b=bTN1KGdVcdc3UCerCJyFUyzy/r gB/9emFdcjgh0KvXOyW9Xz0FheEOaPr4ZHKBi2mqXHwy7MVbKLN2J1GYwhcpAitkjLIgitr6P8Q5v TnGpfyugsm5nkKzdhj13rRSlQYgXTy/Oewb6a2SONuOGads79qRCHGsMO8T89gOoOe3r96iHOsCjz YuhN4jxbebI8i0XkbKMpjwEVaqlB9dN3PaKPCOUKX1nfctOsLLksfgjOow5s6c6JaBOUhCO0pzxo3 vsF8HjLprkpbwM0KBf6I5i/0kvSy/RFl7Kj0SWQgnF6kEcxHKNouoLNnjB/Ht7EVRcRaPqyk92xvx RNuEQ0zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwcD-0000000EgUj-3Muu; Thu, 11 Jul 2024 16:25:53 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwbv-0000000EgP7-3RM9 for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:25:37 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 03D3D1C0007; Thu, 11 Jul 2024 16:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1720715131; 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=T7OhN1orgjkUFZ9VtsQ2SG+/QVH1zaBAK8LCusREEJk=; b=KfSv23b92wWAldauO0bENPiqrIxUSuP8Cn/5wJbThj6nK1iCvhovNQa6BRbLVwqiJuY3KM uNzOqFvuiKA/8qc7Gul0dD7PuUBcV/NZSiBGYwMyiUZzK3XcjcTowkFvpGn4IPr8wo8mkx X6wDgUFvM5J5m5G/XCMmEuuxKeoP0gao1U9NrfO8b9lC8p3pGV43y1OqkATBJ8jpBZXkn1 hnj1gkSYDoNyCS+LOYdM9rOMAYYFo/AV2FDR7LiQqP7KBrPJM5Y4Zm6ZoIVO+xsU1k57kv MsYWQQMTMAdQPXJB9AW0MMOZ2fx1qNITfXY5RNjawbM3m9YKoZS16E8/mh9W+Q== Date: Thu, 11 Jul 2024 18:25:28 +0200 From: Herve Codina To: Markus Elfring , Lee Jones Cc: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , 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: <20240711182528.1402892d@bootlin.com> In-Reply-To: <91cfc410-744f-49f8-8331-733c41a43121@web.de> References: <20240627091137.370572-2-herve.codina@bootlin.com> <91cfc410-744f-49f8-8331-733c41a43121@web.de> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_092536_149714_C7A642EE X-CRM114-Status: GOOD ( 10.15 ) 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 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 ? Best regards, Hervé