From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBED8288B5; Thu, 11 Jul 2024 16:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720715142; cv=none; b=k2MTd0WtIfgrmIqNXBqHxDOim5to++rsMZ9o7fEdnMqvrK+gLzSXb1k1UE8ooNDDxae7vpSHkNSZal/QNDUK6sMFaLgjHmqBVDvoowdkH1CrWRqh/+1/bNXtMQcZqubeubGyQsT3lPsxTIFFFxYayrrLNzg+obuY6r5fbQfFfFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720715142; c=relaxed/simple; bh=DbIpqEXvqa8/n/NFFJXNlVHLg5JOmXnb9rdsgAolEOw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oPT926ekbvnmlnxZcf+Y+bHZpP1r4+xspJQlohE15rirN1q6DT/hWdzY+HCaFfEg1PfTMxUzglNPevgkYqCbVobKha/k43i5/graRjkJVGLFvoYrk3FI1NmxNNgJ/PHC5Rf9GoVTc+WIUXMX9N0GbVgAdUFfu+Z3IB7TpI3103A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=KfSv23b9; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KfSv23b9" 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) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com 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é