[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YSzM5S3VKOBXniRu@sirena.org.uk>
Date: Mon, 30 Aug 2021 13:19:49 +0100
From: Mark Brown <broonie@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Vladimir Oltean <vladimir.oltean@....com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Lee Jones <lee.jones@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Marc Zyngier <maz@...nel.org>,
Hou Zhiqiang <Zhiqiang.Hou@....com>,
Biwen Li <biwen.li@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] regmap: teach regmap to use raw spinlocks if
requested in the config
On Fri, Aug 27, 2021 at 01:01:35AM +0200, Thomas Gleixner wrote:
> On Wed, Aug 25 2021 at 23:50, Vladimir Oltean wrote:
> > It seems reasonable for regmap to have an option use a raw spinlock too,
> > so add that in the config such that drivers can request it.
> What's reasonable about that?
> What exactly prevents the regmap locking to use a raw spinlock
> unconditionally?
We definitely can't use a raw spinlock unconditionally since we
support register maps on devices connected via buses which can't
be accessed atomically so we need the option of doing mutexes.
> Even for the case where the regmap is not dealing with irq chips it does
> not make any sense to protect low level operations on shared register
> with a regular spinlock. I might be missing something though...
That probably does make sense, I think we're just using regular
spinlocks for spinlocks mainly because they're the default rather
than because anyone put huge amounts of thought into it. IIRC
the first users were using spinlocks for their locking when they
were converted.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists