* [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes
@ 2026-02-15 22:54 Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 01/13] hwspinlock: add helpers to retrieve core data Wolfram Sang
` (13 more replies)
0 siblings, 14 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, 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, driver-core, Greg Kroah-Hartman,
Ingo Molnar, Jernej Skrabec, Jonathan Cameron, Jonathan Corbet,
Konrad Dybcio, Lee Jones, Linus Walleij, 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
My ultimate goal is to allow hwspinlock provider drivers outside of the
subsystem directory. It turned out that a simple split of the headers
files into a public provider and a public consumer header file is not
enough because core internal structure need to stay hidden. Even more,
their opaqueness could and should even be increased. That would also
allow the core to handle the de-/allocation of the hwspinlock device
itself.
This series does all that. Patches 1-7 abstract access to internal
structures away using helpers. Patch 8 then move hwspinlock device
handling to the core, simplifying drivers. The remaining patches
refactor the headers until the internal one is gone and the public ones
are divided into provider and consumer parts. More details are given in
the patch descriptions.
One note about using a callback to initialize hwspinlock priv: I also
experimented with a dedicated 'set_priv' helper function. It felt a bit
clumsy to me. Drivers would need to save the 'bank' pointer again and
iterate over it. Because most drivers will only have a simple callback
anyhow, it looked leaner to me.
This series is based on the cleanup series "hwspinlock: remove
platform_data from subsystem" and has been tested on a Renesas
SparrowHawk board (R-Car V4H) with a yet-to-be-upstreamed hwspinlock
driver for the MFIS IP core. A branch can be found here (the MFIS driver
is still WIP):
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/hwspinlock/refactor-alloc-buildtest
Buildbots seem to be happy, too.
Looking forward to comments. I especially wonder if the last patch
should stay as-is or if it should be broken out, so individual
subsystems can pick up their part (with a fallback in place, of course,
until the last user is converted).
Happy hacking,
Wolfram
Wolfram Sang (13):
hwspinlock: add helpers to retrieve core data
hwspinlock: add callback to fill private data of a hwspinlock
hwspinlock: omap: use new callback to initialize hwspinlock priv
hwspinlock: qcom: use new callback to initialize hwspinlock priv
hwspinlock: sprd: use new callback to initialize hwspinlock priv
hwspinlock: stm32: use new callback to initialize hwspinlock priv
hwspinlock: sun6i: use new callback to initialize hwspinlock priv
hwspinlock: handle hwspinlock device allocation in the core
hwspinlock: move entries from internal to public header
hwspinlock: remove internal header
hwspinlock: sort include and update copyright
hwspinlock: refactor provider.h from public header
hwspinlock: refactor consumer.h from public header
Documentation/locking/hwspinlock.rst | 2 +-
MAINTAINERS | 2 +-
drivers/base/regmap/regmap.c | 2 +-
drivers/hwspinlock/hwspinlock_core.c | 129 +++++++++++++-----
drivers/hwspinlock/hwspinlock_internal.h | 72 ----------
drivers/hwspinlock/omap_hwspinlock.c | 29 ++--
drivers/hwspinlock/qcom_hwspinlock.c | 69 +++++-----
drivers/hwspinlock/sprd_hwspinlock.c | 41 +++---
drivers/hwspinlock/stm32_hwspinlock.c | 28 ++--
drivers/hwspinlock/sun6i_hwspinlock.c | 38 ++----
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} | 29 +---
include/linux/hwspinlock/provider.h | 60 ++++++++
20 files changed, 268 insertions(+), 249 deletions(-)
delete mode 100644 drivers/hwspinlock/hwspinlock_internal.h
rename include/linux/{hwspinlock.h => hwspinlock/consumer.h} (93%)
create mode 100644 include/linux/hwspinlock/provider.h
--
2.51.0
^ permalink raw reply [flat|nested] 25+ messages in thread
* [RFC PATCH v2 01/13] hwspinlock: add helpers to retrieve core data
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock Wolfram Sang
` (12 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Orson Zhai, Chunyan Zhang, Maxime Coquelin,
Alexandre Torgue, Wilken Gottwalt, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-remoteproc, linux-omap, linux-arm-msm,
linux-stm32, linux-sunxi
This is a first step to hide internal core structs from hwspinlock
providers. It adds helper functions to retrieve the data needed by them.
Because all users are only within the hwspinlock subsystem and the
change there is trivial, conversion is included in this patch as well.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/hwspinlock_core.c | 12 ++++++++++++
drivers/hwspinlock/omap_hwspinlock.c | 4 ++--
drivers/hwspinlock/qcom_hwspinlock.c | 11 ++++++-----
drivers/hwspinlock/sprd_hwspinlock.c | 6 +++---
drivers/hwspinlock/stm32_hwspinlock.c | 4 ++--
drivers/hwspinlock/sun6i_hwspinlock.c | 4 ++--
include/linux/hwspinlock.h | 2 ++
7 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index cc8e952a6772..2c9eceba7fe8 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -888,5 +888,17 @@ struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
}
EXPORT_SYMBOL_GPL(devm_hwspin_lock_request_specific);
+void *hwspin_lock_get_priv(struct hwspinlock *hwlock)
+{
+ return hwlock->priv;
+}
+EXPORT_SYMBOL_GPL(hwspin_lock_get_priv);
+
+struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock)
+{
+ return hwlock->bank->dev;
+}
+EXPORT_SYMBOL_GPL(hwspin_lock_get_dev);
+
MODULE_DESCRIPTION("Hardware spinlock interface");
MODULE_AUTHOR("Ohad Ben-Cohen <ohad@wizery.com>");
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index 1832e0c3af6b..5bf0061d3fd6 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -37,7 +37,7 @@
static int omap_hwspinlock_trylock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
/* attempt to acquire the lock by reading its value */
return (SPINLOCK_NOTTAKEN == readl(lock_addr));
@@ -45,7 +45,7 @@ static int omap_hwspinlock_trylock(struct hwspinlock *lock)
static void omap_hwspinlock_unlock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
/* release the lock by writing 0 to it */
writel(SPINLOCK_NOTTAKEN, lock_addr);
diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 0390979fd765..7ff89c3e8c6b 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -27,7 +27,7 @@ struct qcom_hwspinlock_of_data {
static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
{
- struct regmap_field *field = lock->priv;
+ struct regmap_field *field = hwspin_lock_get_priv(lock);
u32 lock_owner;
int ret;
@@ -44,7 +44,7 @@ static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
{
- struct regmap_field *field = lock->priv;
+ struct regmap_field *field = hwspin_lock_get_priv(lock);
u32 lock_owner;
int ret;
@@ -66,13 +66,14 @@ static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
static int qcom_hwspinlock_bust(struct hwspinlock *lock, unsigned int id)
{
- struct regmap_field *field = lock->priv;
+ struct regmap_field *field = hwspin_lock_get_priv(lock);
+ struct device *dev = hwspin_lock_get_dev(lock);
u32 owner;
int ret;
ret = regmap_field_read(field, &owner);
if (ret) {
- dev_err(lock->bank->dev, "unable to query spinlock owner\n");
+ dev_err(dev, "unable to query spinlock owner\n");
return ret;
}
@@ -81,7 +82,7 @@ static int qcom_hwspinlock_bust(struct hwspinlock *lock, unsigned int id)
ret = regmap_field_write(field, 0);
if (ret) {
- dev_err(lock->bank->dev, "failed to bust spinlock\n");
+ dev_err(dev, "failed to bust spinlock\n");
return ret;
}
diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
index 22e2ffb91743..0d08efbdfb07 100644
--- a/drivers/hwspinlock/sprd_hwspinlock.c
+++ b/drivers/hwspinlock/sprd_hwspinlock.c
@@ -40,8 +40,8 @@ struct sprd_hwspinlock_dev {
static int sprd_hwspinlock_trylock(struct hwspinlock *lock)
{
struct sprd_hwspinlock_dev *sprd_hwlock =
- dev_get_drvdata(lock->bank->dev);
- void __iomem *addr = lock->priv;
+ dev_get_drvdata(hwspin_lock_get_dev(lock));
+ void __iomem *addr = hwspin_lock_get_priv(lock);
int user_id, lock_id;
if (!readl(addr))
@@ -59,7 +59,7 @@ static int sprd_hwspinlock_trylock(struct hwspinlock *lock)
/* unlock the hardware spinlock */
static void sprd_hwspinlock_unlock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
writel(HWSPINLOCK_NOTTAKEN, lock_addr);
}
diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index bb5c7e5f7a80..1d75dc03f4ad 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -27,7 +27,7 @@ struct stm32_hwspinlock {
static int stm32_hwspinlock_trylock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
u32 status;
writel(STM32_MUTEX_LOCK_BIT | STM32_MUTEX_COREID, lock_addr);
@@ -38,7 +38,7 @@ static int stm32_hwspinlock_trylock(struct hwspinlock *lock)
static void stm32_hwspinlock_unlock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
writel(STM32_MUTEX_COREID, lock_addr);
}
diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun6i_hwspinlock.c
index c2d314588046..8ff81cb5880a 100644
--- a/drivers/hwspinlock/sun6i_hwspinlock.c
+++ b/drivers/hwspinlock/sun6i_hwspinlock.c
@@ -62,14 +62,14 @@ static void sun6i_hwspinlock_debugfs_init(struct sun6i_hwspinlock_data *priv)
static int sun6i_hwspinlock_trylock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
return (readl(lock_addr) == SPINLOCK_NOTTAKEN);
}
static void sun6i_hwspinlock_unlock(struct hwspinlock *lock)
{
- void __iomem *lock_addr = lock->priv;
+ void __iomem *lock_addr = hwspin_lock_get_priv(lock);
writel(SPINLOCK_NOTTAKEN, lock_addr);
}
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 74b91244fe0e..dffa1dff7289 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -27,6 +27,8 @@ struct hwspinlock_ops;
#ifdef CONFIG_HWSPINLOCK
+void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
+struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
const struct hwspinlock_ops *ops, int base_id, int num_locks);
int hwspin_lock_unregister(struct hwspinlock_device *bank);
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 01/13] hwspinlock: add helpers to retrieve core data Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-16 8:05 ` Sergey Shtylyov
2026-02-15 22:54 ` [RFC PATCH v2 03/13] hwspinlock: omap: use new callback to initialize hwspinlock priv Wolfram Sang
` (11 subsequent siblings)
13 siblings, 1 reply; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, linux-remoteproc
To hide internal core structures from providers, a callback is added to
the ops which allows to set the 'priv' field of a hwspinlock. It is
called when a hwspinlock device is registered and, thus, iterated over
all locks. The register-functions are also extended to pass a data
pointer to this callback, so it can do necessary calculations for the
priv field of each hwspinlock. Providers are converted separately
because these changes need dedicated reviews.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/hwspinlock_core.c | 19 +++++++++++++++----
drivers/hwspinlock/hwspinlock_internal.h | 19 +++++++++++--------
include/linux/hwspinlock.h | 4 ++--
3 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index 2c9eceba7fe8..afe1e7ce2829 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -507,6 +507,7 @@ static struct hwspinlock *hwspin_lock_unregister_single(unsigned int id)
* @ops: hwspinlock handlers for this device
* @base_id: id of the first hardware spinlock in this bank
* @num_locks: number of hwspinlocks provided by this device
+ * @init_data: additional data passed on to the init_priv callback
*
* This function should be called from the underlying platform-specific
* implementation, to register a new hwspinlock device instance.
@@ -516,10 +517,11 @@ static struct hwspinlock *hwspin_lock_unregister_single(unsigned int id)
* Returns: %0 on success, or an appropriate error code on failure
*/
int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
- const struct hwspinlock_ops *ops, int base_id, int num_locks)
+ const struct hwspinlock_ops *ops, int base_id, int num_locks,
+ void *init_data)
{
struct hwspinlock *hwlock;
- int ret = 0, i;
+ int ret, i;
if (!bank || !ops || !dev || !num_locks || !ops->trylock ||
!ops->unlock) {
@@ -538,6 +540,14 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
spin_lock_init(&hwlock->lock);
hwlock->bank = bank;
+ if (ops->init_priv) {
+ hwlock->priv = ops->init_priv(i, init_data);
+ if (IS_ERR(hwlock->priv)) {
+ ret = PTR_ERR(hwlock->priv);
+ goto reg_failed;
+ }
+ }
+
ret = hwspin_lock_register_single(hwlock, base_id + i);
if (ret)
goto reg_failed;
@@ -633,6 +643,7 @@ EXPORT_SYMBOL_GPL(devm_hwspin_lock_unregister);
* @ops: hwspinlock handlers for this device
* @base_id: id of the first hardware spinlock in this bank
* @num_locks: number of hwspinlocks provided by this device
+ * @init_data: additional data passed on to the init_priv callback
*
* This function should be called from the underlying platform-specific
* implementation, to register a new hwspinlock device instance.
@@ -644,7 +655,7 @@ EXPORT_SYMBOL_GPL(devm_hwspin_lock_unregister);
int devm_hwspin_lock_register(struct device *dev,
struct hwspinlock_device *bank,
const struct hwspinlock_ops *ops,
- int base_id, int num_locks)
+ int base_id, int num_locks, void *init_data)
{
struct hwspinlock_device **ptr;
int ret;
@@ -653,7 +664,7 @@ int devm_hwspin_lock_register(struct device *dev,
if (!ptr)
return -ENOMEM;
- ret = hwspin_lock_register(bank, dev, ops, base_id, num_locks);
+ ret = hwspin_lock_register(bank, dev, ops, base_id, num_locks, init_data);
if (!ret) {
*ptr = bank;
devres_add(dev, ptr);
diff --git a/drivers/hwspinlock/hwspinlock_internal.h b/drivers/hwspinlock/hwspinlock_internal.h
index f298fc0ee5ad..3c835d96bf86 100644
--- a/drivers/hwspinlock/hwspinlock_internal.h
+++ b/drivers/hwspinlock/hwspinlock_internal.h
@@ -18,20 +18,23 @@ struct hwspinlock_device;
/**
* struct hwspinlock_ops - platform-specific hwspinlock handlers
*
- * @trylock: make a single attempt to take the lock. returns 0 on
- * failure and true on success. may _not_ sleep.
- * @unlock: release the lock. always succeed. may _not_ sleep.
- * @bust: optional, platform-specific bust handler, called by hwspinlock
- * core to bust a specific lock.
- * @relax: optional, platform-specific relax handler, called by hwspinlock
- * core while spinning on a lock, between two successive
- * invocations of @trylock. may _not_ sleep.
+ * @trylock: make a single attempt to take the lock. returns 0 on
+ * failure and true on success. may _not_ sleep.
+ * @unlock: release the lock. always succeed. may _not_ sleep.
+ * @bust: optional, platform-specific bust handler, called by hwspinlock
+ * core to bust a specific lock.
+ * @relax: optional, platform-specific relax handler, called by hwspinlock
+ * core while spinning on a lock, between two successive
+ * invocations of @trylock. may _not_ sleep.
+ * @init_priv: optional, callback used when registering the hwspinlock device.
+ * Its return value will be used to fill the per-lock 'priv' data.
*/
struct hwspinlock_ops {
int (*trylock)(struct hwspinlock *lock);
void (*unlock)(struct hwspinlock *lock);
int (*bust)(struct hwspinlock *lock, unsigned int id);
void (*relax)(struct hwspinlock *lock);
+ void *(*init_priv)(int local_id, void *init_data);
};
/**
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index dffa1dff7289..094a6d0d39d6 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -30,7 +30,7 @@ struct hwspinlock_ops;
void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
- const struct hwspinlock_ops *ops, int base_id, int num_locks);
+ const struct hwspinlock_ops *ops, int base_id, int num_locks, void *init_data);
int hwspin_lock_unregister(struct hwspinlock_device *bank);
struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
int hwspin_lock_free(struct hwspinlock *hwlock);
@@ -49,7 +49,7 @@ int devm_hwspin_lock_unregister(struct device *dev,
int devm_hwspin_lock_register(struct device *dev,
struct hwspinlock_device *bank,
const struct hwspinlock_ops *ops,
- int base_id, int num_locks);
+ int base_id, int num_locks, void *init_data);
#else /* !CONFIG_HWSPINLOCK */
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 03/13] hwspinlock: omap: use new callback to initialize hwspinlock priv
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 01/13] hwspinlock: add helpers to retrieve core data Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 04/13] hwspinlock: qcom: " Wolfram Sang
` (10 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, linux-omap, linux-remoteproc
Apply the new helper to avoid using internal structures from the core.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/omap_hwspinlock.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index 5bf0061d3fd6..9a9cb3692348 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -66,10 +66,18 @@ static void omap_hwspinlock_relax(struct hwspinlock *lock)
ndelay(50);
}
+static void *omap_hwspinlock_init_priv(int local_id, void *init_data)
+{
+ void __iomem *io_base_ofs = init_data;
+
+ return io_base_ofs + sizeof(u32) * local_id;
+}
+
static const struct hwspinlock_ops omap_hwspinlock_ops = {
.trylock = omap_hwspinlock_trylock,
.unlock = omap_hwspinlock_unlock,
.relax = omap_hwspinlock_relax,
+ .init_priv = omap_hwspinlock_init_priv,
};
static int omap_hwspinlock_probe(struct platform_device *pdev)
@@ -116,11 +124,8 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
if (!bank)
return -ENOMEM;
- for (i = 0; i < num_locks; i++)
- bank->lock[i].priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;
-
return devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops,
- base_id, num_locks);
+ base_id, num_locks, io_base + LOCK_BASE_OFFSET);
}
static const struct of_device_id omap_hwspinlock_of_match[] = {
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 04/13] hwspinlock: qcom: use new callback to initialize hwspinlock priv
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (2 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 03/13] hwspinlock: omap: use new callback to initialize hwspinlock priv Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 05/13] hwspinlock: sprd: " Wolfram Sang
` (9 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, linux-arm-msm, linux-remoteproc
Apply the new helper to avoid using internal structures from the core.
Remove superfluous setting of drvdata while here.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/qcom_hwspinlock.c | 45 ++++++++++++++++------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 7ff89c3e8c6b..73b280988109 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -25,6 +25,13 @@ struct qcom_hwspinlock_of_data {
const struct regmap_config *regmap_config;
};
+struct qcom_hwspinlock_priv_init_data {
+ struct device *dev;
+ struct regmap *regmap;
+ u32 base;
+ u32 stride;
+};
+
static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
{
struct regmap_field *field = hwspin_lock_get_priv(lock);
@@ -89,10 +96,23 @@ static int qcom_hwspinlock_bust(struct hwspinlock *lock, unsigned int id)
return 0;
}
+static void *qcom_hwspinlock_init_priv(int local_id, void *init_data)
+{
+ struct qcom_hwspinlock_priv_init_data *init = init_data;
+ struct reg_field field;
+
+ field.reg = init->base + local_id * init->stride;
+ field.lsb = 0;
+ field.msb = 31;
+
+ return devm_regmap_field_alloc(init->dev, init->regmap, field);
+}
+
static const struct hwspinlock_ops qcom_hwspinlock_ops = {
.trylock = qcom_hwspinlock_trylock,
.unlock = qcom_hwspinlock_unlock,
.bust = qcom_hwspinlock_bust,
+ .init_priv = qcom_hwspinlock_init_priv,
};
static const struct regmap_config sfpb_mutex_config = {
@@ -202,17 +222,14 @@ static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev,
static int qcom_hwspinlock_probe(struct platform_device *pdev)
{
+ struct qcom_hwspinlock_priv_init_data init;
struct hwspinlock_device *bank;
- struct reg_field field;
struct regmap *regmap;
size_t array_size;
- u32 stride;
- u32 base;
- int i;
- regmap = qcom_hwspinlock_probe_syscon(pdev, &base, &stride);
+ regmap = qcom_hwspinlock_probe_syscon(pdev, &init.base, &init.stride);
if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV)
- regmap = qcom_hwspinlock_probe_mmio(pdev, &base, &stride);
+ regmap = qcom_hwspinlock_probe_mmio(pdev, &init.base, &init.stride);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
@@ -222,21 +239,11 @@ static int qcom_hwspinlock_probe(struct platform_device *pdev)
if (!bank)
return -ENOMEM;
- platform_set_drvdata(pdev, bank);
-
- for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
- field.reg = base + i * stride;
- field.lsb = 0;
- field.msb = 31;
-
- bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
- regmap, field);
- if (IS_ERR(bank->lock[i].priv))
- return PTR_ERR(bank->lock[i].priv);
- }
+ init.dev = &pdev->dev;
+ init.regmap = regmap;
return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops,
- 0, QCOM_MUTEX_NUM_LOCKS);
+ 0, QCOM_MUTEX_NUM_LOCKS, &init);
}
static struct platform_driver qcom_hwspinlock_driver = {
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 05/13] hwspinlock: sprd: use new callback to initialize hwspinlock priv
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (3 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 04/13] hwspinlock: qcom: " Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 06/13] hwspinlock: stm32: " Wolfram Sang
` (8 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Orson Zhai, Chunyan Zhang, linux-remoteproc
Apply the new helper to avoid using internal structures from the core.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/sprd_hwspinlock.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
index 0d08efbdfb07..c19b680d5fdf 100644
--- a/drivers/hwspinlock/sprd_hwspinlock.c
+++ b/drivers/hwspinlock/sprd_hwspinlock.c
@@ -70,10 +70,18 @@ static void sprd_hwspinlock_relax(struct hwspinlock *lock)
ndelay(10);
}
+static void *sprd_hwspinlock_init_priv(int local_id, void *init_data)
+{
+ void __iomem *base = init_data;
+
+ return base + HWSPINLOCK_TOKEN(local_id);
+}
+
static const struct hwspinlock_ops sprd_hwspinlock_ops = {
.trylock = sprd_hwspinlock_trylock,
.unlock = sprd_hwspinlock_unlock,
.relax = sprd_hwspinlock_relax,
+ .init_priv = sprd_hwspinlock_init_priv,
};
static void sprd_hwspinlock_disable(void *data)
@@ -86,8 +94,7 @@ static void sprd_hwspinlock_disable(void *data)
static int sprd_hwspinlock_probe(struct platform_device *pdev)
{
struct sprd_hwspinlock_dev *sprd_hwlock;
- struct hwspinlock *lock;
- int i, ret;
+ int ret;
if (!pdev->dev.of_node)
return -ENODEV;
@@ -123,16 +130,11 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
/* set the hwspinlock to record user id to identify subsystems */
writel(HWSPINLOCK_USER_BITS, sprd_hwlock->base + HWSPINLOCK_RECCTRL);
- for (i = 0; i < SPRD_HWLOCKS_NUM; i++) {
- lock = &sprd_hwlock->bank.lock[i];
- lock->priv = sprd_hwlock->base + HWSPINLOCK_TOKEN(i);
- }
-
platform_set_drvdata(pdev, sprd_hwlock);
return devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank,
&sprd_hwspinlock_ops, 0,
- SPRD_HWLOCKS_NUM);
+ SPRD_HWLOCKS_NUM, sprd_hwlock->base);
}
static const struct of_device_id sprd_hwspinlock_of_match[] = {
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 06/13] hwspinlock: stm32: use new callback to initialize hwspinlock priv
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (4 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 05/13] hwspinlock: sprd: " Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 07/13] hwspinlock: sun6i: " Wolfram Sang
` (7 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Maxime Coquelin, Alexandre Torgue, linux-remoteproc,
linux-stm32
Apply the new helper to avoid using internal structures from the core.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/stm32_hwspinlock.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index 1d75dc03f4ad..02db950c9450 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -48,10 +48,18 @@ static void stm32_hwspinlock_relax(struct hwspinlock *lock)
ndelay(50);
}
+static void *stm32_hwspinlock_init_priv(int local_id, void *init_data)
+{
+ void __iomem *io_base = init_data;
+
+ return io_base + local_id * sizeof(u32);
+}
+
static const struct hwspinlock_ops stm32_hwspinlock_ops = {
.trylock = stm32_hwspinlock_trylock,
.unlock = stm32_hwspinlock_unlock,
.relax = stm32_hwspinlock_relax,
+ .init_priv = stm32_hwspinlock_init_priv,
};
static void stm32_hwspinlock_disable_clk(void *data)
@@ -73,7 +81,7 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct stm32_hwspinlock *hw;
void __iomem *io_base;
- int i, ret;
+ int ret;
io_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(io_base))
@@ -106,11 +114,8 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
return ret;
}
- for (i = 0; i < STM32_MUTEX_NUM_LOCKS; i++)
- hw->bank.lock[i].priv = io_base + i * sizeof(u32);
-
ret = devm_hwspin_lock_register(dev, &hw->bank, &stm32_hwspinlock_ops,
- 0, STM32_MUTEX_NUM_LOCKS);
+ 0, STM32_MUTEX_NUM_LOCKS, io_base);
if (ret)
dev_err(dev, "Failed to register hwspinlock\n");
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 07/13] hwspinlock: sun6i: use new callback to initialize hwspinlock priv
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (5 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 06/13] hwspinlock: stm32: " Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 08/13] hwspinlock: handle hwspinlock device allocation in the core Wolfram Sang
` (6 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Wilken Gottwalt,
Bjorn Andersson, Baolin Wang, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-remoteproc, linux-sunxi
Apply the new helper to avoid using internal structures from the core.
Remove superfluous setting of drvdata while here.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/sun6i_hwspinlock.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun6i_hwspinlock.c
index 8ff81cb5880a..7d0c639c0e82 100644
--- a/drivers/hwspinlock/sun6i_hwspinlock.c
+++ b/drivers/hwspinlock/sun6i_hwspinlock.c
@@ -74,9 +74,17 @@ static void sun6i_hwspinlock_unlock(struct hwspinlock *lock)
writel(SPINLOCK_NOTTAKEN, lock_addr);
}
+static void *sun6i_hwspinlock_init_priv(int local_id, void *init_data)
+{
+ void __iomem *io_base_ofs = init_data;
+
+ return io_base_ofs + sizeof(u32) * local_id;
+}
+
static const struct hwspinlock_ops sun6i_hwspinlock_ops = {
.trylock = sun6i_hwspinlock_trylock,
.unlock = sun6i_hwspinlock_unlock,
+ .init_priv = sun6i_hwspinlock_init_priv,
};
static void sun6i_hwspinlock_disable(void *data)
@@ -91,10 +99,9 @@ static void sun6i_hwspinlock_disable(void *data)
static int sun6i_hwspinlock_probe(struct platform_device *pdev)
{
struct sun6i_hwspinlock_data *priv;
- struct hwspinlock *hwlock;
void __iomem *io_base;
u32 num_banks;
- int err, i;
+ int err;
io_base = devm_platform_ioremap_resource(pdev, SPINLOCK_BASE_ID);
if (IS_ERR(io_base))
@@ -161,11 +168,6 @@ static int sun6i_hwspinlock_probe(struct platform_device *pdev)
goto bank_fail;
}
- for (i = 0; i < priv->nlocks; ++i) {
- hwlock = &priv->bank->lock[i];
- hwlock->priv = io_base + SPINLOCK_LOCK_REGN + sizeof(u32) * i;
- }
-
/* failure of debugfs is considered non-fatal */
sun6i_hwspinlock_debugfs_init(priv);
if (IS_ERR(priv->debugfs))
@@ -177,10 +179,8 @@ static int sun6i_hwspinlock_probe(struct platform_device *pdev)
goto bank_fail;
}
- platform_set_drvdata(pdev, priv);
-
return devm_hwspin_lock_register(&pdev->dev, priv->bank, &sun6i_hwspinlock_ops,
- SPINLOCK_BASE_ID, priv->nlocks);
+ SPINLOCK_BASE_ID, priv->nlocks, io_base + SPINLOCK_LOCK_REGN);
bank_fail:
clk_disable_unprepare(priv->ahb_clk);
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 08/13] hwspinlock: handle hwspinlock device allocation in the core
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (6 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 07/13] hwspinlock: sun6i: " Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 09/13] hwspinlock: move entries from internal to public header Wolfram Sang
` (5 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Orson Zhai, Chunyan Zhang, Maxime Coquelin,
Alexandre Torgue, Wilken Gottwalt, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-remoteproc, linux-omap, linux-arm-msm,
linux-stm32, linux-sunxi
Providers have been refactored to avoid using core internal structures.
As a result, they do not need to allocate the hwspinlock device on their
own anymore because they can access everything they need with helpers.
So, the allocation is moved to the core. As a result, the registering
functions now return a pointer to the (soon) opaque hwspinlock device
which may be needed for unregistering only.
Because the argument list of the registering functions is changed, all
users are changed here as well.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/hwspinlock_core.c | 48 +++++++++++++++------------
drivers/hwspinlock/omap_hwspinlock.c | 10 ++----
drivers/hwspinlock/qcom_hwspinlock.c | 11 ++----
drivers/hwspinlock/sprd_hwspinlock.c | 17 ++++------
drivers/hwspinlock/stm32_hwspinlock.c | 7 ++--
drivers/hwspinlock/sun6i_hwspinlock.c | 12 ++-----
include/linux/hwspinlock.h | 17 ++++++----
7 files changed, 52 insertions(+), 70 deletions(-)
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index afe1e7ce2829..a7610ba755b4 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -21,6 +21,7 @@
#include <linux/pm_runtime.h>
#include <linux/mutex.h>
#include <linux/of.h>
+#include <linux/slab.h>
#include "hwspinlock_internal.h"
@@ -502,7 +503,6 @@ static struct hwspinlock *hwspin_lock_unregister_single(unsigned int id)
/**
* hwspin_lock_register() - register a new hw spinlock device
- * @bank: the hwspinlock device, which usually provides numerous hw locks
* @dev: the backing device
* @ops: hwspinlock handlers for this device
* @base_id: id of the first hardware spinlock in this bank
@@ -514,21 +514,25 @@ static struct hwspinlock *hwspin_lock_unregister_single(unsigned int id)
*
* Should be called from a process context (might sleep)
*
- * Returns: %0 on success, or an appropriate error code on failure
+ * Returns: a pointer to the device (needed for unregistering), or an
+ * appropriate error pointer on failure
*/
-int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
- const struct hwspinlock_ops *ops, int base_id, int num_locks,
- void *init_data)
+struct hwspinlock_device *hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data)
{
+ struct hwspinlock_device *bank;
struct hwspinlock *hwlock;
int ret, i;
- if (!bank || !ops || !dev || !num_locks || !ops->trylock ||
- !ops->unlock) {
+ if (!ops || !dev || !num_locks || !ops->trylock || !ops->unlock) {
pr_err("invalid parameters\n");
- return -EINVAL;
+ return ERR_PTR(-EINVAL);
}
+ bank = kzalloc(struct_size(bank, lock, num_locks), GFP_KERNEL);
+ if (!bank)
+ return ERR_PTR(-ENOMEM);
+
bank->dev = dev;
bank->ops = ops;
bank->base_id = base_id;
@@ -553,12 +557,13 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
goto reg_failed;
}
- return 0;
+ return bank;
reg_failed:
while (--i >= 0)
hwspin_lock_unregister_single(base_id + i);
- return ret;
+ kfree(bank);
+ return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(hwspin_lock_register);
@@ -589,6 +594,8 @@ int hwspin_lock_unregister(struct hwspinlock_device *bank)
WARN_ON(tmp != hwlock);
}
+ kfree(bank);
+
return 0;
}
EXPORT_SYMBOL_GPL(hwspin_lock_unregister);
@@ -639,7 +646,6 @@ EXPORT_SYMBOL_GPL(devm_hwspin_lock_unregister);
* devm_hwspin_lock_register() - register a new hw spinlock device for
* a managed device
* @dev: the backing device
- * @bank: the hwspinlock device, which usually provides numerous hw locks
* @ops: hwspinlock handlers for this device
* @base_id: id of the first hardware spinlock in this bank
* @num_locks: number of hwspinlocks provided by this device
@@ -650,29 +656,27 @@ EXPORT_SYMBOL_GPL(devm_hwspin_lock_unregister);
*
* Should be called from a process context (might sleep)
*
- * Returns: %0 on success, or an appropriate error code on failure
+ * Returns: a pointer to the device (usable for unregistering), or an
+ * appropriate error pointer on failure
*/
-int devm_hwspin_lock_register(struct device *dev,
- struct hwspinlock_device *bank,
- const struct hwspinlock_ops *ops,
- int base_id, int num_locks, void *init_data)
+struct hwspinlock_device *devm_hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data)
{
- struct hwspinlock_device **ptr;
- int ret;
+ struct hwspinlock_device **ptr, *bank;
ptr = devres_alloc(devm_hwspin_lock_unreg, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
- ret = hwspin_lock_register(bank, dev, ops, base_id, num_locks, init_data);
- if (!ret) {
+ bank = hwspin_lock_register(dev, ops, base_id, num_locks, init_data);
+ if (!IS_ERR(bank)) {
*ptr = bank;
devres_add(dev, ptr);
} else {
devres_free(ptr);
}
- return ret;
+ return bank;
}
EXPORT_SYMBOL_GPL(devm_hwspin_lock_register);
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index 9a9cb3692348..f1ff6406db46 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -82,7 +82,6 @@ static const struct hwspinlock_ops omap_hwspinlock_ops = {
static int omap_hwspinlock_probe(struct platform_device *pdev)
{
- struct hwspinlock_device *bank;
void __iomem *io_base;
int num_locks, i, ret;
/* Only a single hwspinlock block device is supported */
@@ -119,13 +118,8 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
num_locks = i * 32; /* actual number of locks in this device */
- bank = devm_kzalloc(&pdev->dev, struct_size(bank, lock, num_locks),
- GFP_KERNEL);
- if (!bank)
- return -ENOMEM;
-
- return devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops,
- base_id, num_locks, io_base + LOCK_BASE_OFFSET);
+ return devm_hwspin_lock_register_errno(&pdev->dev, &omap_hwspinlock_ops, base_id,
+ num_locks, io_base + LOCK_BASE_OFFSET);
}
static const struct of_device_id omap_hwspinlock_of_match[] = {
diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 73b280988109..e2836d6728e8 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -223,9 +223,7 @@ static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev,
static int qcom_hwspinlock_probe(struct platform_device *pdev)
{
struct qcom_hwspinlock_priv_init_data init;
- struct hwspinlock_device *bank;
struct regmap *regmap;
- size_t array_size;
regmap = qcom_hwspinlock_probe_syscon(pdev, &init.base, &init.stride);
if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV)
@@ -234,16 +232,11 @@ static int qcom_hwspinlock_probe(struct platform_device *pdev)
if (IS_ERR(regmap))
return PTR_ERR(regmap);
- array_size = QCOM_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
- bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL);
- if (!bank)
- return -ENOMEM;
-
init.dev = &pdev->dev;
init.regmap = regmap;
- return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops,
- 0, QCOM_MUTEX_NUM_LOCKS, &init);
+ return devm_hwspin_lock_register_errno(&pdev->dev, &qcom_hwspinlock_ops,
+ 0, QCOM_MUTEX_NUM_LOCKS, &init);
}
static struct platform_driver qcom_hwspinlock_driver = {
diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
index c19b680d5fdf..95b254e9b6a0 100644
--- a/drivers/hwspinlock/sprd_hwspinlock.c
+++ b/drivers/hwspinlock/sprd_hwspinlock.c
@@ -33,15 +33,14 @@
struct sprd_hwspinlock_dev {
void __iomem *base;
struct clk *clk;
- struct hwspinlock_device bank;
};
/* try to lock the hardware spinlock */
static int sprd_hwspinlock_trylock(struct hwspinlock *lock)
{
- struct sprd_hwspinlock_dev *sprd_hwlock =
- dev_get_drvdata(hwspin_lock_get_dev(lock));
void __iomem *addr = hwspin_lock_get_priv(lock);
+ struct device *dev = hwspin_lock_get_dev(lock);
+ struct sprd_hwspinlock_dev *sprd_hwlock = dev_get_drvdata(dev);
int user_id, lock_id;
if (!readl(addr))
@@ -50,8 +49,7 @@ static int sprd_hwspinlock_trylock(struct hwspinlock *lock)
lock_id = hwlock_to_id(lock);
/* get the hardware spinlock master/user id */
user_id = readl(sprd_hwlock->base + HWSPINLOCK_MASTERID(lock_id));
- dev_warn(sprd_hwlock->bank.dev,
- "hwspinlock [%d] lock failed and master/user id = %d!\n",
+ dev_warn(dev, "hwspinlock [%d] lock failed and master/user id = %d!\n",
lock_id, user_id);
return 0;
}
@@ -99,9 +97,7 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
if (!pdev->dev.of_node)
return -ENODEV;
- sprd_hwlock = devm_kzalloc(&pdev->dev,
- struct_size(sprd_hwlock, bank.lock, SPRD_HWLOCKS_NUM),
- GFP_KERNEL);
+ sprd_hwlock = devm_kzalloc(&pdev->dev, sizeof(*sprd_hwlock), GFP_KERNEL);
if (!sprd_hwlock)
return -ENOMEM;
@@ -132,9 +128,8 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, sprd_hwlock);
- return devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank,
- &sprd_hwspinlock_ops, 0,
- SPRD_HWLOCKS_NUM, sprd_hwlock->base);
+ return devm_hwspin_lock_register_errno(&pdev->dev, &sprd_hwspinlock_ops, 0,
+ SPRD_HWLOCKS_NUM, sprd_hwlock->base);
}
static const struct of_device_id sprd_hwspinlock_of_match[] = {
diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index 02db950c9450..a966e967dcdb 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -22,7 +22,6 @@
struct stm32_hwspinlock {
struct clk *clk;
- struct hwspinlock_device bank;
};
static int stm32_hwspinlock_trylock(struct hwspinlock *lock)
@@ -87,7 +86,7 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
if (IS_ERR(io_base))
return PTR_ERR(io_base);
- hw = devm_kzalloc(dev, struct_size(hw, bank.lock, STM32_MUTEX_NUM_LOCKS), GFP_KERNEL);
+ hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL);
if (!hw)
return -ENOMEM;
@@ -114,8 +113,8 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
return ret;
}
- ret = devm_hwspin_lock_register(dev, &hw->bank, &stm32_hwspinlock_ops,
- 0, STM32_MUTEX_NUM_LOCKS, io_base);
+ ret = devm_hwspin_lock_register_errno(dev, &stm32_hwspinlock_ops,
+ 0, STM32_MUTEX_NUM_LOCKS, io_base);
if (ret)
dev_err(dev, "Failed to register hwspinlock\n");
diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun6i_hwspinlock.c
index 7d0c639c0e82..8e17deb503c7 100644
--- a/drivers/hwspinlock/sun6i_hwspinlock.c
+++ b/drivers/hwspinlock/sun6i_hwspinlock.c
@@ -27,7 +27,6 @@
#define SPINLOCK_NOTTAKEN 0
struct sun6i_hwspinlock_data {
- struct hwspinlock_device *bank;
struct reset_control *reset;
struct clk *ahb_clk;
struct dentry *debugfs;
@@ -161,13 +160,6 @@ static int sun6i_hwspinlock_probe(struct platform_device *pdev)
goto bank_fail;
}
- priv->bank = devm_kzalloc(&pdev->dev, struct_size(priv->bank, lock, priv->nlocks),
- GFP_KERNEL);
- if (!priv->bank) {
- err = -ENOMEM;
- goto bank_fail;
- }
-
/* failure of debugfs is considered non-fatal */
sun6i_hwspinlock_debugfs_init(priv);
if (IS_ERR(priv->debugfs))
@@ -179,8 +171,8 @@ static int sun6i_hwspinlock_probe(struct platform_device *pdev)
goto bank_fail;
}
- return devm_hwspin_lock_register(&pdev->dev, priv->bank, &sun6i_hwspinlock_ops,
- SPINLOCK_BASE_ID, priv->nlocks, io_base + SPINLOCK_LOCK_REGN);
+ return devm_hwspin_lock_register_errno(&pdev->dev, &sun6i_hwspinlock_ops, SPINLOCK_BASE_ID,
+ priv->nlocks, io_base + SPINLOCK_LOCK_REGN);
bank_fail:
clk_disable_unprepare(priv->ahb_clk);
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 094a6d0d39d6..58733cda7a9a 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -29,8 +29,8 @@ struct hwspinlock_ops;
void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
-int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
- const struct hwspinlock_ops *ops, int base_id, int num_locks, void *init_data);
+struct hwspinlock_device *hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data);
int hwspin_lock_unregister(struct hwspinlock_device *bank);
struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
int hwspin_lock_free(struct hwspinlock *hwlock);
@@ -46,10 +46,15 @@ struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
unsigned int id);
int devm_hwspin_lock_unregister(struct device *dev,
struct hwspinlock_device *bank);
-int devm_hwspin_lock_register(struct device *dev,
- struct hwspinlock_device *bank,
- const struct hwspinlock_ops *ops,
- int base_id, int num_locks, void *init_data);
+struct hwspinlock_device *devm_hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data);
+
+static inline int devm_hwspin_lock_register_errno(struct device *dev,
+ const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data)
+{
+ return PTR_ERR_OR_ZERO(devm_hwspin_lock_register(dev, ops, base_id, num_locks, init_data));
+}
#else /* !CONFIG_HWSPINLOCK */
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 09/13] hwspinlock: move entries from internal to public header
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (7 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 08/13] hwspinlock: handle hwspinlock device allocation in the core Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 10/13] hwspinlock: remove internal header Wolfram Sang
` (4 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Orson Zhai, Chunyan Zhang, Maxime Coquelin,
Alexandre Torgue, Wilken Gottwalt, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-remoteproc, linux-omap, linux-arm-msm,
linux-stm32, linux-sunxi
Providers need the ops-structure and the hwlock_to_id-function. Move
these entries to the public header. With this change, all providers are
also updated to use the public header only. The internal header is now
used by the core only.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/hwspinlock_core.c | 8 +++++++
drivers/hwspinlock/hwspinlock_internal.h | 29 ------------------------
drivers/hwspinlock/omap_hwspinlock.c | 2 --
drivers/hwspinlock/qcom_hwspinlock.c | 2 --
drivers/hwspinlock/sprd_hwspinlock.c | 2 --
drivers/hwspinlock/stm32_hwspinlock.c | 2 --
drivers/hwspinlock/sun6i_hwspinlock.c | 2 --
include/linux/hwspinlock.h | 23 +++++++++++++++++++
8 files changed, 31 insertions(+), 39 deletions(-)
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index a7610ba755b4..e0227d027cf2 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -915,5 +915,13 @@ struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock)
}
EXPORT_SYMBOL_GPL(hwspin_lock_get_dev);
+int hwlock_to_id(struct hwspinlock *hwlock)
+{
+ int local_id = hwlock - &hwlock->bank->lock[0];
+
+ return hwlock->bank->base_id + local_id;
+}
+EXPORT_SYMBOL_GPL(hwlock_to_id);
+
MODULE_DESCRIPTION("Hardware spinlock interface");
MODULE_AUTHOR("Ohad Ben-Cohen <ohad@wizery.com>");
diff --git a/drivers/hwspinlock/hwspinlock_internal.h b/drivers/hwspinlock/hwspinlock_internal.h
index 3c835d96bf86..20ae531fc389 100644
--- a/drivers/hwspinlock/hwspinlock_internal.h
+++ b/drivers/hwspinlock/hwspinlock_internal.h
@@ -15,28 +15,6 @@
struct hwspinlock_device;
-/**
- * struct hwspinlock_ops - platform-specific hwspinlock handlers
- *
- * @trylock: make a single attempt to take the lock. returns 0 on
- * failure and true on success. may _not_ sleep.
- * @unlock: release the lock. always succeed. may _not_ sleep.
- * @bust: optional, platform-specific bust handler, called by hwspinlock
- * core to bust a specific lock.
- * @relax: optional, platform-specific relax handler, called by hwspinlock
- * core while spinning on a lock, between two successive
- * invocations of @trylock. may _not_ sleep.
- * @init_priv: optional, callback used when registering the hwspinlock device.
- * Its return value will be used to fill the per-lock 'priv' data.
- */
-struct hwspinlock_ops {
- int (*trylock)(struct hwspinlock *lock);
- void (*unlock)(struct hwspinlock *lock);
- int (*bust)(struct hwspinlock *lock, unsigned int id);
- void (*relax)(struct hwspinlock *lock);
- void *(*init_priv)(int local_id, void *init_data);
-};
-
/**
* struct hwspinlock - this struct represents a single hwspinlock instance
* @bank: the hwspinlock_device structure which owns this lock
@@ -65,11 +43,4 @@ struct hwspinlock_device {
struct hwspinlock lock[];
};
-static inline int hwlock_to_id(struct hwspinlock *hwlock)
-{
- int local_id = hwlock - &hwlock->bank->lock[0];
-
- return hwlock->bank->base_id + local_id;
-}
-
#endif /* __HWSPINLOCK_HWSPINLOCK_H */
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index f1ff6406db46..96fdc35ef642 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -23,8 +23,6 @@
#include <linux/of.h>
#include <linux/platform_device.h>
-#include "hwspinlock_internal.h"
-
/* Spinlock register offsets */
#define SYSSTATUS_OFFSET 0x0014
#define LOCK_BASE_OFFSET 0x0800
diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index e2836d6728e8..22cc6f9003df 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -14,8 +14,6 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>
-#include "hwspinlock_internal.h"
-
#define QCOM_MUTEX_APPS_PROC_ID 1
#define QCOM_MUTEX_NUM_LOCKS 32
diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
index 95b254e9b6a0..d2aa4714e2ea 100644
--- a/drivers/hwspinlock/sprd_hwspinlock.c
+++ b/drivers/hwspinlock/sprd_hwspinlock.c
@@ -15,8 +15,6 @@
#include <linux/of_device.h>
#include <linux/platform_device.h>
-#include "hwspinlock_internal.h"
-
/* hwspinlock registers definition */
#define HWSPINLOCK_RECCTRL 0x4
#define HWSPINLOCK_MASTERID(_X_) (0x80 + 0x4 * (_X_))
diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index a966e967dcdb..08762cd96cee 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -14,8 +14,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include "hwspinlock_internal.h"
-
#define STM32_MUTEX_COREID BIT(8)
#define STM32_MUTEX_LOCK_BIT BIT(31)
#define STM32_MUTEX_NUM_LOCKS 32
diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun6i_hwspinlock.c
index 8e17deb503c7..5c6d20eb24b5 100644
--- a/drivers/hwspinlock/sun6i_hwspinlock.c
+++ b/drivers/hwspinlock/sun6i_hwspinlock.c
@@ -17,8 +17,6 @@
#include <linux/spinlock.h>
#include <linux/types.h>
-#include "hwspinlock_internal.h"
-
#define DRIVER_NAME "sun6i_hwspinlock"
#define SPINLOCK_BASE_ID 0 /* there is only one hwspinlock device per SoC */
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 58733cda7a9a..4f5b6932712e 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -27,8 +27,31 @@ struct hwspinlock_ops;
#ifdef CONFIG_HWSPINLOCK
+/**
+ * struct hwspinlock_ops - platform-specific hwspinlock handlers
+ *
+ * @trylock: make a single attempt to take the lock. returns 0 on
+ * failure and true on success. may _not_ sleep.
+ * @unlock: release the lock. always succeed. may _not_ sleep.
+ * @bust: optional, platform-specific bust handler, called by hwspinlock
+ * core to bust a specific lock.
+ * @relax: optional, platform-specific relax handler, called by hwspinlock
+ * core while spinning on a lock, between two successive
+ * invocations of @trylock. may _not_ sleep.
+ * @init_priv: optional, callback used when registering the hwspinlock device.
+ * Its return value will be used to fill the per-lock 'priv' data.
+ */
+struct hwspinlock_ops {
+ int (*trylock)(struct hwspinlock *lock);
+ void (*unlock)(struct hwspinlock *lock);
+ int (*bust)(struct hwspinlock *lock, unsigned int id);
+ void (*relax)(struct hwspinlock *lock);
+ void *(*init_priv)(int local_id, void *init_data);
+};
+
void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
+int hwlock_to_id(struct hwspinlock *hwlock);
struct hwspinlock_device *hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
int base_id, int num_locks, void *init_data);
int hwspin_lock_unregister(struct hwspinlock_device *bank);
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 10/13] hwspinlock: remove internal header
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (8 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 09/13] hwspinlock: move entries from internal to public header Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 11/13] hwspinlock: sort include and update copyright Wolfram Sang
` (3 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, linux-remoteproc
Because the internal header is now used by the core only, it can also be
moved its source code. The header was small enough.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/hwspinlock_core.c | 31 +++++++++++++++-
drivers/hwspinlock/hwspinlock_internal.h | 46 ------------------------
2 files changed, 30 insertions(+), 47 deletions(-)
delete mode 100644 drivers/hwspinlock/hwspinlock_internal.h
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index e0227d027cf2..838bb2ab5eba 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -10,6 +10,7 @@
#define pr_fmt(fmt) "%s: " fmt, __func__
#include <linux/delay.h>
+#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spinlock.h>
@@ -23,7 +24,35 @@
#include <linux/of.h>
#include <linux/slab.h>
-#include "hwspinlock_internal.h"
+struct hwspinlock_device;
+
+/**
+ * struct hwspinlock - this struct represents a single hwspinlock instance
+ * @bank: the hwspinlock_device structure which owns this lock
+ * @lock: initialized and used by hwspinlock core
+ * @priv: private data, owned by the underlying platform-specific hwspinlock drv
+ */
+struct hwspinlock {
+ struct hwspinlock_device *bank;
+ spinlock_t lock;
+ void *priv;
+};
+
+/**
+ * struct hwspinlock_device - a device which usually spans numerous hwspinlocks
+ * @dev: underlying device, will be used to invoke runtime PM api
+ * @ops: platform-specific hwspinlock handlers
+ * @base_id: id index of the first lock in this device
+ * @num_locks: number of locks in this device
+ * @lock: dynamically allocated array of 'struct hwspinlock'
+ */
+struct hwspinlock_device {
+ struct device *dev;
+ const struct hwspinlock_ops *ops;
+ int base_id;
+ int num_locks;
+ struct hwspinlock lock[];
+};
/* retry delay used in atomic context */
#define HWSPINLOCK_RETRY_DELAY_US 100
diff --git a/drivers/hwspinlock/hwspinlock_internal.h b/drivers/hwspinlock/hwspinlock_internal.h
deleted file mode 100644
index 20ae531fc389..000000000000
--- a/drivers/hwspinlock/hwspinlock_internal.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Hardware spinlocks internal header
- *
- * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
- *
- * Contact: Ohad Ben-Cohen <ohad@wizery.com>
- */
-
-#ifndef __HWSPINLOCK_HWSPINLOCK_H
-#define __HWSPINLOCK_HWSPINLOCK_H
-
-#include <linux/spinlock.h>
-#include <linux/device.h>
-
-struct hwspinlock_device;
-
-/**
- * struct hwspinlock - this struct represents a single hwspinlock instance
- * @bank: the hwspinlock_device structure which owns this lock
- * @lock: initialized and used by hwspinlock core
- * @priv: private data, owned by the underlying platform-specific hwspinlock drv
- */
-struct hwspinlock {
- struct hwspinlock_device *bank;
- spinlock_t lock;
- void *priv;
-};
-
-/**
- * struct hwspinlock_device - a device which usually spans numerous hwspinlocks
- * @dev: underlying device, will be used to invoke runtime PM api
- * @ops: platform-specific hwspinlock handlers
- * @base_id: id index of the first lock in this device
- * @num_locks: number of locks in this device
- * @lock: dynamically allocated array of 'struct hwspinlock'
- */
-struct hwspinlock_device {
- struct device *dev;
- const struct hwspinlock_ops *ops;
- int base_id;
- int num_locks;
- struct hwspinlock lock[];
-};
-
-#endif /* __HWSPINLOCK_HWSPINLOCK_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 11/13] hwspinlock: sort include and update copyright
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (9 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 10/13] hwspinlock: remove internal header Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 12/13] hwspinlock: refactor provider.h from public header Wolfram Sang
` (2 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, linux-remoteproc
During the latest refactoring, unsorted includes were a bit annoying.
So, sort them to avoid this. Also, update the copyright due to said
refactorings.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/hwspinlock/hwspinlock_core.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index 838bb2ab5eba..adf6fefb382f 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -3,26 +3,26 @@
* Hardware spinlock framework
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
- *
- * Contact: Ohad Ben-Cohen <ohad@wizery.com>
+ * Copyright (C) 2026 Sang Engineering
+ * Copyright (C) 2026 Renesas Solutions Corp.
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
#include <linux/delay.h>
#include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <linux/types.h>
#include <linux/err.h>
-#include <linux/jiffies.h>
-#include <linux/radix-tree.h>
#include <linux/hwspinlock.h>
-#include <linux/pm_runtime.h>
+#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
+#include <linux/pm_runtime.h>
+#include <linux/radix-tree.h>
#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
struct hwspinlock_device;
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 12/13] hwspinlock: refactor provider.h from public header
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (10 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 11/13] hwspinlock: sort include and update copyright Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h " Wolfram Sang
2026-02-16 7:40 ` [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Andy Shevchenko
13 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Orson Zhai, Chunyan Zhang, Maxime Coquelin,
Alexandre Torgue, Wilken Gottwalt, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-remoteproc, linux-omap, linux-arm-msm,
linux-stm32, linux-sunxi
Factor out the entries only needed for providers from the generic public
header. This allows for a clean separation between providers and
consumers. All providers are in the hwspinlock subsystem currently and
are trivially converted here as well.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
MAINTAINERS | 1 +
drivers/hwspinlock/hwspinlock_core.c | 1 +
drivers/hwspinlock/omap_hwspinlock.c | 2 +-
drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
drivers/hwspinlock/sprd_hwspinlock.c | 2 +-
drivers/hwspinlock/stm32_hwspinlock.c | 2 +-
drivers/hwspinlock/sun6i_hwspinlock.c | 2 +-
include/linux/hwspinlock.h | 44 --------------------
include/linux/hwspinlock/provider.h | 60 +++++++++++++++++++++++++++
9 files changed, 67 insertions(+), 49 deletions(-)
create mode 100644 include/linux/hwspinlock/provider.h
diff --git a/MAINTAINERS b/MAINTAINERS
index dcdbb7c10dce..f9131b8cd5d2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11215,6 +11215,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git hw
F: Documentation/devicetree/bindings/hwlock/
F: Documentation/locking/hwspinlock.rst
F: drivers/hwspinlock/
+F: include/linux/hwspinlock/
F: include/linux/hwspinlock.h
HARDWARE TRACING FACILITIES
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index adf6fefb382f..6c8a03deb00c 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -13,6 +13,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/provider.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index 96fdc35ef642..338ae9fa89f0 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -19,7 +19,7 @@
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/provider.h>
#include <linux/of.h>
#include <linux/platform_device.h>
diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 22cc6f9003df..7fdbb1e58b29 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -4,7 +4,7 @@
* Copyright (c) 2015, Sony Mobile Communications AB
*/
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/provider.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c
index d2aa4714e2ea..f6014b314432 100644
--- a/drivers/hwspinlock/sprd_hwspinlock.c
+++ b/drivers/hwspinlock/sprd_hwspinlock.c
@@ -7,7 +7,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/provider.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index 08762cd96cee..a22ebabe1921 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -6,7 +6,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/provider.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun6i_hwspinlock.c
index 5c6d20eb24b5..4dab91800745 100644
--- a/drivers/hwspinlock/sun6i_hwspinlock.c
+++ b/drivers/hwspinlock/sun6i_hwspinlock.c
@@ -7,7 +7,7 @@
#include <linux/clk.h>
#include <linux/debugfs.h>
#include <linux/errno.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/provider.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 4f5b6932712e..4fe1c8831cd1 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -27,34 +27,6 @@ struct hwspinlock_ops;
#ifdef CONFIG_HWSPINLOCK
-/**
- * struct hwspinlock_ops - platform-specific hwspinlock handlers
- *
- * @trylock: make a single attempt to take the lock. returns 0 on
- * failure and true on success. may _not_ sleep.
- * @unlock: release the lock. always succeed. may _not_ sleep.
- * @bust: optional, platform-specific bust handler, called by hwspinlock
- * core to bust a specific lock.
- * @relax: optional, platform-specific relax handler, called by hwspinlock
- * core while spinning on a lock, between two successive
- * invocations of @trylock. may _not_ sleep.
- * @init_priv: optional, callback used when registering the hwspinlock device.
- * Its return value will be used to fill the per-lock 'priv' data.
- */
-struct hwspinlock_ops {
- int (*trylock)(struct hwspinlock *lock);
- void (*unlock)(struct hwspinlock *lock);
- int (*bust)(struct hwspinlock *lock, unsigned int id);
- void (*relax)(struct hwspinlock *lock);
- void *(*init_priv)(int local_id, void *init_data);
-};
-
-void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
-struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
-int hwlock_to_id(struct hwspinlock *hwlock);
-struct hwspinlock_device *hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
- int base_id, int num_locks, void *init_data);
-int hwspin_lock_unregister(struct hwspinlock_device *bank);
struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
int hwspin_lock_free(struct hwspinlock *hwlock);
int of_hwspin_lock_get_id(struct device_node *np, int index);
@@ -67,18 +39,6 @@ int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id);
int devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock);
struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
unsigned int id);
-int devm_hwspin_lock_unregister(struct device *dev,
- struct hwspinlock_device *bank);
-struct hwspinlock_device *devm_hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
- int base_id, int num_locks, void *init_data);
-
-static inline int devm_hwspin_lock_register_errno(struct device *dev,
- const struct hwspinlock_ops *ops,
- int base_id, int num_locks, void *init_data)
-{
- return PTR_ERR_OR_ZERO(devm_hwspin_lock_register(dev, ops, base_id, num_locks, init_data));
-}
-
#else /* !CONFIG_HWSPINLOCK */
/*
@@ -87,10 +47,6 @@ static inline int devm_hwspin_lock_register_errno(struct device *dev,
* code path get compiled away. This way, if CONFIG_HWSPINLOCK is not
* required on a given setup, users will still work.
*
- * The only exception is hwspin_lock_register/hwspin_lock_unregister, with which
- * we _do_ want users to fail (no point in registering hwspinlock instances if
- * the framework is not available).
- *
* Note: ERR_PTR(-ENODEV) will still be considered a success for NULL-checking
* users. Others, which care, can still check this with IS_ERR.
*/
diff --git a/include/linux/hwspinlock/provider.h b/include/linux/hwspinlock/provider.h
new file mode 100644
index 000000000000..73c7b0cb6735
--- /dev/null
+++ b/include/linux/hwspinlock/provider.h
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Hardware spinlock public header for providers
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2026 Sang Engineering
+ * Copyright (C) 2026 Renesas Solutions Corp.
+ */
+
+#ifndef __LINUX_HWSPINLOCK_PROVIDER_H
+#define __LINUX_HWSPINLOCK_PROVIDER_H
+
+#include <linux/err.h>
+
+struct device;
+struct hwspinlock;
+struct hwspinlock_device;
+
+/**
+ * struct hwspinlock_ops - platform-specific hwspinlock handlers
+ *
+ * @trylock: make a single attempt to take the lock. returns 0 on
+ * failure and true on success. may _not_ sleep.
+ * @unlock: release the lock. always succeed. may _not_ sleep.
+ * @bust: optional, platform-specific bust handler, called by hwspinlock
+ * core to bust a specific lock.
+ * @relax: optional, platform-specific relax handler, called by hwspinlock
+ * core while spinning on a lock, between two successive
+ * invocations of @trylock. may _not_ sleep.
+ * @init_priv: optional, callback used when registering the hwspinlock device.
+ * Its return value will be used to fill the per-lock 'priv' data.
+ */
+struct hwspinlock_ops {
+ int (*trylock)(struct hwspinlock *lock);
+ void (*unlock)(struct hwspinlock *lock);
+ int (*bust)(struct hwspinlock *lock, unsigned int id);
+ void (*relax)(struct hwspinlock *lock);
+ void *(*init_priv)(int local_id, void *init_data);
+};
+
+void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
+struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
+int hwlock_to_id(struct hwspinlock *hwlock);
+struct hwspinlock_device *hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data);
+int hwspin_lock_unregister(struct hwspinlock_device *bank);
+
+struct hwspinlock_device *devm_hwspin_lock_register(struct device *dev, const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data);
+int devm_hwspin_lock_unregister(struct device *dev,
+ struct hwspinlock_device *bank);
+
+static inline int devm_hwspin_lock_register_errno(struct device *dev,
+ const struct hwspinlock_ops *ops,
+ int base_id, int num_locks, void *init_data)
+{
+ return PTR_ERR_OR_ZERO(devm_hwspin_lock_register(dev, ops, base_id, num_locks, init_data));
+}
+
+#endif /* __LINUX_HWSPINLOCK_PROVIDER_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h from public header
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (11 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 12/13] hwspinlock: refactor provider.h from public header Wolfram Sang
@ 2026-02-15 22:54 ` Wolfram Sang
2026-02-16 7:37 ` Andy Shevchenko
` (2 more replies)
2026-02-16 7:40 ` [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Andy Shevchenko
13 siblings, 3 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-15 22:54 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Wolfram Sang, Bjorn Andersson,
Baolin Wang, Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng,
Waiman Long, Jonathan Corbet, Shuah Khan, Mark Brown,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Orson Zhai, Chunyan Zhang, Thomas Gleixner, Maxime Coquelin,
Alexandre Torgue, Lee Jones, Arnd Bergmann, Srinivas Kandagatla,
Antonio Borneo, Linus Walleij, Konrad Dybcio, linux-remoteproc,
linux-doc, driver-core, linux-iio, linux-stm32, linux-gpio,
linux-arm-msm, linux-spi
Factor out the entries only needed for consumers from the generic public
header. This allows for a clean separation between providers and
consumers.
FIXME: separate driver changes?
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Documentation/locking/hwspinlock.rst | 2 +-
MAINTAINERS | 1 -
drivers/base/regmap/regmap.c | 2 +-
drivers/hwspinlock/hwspinlock_core.c | 2 +-
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 +-
.../linux/{hwspinlock.h => hwspinlock/consumer.h} | 15 ++++++---------
13 files changed, 17 insertions(+), 21 deletions(-)
rename include/linux/{hwspinlock.h => hwspinlock/consumer.h} (98%)
diff --git a/Documentation/locking/hwspinlock.rst b/Documentation/locking/hwspinlock.rst
index a737c702a7d1..001bcab86690 100644
--- a/Documentation/locking/hwspinlock.rst
+++ b/Documentation/locking/hwspinlock.rst
@@ -306,7 +306,7 @@ Typical usage
::
- #include <linux/hwspinlock.h>
+ #include <linux/hwspinlock/consumer.h>
#include <linux/err.h>
int hwspinlock_example(void)
diff --git a/MAINTAINERS b/MAINTAINERS
index f9131b8cd5d2..8141a8a5ea01 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11216,7 +11216,6 @@ F: Documentation/devicetree/bindings/hwlock/
F: Documentation/locking/hwspinlock.rst
F: drivers/hwspinlock/
F: include/linux/hwspinlock/
-F: include/linux/hwspinlock.h
HARDWARE TRACING FACILITIES
M: Alexander Shishkin <alexander.shishkin@linux.intel.com>
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 4231e9d4b8ff..3f4c254e8ac7 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -16,7 +16,7 @@
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/log2.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/unaligned.h>
#define CREATE_TRACE_POINTS
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index 6c8a03deb00c..e78ec4b5cfa3 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -12,7 +12,7 @@
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/hwspinlock/provider.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c
index 6209499c5c37..8a881d63b7dd 100644
--- a/drivers/iio/adc/sc27xx_adc.c
+++ b/drivers/iio/adc/sc27xx_adc.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2018 Spreadtrum Communications Inc.
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/iio/iio.h>
#include <linux/module.h>
#include <linux/mutex.h>
diff --git a/drivers/irqchip/irq-stm32mp-exti.c b/drivers/irqchip/irq-stm32mp-exti.c
index a24f4f1a4f8f..25d5aa67728a 100644
--- a/drivers/irqchip/irq-stm32mp-exti.c
+++ b/drivers/irqchip/irq-stm32mp-exti.c
@@ -6,7 +6,7 @@
*/
#include <linux/bitops.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index e5d5def594f6..49473669e84e 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -11,7 +11,7 @@
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/err.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/of.h>
diff --git a/drivers/nvmem/sc27xx-efuse.c b/drivers/nvmem/sc27xx-efuse.c
index 4e2ffefac96c..309090cd4ff0 100644
--- a/drivers/nvmem/sc27xx-efuse.c
+++ b/drivers/nvmem/sc27xx-efuse.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2018 Spreadtrum Communications Inc.
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
index 1a7e4e5d8b86..92e3092719ba 100644
--- a/drivers/nvmem/sprd-efuse.c
+++ b/drivers/nvmem/sprd-efuse.c
@@ -3,7 +3,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 6a99708a5a23..17b2072d609e 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -10,7 +10,7 @@
#include <linux/clk.h>
#include <linux/export.h>
#include <linux/gpio/driver.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/mfd/syscon.h>
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index d5c94b47f431..6d574d65b4a3 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -4,7 +4,7 @@
* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*/
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index e7d83c16b46c..04313e4a63dd 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -5,7 +5,7 @@
*/
#include <linux/delay.h>
-#include <linux/hwspinlock.h>
+#include <linux/hwspinlock/consumer.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock/consumer.h
similarity index 98%
rename from include/linux/hwspinlock.h
rename to include/linux/hwspinlock/consumer.h
index 4fe1c8831cd1..f476222ec924 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock/consumer.h
@@ -1,17 +1,16 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
- * Hardware spinlock public header
+ * Hardware spinlock public header for consumers
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
- *
- * Contact: Ohad Ben-Cohen <ohad@wizery.com>
+ * Copyright (C) 2026 Sang Engineering
+ * Copyright (C) 2026 Renesas Solutions Corp.
*/
-#ifndef __LINUX_HWSPINLOCK_H
-#define __LINUX_HWSPINLOCK_H
+#ifndef __LINUX_HWSPINLOCK_CONSUMER_H
+#define __LINUX_HWSPINLOCK_CONSUMER_H
#include <linux/err.h>
-#include <linux/sched.h>
/* hwspinlock mode argument */
#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
@@ -22,8 +21,6 @@
struct device;
struct device_node;
struct hwspinlock;
-struct hwspinlock_device;
-struct hwspinlock_ops;
#ifdef CONFIG_HWSPINLOCK
@@ -403,4 +400,4 @@ static inline void hwspin_unlock(struct hwspinlock *hwlock)
__hwspin_unlock(hwlock, 0, NULL);
}
-#endif /* __LINUX_HWSPINLOCK_H */
+#endif /* __LINUX_HWSPINLOCK_CONSUMER_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h from public header
2026-02-15 22:54 ` [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h " Wolfram Sang
@ 2026-02-16 7:37 ` Andy Shevchenko
2026-02-16 16:07 ` Mark Brown
2026-02-18 19:56 ` Jonathan Cameron
2 siblings, 0 replies; 25+ messages in thread
From: Andy Shevchenko @ 2026-02-16 7:37 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, linux-arm-kernel, Bjorn Andersson, Baolin Wang,
Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long,
Jonathan Corbet, Shuah Khan, Mark Brown, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Orson Zhai,
Chunyan Zhang, Thomas Gleixner, Maxime Coquelin, Alexandre Torgue,
Lee Jones, Arnd Bergmann, Srinivas Kandagatla, Antonio Borneo,
Linus Walleij, Konrad Dybcio, linux-remoteproc, linux-doc,
driver-core, linux-iio, linux-stm32, linux-gpio, linux-arm-msm,
linux-spi
On Sun, Feb 15, 2026 at 11:54:53PM +0100, Wolfram Sang wrote:
> Factor out the entries only needed for consumers from the generic public
> header. This allows for a clean separation between providers and
> consumers.
> FIXME: separate driver changes?
To me the change sounds quite small and unlikely to conflict in the future, I
would just mark it
treewide: refactor hwspinlock/consumer.h from public header
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
` (12 preceding siblings ...)
2026-02-15 22:54 ` [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h " Wolfram Sang
@ 2026-02-16 7:40 ` Andy Shevchenko
2026-02-16 8:34 ` Wolfram Sang
13 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2026-02-16 7:40 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, linux-arm-kernel, Alexandre Torgue,
Andy Shevchenko, Antonio Borneo, Arnd Bergmann, Baolin Wang,
Bjorn Andersson, Boqun Feng, Chen-Yu Tsai, Chunyan Zhang,
Danilo Krummrich, David Lechner, driver-core, Greg Kroah-Hartman,
Ingo Molnar, Jernej Skrabec, Jonathan Cameron, Jonathan Corbet,
Konrad Dybcio, Lee Jones, Linus Walleij, 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
On Sun, Feb 15, 2026 at 11:54:40PM +0100, Wolfram Sang wrote:
> My ultimate goal is to allow hwspinlock provider drivers outside of the
> subsystem directory. It turned out that a simple split of the headers
> files into a public provider and a public consumer header file is not
> enough because core internal structure need to stay hidden. Even more,
> their opaqueness could and should even be increased. That would also
> allow the core to handle the de-/allocation of the hwspinlock device
> itself.
>
> This series does all that. Patches 1-7 abstract access to internal
> structures away using helpers. Patch 8 then move hwspinlock device
> handling to the core, simplifying drivers. The remaining patches
> refactor the headers until the internal one is gone and the public ones
> are divided into provider and consumer parts. More details are given in
> the patch descriptions.
>
> One note about using a callback to initialize hwspinlock priv: I also
> experimented with a dedicated 'set_priv' helper function. It felt a bit
> clumsy to me. Drivers would need to save the 'bank' pointer again and
> iterate over it. Because most drivers will only have a simple callback
> anyhow, it looked leaner to me.
>
> This series is based on the cleanup series "hwspinlock: remove
> platform_data from subsystem" and has been tested on a Renesas
> SparrowHawk board (R-Car V4H) with a yet-to-be-upstreamed hwspinlock
> driver for the MFIS IP core. A branch can be found here (the MFIS driver
> is still WIP):
>
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/hwspinlock/refactor-alloc-buildtest
>
> Buildbots seem to be happy, too.
>
> Looking forward to comments. I especially wonder if the last patch
> should stay as-is or if it should be broken out, so individual
> subsystems can pick up their part (with a fallback in place, of course,
> until the last user is converted).
Coincidentally I have briefly reviewed it in the Git tree before you have sent
this to ML. I like the whole series, but what I have missed is the explanation
of the removal of Contact: comment in some of the files.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-15 22:54 ` [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock Wolfram Sang
@ 2026-02-16 8:05 ` Sergey Shtylyov
2026-02-16 8:29 ` Wolfram Sang
0 siblings, 1 reply; 25+ messages in thread
From: Sergey Shtylyov @ 2026-02-16 8:05 UTC (permalink / raw)
To: Wolfram Sang, linux-renesas-soc
Cc: Andy Shevchenko, linux-arm-kernel, Bjorn Andersson, Baolin Wang,
linux-remoteproc
On 2/16/26 1:54 AM, Wolfram Sang wrote:
> To hide internal core structures from providers, a callback is added to
> the ops which allows to set the 'priv' field of a hwspinlock. It is
> called when a hwspinlock device is registered and, thus, iterated over
> all locks. The register-functions are also extended to pass a data
> pointer to this callback, so it can do necessary calculations for the
> priv field of each hwspinlock. Providers are converted separately
> because these changes need dedicated reviews.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[...]
> --- a/include/linux/hwspinlock.h
> +++ b/include/linux/hwspinlock.h
> @@ -30,7 +30,7 @@ struct hwspinlock_ops;
> void *hwspin_lock_get_priv(struct hwspinlock *hwlock);
> struct device *hwspin_lock_get_dev(struct hwspinlock *hwlock);
> int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
> - const struct hwspinlock_ops *ops, int base_id, int num_locks);
> + const struct hwspinlock_ops *ops, int base_id, int num_locks, void *init_data);
> int hwspin_lock_unregister(struct hwspinlock_device *bank);
> struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
> int hwspin_lock_free(struct hwspinlock *hwlock);
> @@ -49,7 +49,7 @@ int devm_hwspin_lock_unregister(struct device *dev,
> int devm_hwspin_lock_register(struct device *dev,
> struct hwspinlock_device *bank,
> const struct hwspinlock_ops *ops,
> - int base_id, int num_locks);
> + int base_id, int num_locks, void *init_data);
Don't you break the existing users of this API with this change? I see
you're fixing them up in the followup patches but that's not how it should
be done -- the compilation shouldn't be broken...
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-16 8:05 ` Sergey Shtylyov
@ 2026-02-16 8:29 ` Wolfram Sang
2026-02-16 10:12 ` Geert Uytterhoeven
0 siblings, 1 reply; 25+ messages in thread
From: Wolfram Sang @ 2026-02-16 8:29 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-renesas-soc, Andy Shevchenko, linux-arm-kernel,
Bjorn Andersson, Baolin Wang, linux-remoteproc
> Don't you break the existing users of this API with this change? I see
> you're fixing them up in the followup patches but that's not how it should
> be done -- the compilation shouldn't be broken...
I am not breaking them. The helper is an additional feature and the old
way still works until patch 8. Until then, all users are converted.
I built tested it :)
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes
2026-02-16 7:40 ` [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Andy Shevchenko
@ 2026-02-16 8:34 ` Wolfram Sang
0 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-16 8:34 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-renesas-soc, linux-arm-kernel, Alexandre Torgue,
Andy Shevchenko, Antonio Borneo, Arnd Bergmann, Baolin Wang,
Bjorn Andersson, Boqun Feng, Chen-Yu Tsai, Chunyan Zhang,
Danilo Krummrich, David Lechner, driver-core, Greg Kroah-Hartman,
Ingo Molnar, Jernej Skrabec, Jonathan Cameron, Jonathan Corbet,
Konrad Dybcio, Lee Jones, Linus Walleij, 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
> > Looking forward to comments. I especially wonder if the last patch
> > should stay as-is or if it should be broken out, so individual
> > subsystems can pick up their part (with a fallback in place, of course,
> > until the last user is converted).
>
> Coincidentally I have briefly reviewed it in the Git tree before you have sent
> this to ML. I like the whole series, but what I have missed is the explanation
> of the removal of Contact: comment in some of the files.
Ah, thanks! True, documenting it slipped through the cracks. Sorry about
that. The reason is, of course, we have MAINTAINERS for this kind of
information. Plus, Ohad Ben-Cohen hasn't been commiting upstream to 10+
years according to git history.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-16 8:29 ` Wolfram Sang
@ 2026-02-16 10:12 ` Geert Uytterhoeven
2026-02-16 10:53 ` Wolfram Sang
0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-02-16 10:12 UTC (permalink / raw)
To: Wolfram Sang
Cc: Sergey Shtylyov, linux-renesas-soc, Andy Shevchenko,
linux-arm-kernel, Bjorn Andersson, Baolin Wang, linux-remoteproc
Hi Wolfram,
On Mon, 16 Feb 2026 at 09:29, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > Don't you break the existing users of this API with this change? I see
> > you're fixing them up in the followup patches but that's not how it should
> > be done -- the compilation shouldn't be broken...
>
> I am not breaking them. The helper is an additional feature and the old
> way still works until patch 8. Until then, all users are converted.
>
> I built tested it :)
Is that the statistically most-used response to that question? ;-)
drivers/hwspinlock/sun6i_hwspinlock.c: In function ‘sun6i_hwspinlock_probe’:
drivers/hwspinlock/sun6i_hwspinlock.c:182:16: error: too few arguments
to function ‘devm_hwspin_lock_register’
182 | return devm_hwspin_lock_register(&pdev->dev,
priv->bank, &sun6i_hwspinlock_ops,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
[...]
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-16 10:12 ` Geert Uytterhoeven
@ 2026-02-16 10:53 ` Wolfram Sang
2026-02-16 16:12 ` Sergey Shtylyov
0 siblings, 1 reply; 25+ messages in thread
From: Wolfram Sang @ 2026-02-16 10:53 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Sergey Shtylyov, linux-renesas-soc, Andy Shevchenko,
linux-arm-kernel, Bjorn Andersson, Baolin Wang, linux-remoteproc
> Is that the statistically most-used response to that question? ;-)
That I don't know. I just know that I did build-testing for the whole
series and the buildbots reported success. Need to look up why this was
not caught.
Sorry Sergey, you were right...
Hmm, so is merging all the user-conversion patches into this one an
option? Maybe the RFC here can be reviewed per-driver and the real patch
set have this all merged?
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h from public header
2026-02-15 22:54 ` [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h " Wolfram Sang
2026-02-16 7:37 ` Andy Shevchenko
@ 2026-02-16 16:07 ` Mark Brown
2026-02-18 19:56 ` Jonathan Cameron
2 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2026-02-16 16:07 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Andy Shevchenko, linux-arm-kernel,
Bjorn Andersson, Baolin Wang, Peter Zijlstra, Ingo Molnar,
Will Deacon, Boqun Feng, Waiman Long, Jonathan Corbet, Shuah Khan,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Orson Zhai, Chunyan Zhang, Thomas Gleixner, Maxime Coquelin,
Alexandre Torgue, Lee Jones, Arnd Bergmann, Srinivas Kandagatla,
Antonio Borneo, Linus Walleij, Konrad Dybcio, linux-remoteproc,
linux-doc, driver-core, linux-iio, linux-stm32, linux-gpio,
linux-arm-msm, linux-spi
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
On Sun, Feb 15, 2026 at 11:54:53PM +0100, Wolfram Sang wrote:
> Factor out the entries only needed for consumers from the generic public
> header. This allows for a clean separation between providers and
> consumers.
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-16 10:53 ` Wolfram Sang
@ 2026-02-16 16:12 ` Sergey Shtylyov
2026-02-16 16:54 ` Wolfram Sang
0 siblings, 1 reply; 25+ messages in thread
From: Sergey Shtylyov @ 2026-02-16 16:12 UTC (permalink / raw)
To: Wolfram Sang, Geert Uytterhoeven
Cc: linux-renesas-soc, Andy Shevchenko, linux-arm-kernel,
Bjorn Andersson, Baolin Wang, linux-remoteproc
On 2/16/26 1:53 PM, Wolfram Sang wrote:
>> Is that the statistically most-used response to that question? ;-)
>
> That I don't know. I just know that I did build-testing for the whole
> series and the buildbots reported success. Need to look up why this was
> not caught.
Maybe it just built the kernel after applying the entire series? :-)
> Sorry Sergey, you were right...
>
> Hmm, so is merging all the user-conversion patches into this one an
> option? Maybe the RFC here can be reviewed per-driver and the real patch
> set have this all merged?
Perhaps you should update the existing users to just pass NULL as
init_data in this patch, and only then do the full-blown updates of
the individual drivers?
MBR, Sergey
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock
2026-02-16 16:12 ` Sergey Shtylyov
@ 2026-02-16 16:54 ` Wolfram Sang
0 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2026-02-16 16:54 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: Geert Uytterhoeven, linux-renesas-soc, Andy Shevchenko,
linux-arm-kernel, Bjorn Andersson, Baolin Wang, linux-remoteproc
Hi Sergey,
> > That I don't know. I just know that I did build-testing for the whole
> > series and the buildbots reported success. Need to look up why this was
> > not caught.
>
> Maybe it just built the kernel after applying the entire series? :-)
My scripts build after every patch. As said, I have to double check why
it did not fail here. I used to think buildbots work the same, but
probably not as I got another success report after this thread already
had started.
> Perhaps you should update the existing users to just pass NULL as
> init_data in this patch, and only then do the full-blown updates of
> the individual drivers?
That sounds like a good option to me, thanks!
Happy hacking,
Wolfram
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h from public header
2026-02-15 22:54 ` [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h " Wolfram Sang
2026-02-16 7:37 ` Andy Shevchenko
2026-02-16 16:07 ` Mark Brown
@ 2026-02-18 19:56 ` Jonathan Cameron
2 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2026-02-18 19:56 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Andy Shevchenko, linux-arm-kernel,
Bjorn Andersson, Baolin Wang, Peter Zijlstra, Ingo Molnar,
Will Deacon, Boqun Feng, Waiman Long, Jonathan Corbet, Shuah Khan,
Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki,
Danilo Krummrich, David Lechner, Nuno Sá, Andy Shevchenko,
Orson Zhai, Chunyan Zhang, Thomas Gleixner, Maxime Coquelin,
Alexandre Torgue, Lee Jones, Arnd Bergmann, Srinivas Kandagatla,
Antonio Borneo, Linus Walleij, Konrad Dybcio, linux-remoteproc,
linux-doc, driver-core, linux-iio, linux-stm32, linux-gpio,
linux-arm-msm, linux-spi
On Sun, 15 Feb 2026 23:54:53 +0100
Wolfram Sang <wsa+renesas@sang-engineering.com> wrote:
> Factor out the entries only needed for consumers from the generic public
> header. This allows for a clean separation between providers and
> consumers.
>
> FIXME: separate driver changes?
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
for the IIO one.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2026-02-18 19:57 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-15 22:54 [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 01/13] hwspinlock: add helpers to retrieve core data Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 02/13] hwspinlock: add callback to fill private data of a hwspinlock Wolfram Sang
2026-02-16 8:05 ` Sergey Shtylyov
2026-02-16 8:29 ` Wolfram Sang
2026-02-16 10:12 ` Geert Uytterhoeven
2026-02-16 10:53 ` Wolfram Sang
2026-02-16 16:12 ` Sergey Shtylyov
2026-02-16 16:54 ` Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 03/13] hwspinlock: omap: use new callback to initialize hwspinlock priv Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 04/13] hwspinlock: qcom: " Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 05/13] hwspinlock: sprd: " Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 06/13] hwspinlock: stm32: " Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 07/13] hwspinlock: sun6i: " Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 08/13] hwspinlock: handle hwspinlock device allocation in the core Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 09/13] hwspinlock: move entries from internal to public header Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 10/13] hwspinlock: remove internal header Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 11/13] hwspinlock: sort include and update copyright Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 12/13] hwspinlock: refactor provider.h from public header Wolfram Sang
2026-02-15 22:54 ` [RFC PATCH v2 13/13] hwspinlock: refactor consumer.h " Wolfram Sang
2026-02-16 7:37 ` Andy Shevchenko
2026-02-16 16:07 ` Mark Brown
2026-02-18 19:56 ` Jonathan Cameron
2026-02-16 7:40 ` [RFC v2 PATCH 00/13] hwspinlock: move device alloc into core and refactor includes Andy Shevchenko
2026-02-16 8:34 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox