Thread (22 messages) 22 messages, 7 authors, 2024-07-23

Re: [PATCH v3 1/7] mfd: syscon: Add reference counting and device managed support

From: Lee Jones <lee@kernel.org>
Date: 2024-07-11 17:09:19
Also in: linux-arm-kernel, linux-devicetree, linux-pci, lkml

On Thu, 11 Jul 2024, Herve Codina wrote:
Hi Markus,

On Thu, 11 Jul 2024 18:09:26 +0200
Markus Elfring [off-list ref] wrote:
quoted
quoted
+++ b/drivers/mfd/syscon.c  
quoted
+static struct syscon *syscon_from_regmap(struct regmap *regmap)  
+{
quoted
+	struct syscon *entry, *syscon = NULL;
+
+	spin_lock(&syscon_list_slock);
+
+	list_for_each_entry(entry, &syscon_list, list)  
quoted
+	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 [李琼斯]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help