public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] hwspinlock: refactor headers into public provider/consumer pair
@ 2026-01-25 18:46 Wolfram Sang
  2026-01-25 18:46 ` [RFC PATCH 1/4] hwspinlock: refactor existing headers into provider.h Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Wolfram Sang @ 2026-01-25 18:46 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Alexandre Torgue, Andy Shevchenko, Antonio Borneo,
	Arnd Bergmann, Baolin Wang, Bjorn Andersson, Boqun Feng,
	Chen-Yu Tsai, Chunyan Zhang, Danilo Krummrich, David Lechner,
	Greg Kroah-Hartman, Ingo Molnar, Jernej Skrabec, Jonathan Cameron,
	Jonathan Corbet, Konrad Dybcio, Lee Jones, Linus Walleij,
	linux-arm-kernel, linux-arm-msm, linux-doc, linux-gpio, linux-iio,
	linux-omap, linux-remoteproc, linux-spi, linux-stm32, linux-sunxi,
	Mark Brown, Maxime Coquelin, Nuno Sá, Orson Zhai,
	Peter Zijlstra, Rafael J. Wysocki, Samuel Holland, Shuah Khan,
	Srinivas Kandagatla, Thomas Gleixner, Waiman Long,
	Wilken Gottwalt, Will Deacon

TLDR: I want to create a hwspinlock provider outside of the hwspinlock
directory. So, I refactored the headers into a provider/consumer pair.
Which seems to me like a reasonable seperation anyhow. No functional
changes. My build tests went fine and buildbots are happy, too.

Longer explanation:

There is a device (MFIS) in newer Renesas SoCs which combines various
things like hwspinlocks, mailboxes and other stuff. Sadly, these are not
strictly separated. Registers are kind of mixed and its register
unprotection scheme will need one of its own locks. I tried various
paths to handle this device (MFD, auxiliary bus) but I concluded that
the sub-device dependencies give enough reasons for a single driver in
drivers/soc/. So, this series will allow me to instantiate a hwspinlock
provider from the other directory.

Patches 1+2 do the actual refactoring with a fallback being in place. I
used '-B' with git-format-patch in this RFC, so the actual changes are
more visible when the headers are moved.

Patch 3 converts all the users. There are not many. We could try to get
all the acks for this single patch. Or I can break it into single
patches and send them to subsystems. I don't mind.

Patch 4 simply removes the fallback.

Looking forward to comments on this approach. If the hwspinlock
maintainers like it as is, I would kindly propose to apply patches 1+2
after 7.0-rc1 comes out. This might sound a bit hasty, but a) I want to
avoid chasing a moving target and b) this would remove one dependency of
the hwspinlock driver I originally intend to upstream, of course.

I would take care of patches 3+4 as needed.

A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/hwspinlock/refactor-includes

Patches are based on linux-next as of 2026-01-21.

Opinions?

Thanks and happy hacking,

   Wolfram


Wolfram Sang (4):
  hwspinlock: refactor existing headers into provider.h
  hwspinlock: refactor existing headers into consumer.h
  treewide: convert hwspinlock users to the new consumer header file
  hwspinlock: remove old header file

 Documentation/locking/hwspinlock.rst          |  2 +-
 MAINTAINERS                                   |  2 +-
 drivers/base/regmap/regmap.c                  |  2 +-
 drivers/hwspinlock/hwspinlock_core.c          |  5 +--
 drivers/hwspinlock/omap_hwspinlock.c          |  4 +-
 drivers/hwspinlock/qcom_hwspinlock.c          |  4 +-
 drivers/hwspinlock/sprd_hwspinlock.c          |  4 +-
 drivers/hwspinlock/stm32_hwspinlock.c         |  4 +-
 drivers/hwspinlock/sun6i_hwspinlock.c         |  4 +-
 drivers/hwspinlock/u8500_hsem.c               |  5 +--
 drivers/iio/adc/sc27xx_adc.c                  |  2 +-
 drivers/irqchip/irq-stm32mp-exti.c            |  2 +-
 drivers/mfd/syscon.c                          |  2 +-
 drivers/nvmem/sc27xx-efuse.c                  |  2 +-
 drivers/nvmem/sprd-efuse.c                    |  2 +-
 drivers/pinctrl/stm32/pinctrl-stm32.c         |  2 +-
 drivers/soc/qcom/smem.c                       |  2 +-
 drivers/spi/spi-sprd-adi.c                    |  2 +-
 .../{hwspinlock.h => hwspinlock/consumer.h}   | 22 ++--------
 .../linux/hwspinlock/provider.h               | 40 ++++++++++++-------
 20 files changed, 49 insertions(+), 65 deletions(-)
 rename include/linux/{hwspinlock.h => hwspinlock/consumer.h} (94%)
 rename drivers/hwspinlock/hwspinlock_internal.h => include/linux/hwspinlock/provider.h (78%)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-02-10 15:14 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-25 18:46 [RFC PATCH 0/4] hwspinlock: refactor headers into public provider/consumer pair Wolfram Sang
2026-01-25 18:46 ` [RFC PATCH 1/4] hwspinlock: refactor existing headers into provider.h Wolfram Sang
2026-01-25 18:46 ` [RFC PATCH 2/4] hwspinlock: refactor existing headers into consumer.h Wolfram Sang
2026-01-25 18:46 ` [RFC PATCH 3/4] treewide: convert hwspinlock users to the new consumer header file Wolfram Sang
2026-01-26  9:54   ` Andy Shevchenko
2026-01-26 11:36   ` Mark Brown
2026-01-26  9:59 ` [RFC PATCH 0/4] hwspinlock: refactor headers into public provider/consumer pair Andy Shevchenko
2026-01-26 10:13   ` Wolfram Sang
2026-01-26 10:20     ` Andy Shevchenko
2026-01-26 10:29       ` Wolfram Sang
2026-01-27 11:41         ` Wolfram Sang
2026-02-09 11:14           ` Wolfram Sang
2026-02-09 11:35             ` Andy Shevchenko
2026-02-09 16:13             ` Bjorn Andersson
2026-02-09 19:51               ` Wolfram Sang
2026-02-09 21:37                 ` Bjorn Andersson
2026-02-10  7:20                 ` Andy Shevchenko
2026-02-10 10:44                   ` Wolfram Sang
2026-02-10 15:14                     ` Andy Shevchenko
2026-01-26 10:14   ` Wilken Gottwalt
2026-01-26 10:16     ` Wolfram Sang
2026-01-26 10:22     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox