Skip to contentSkip to conversation

hwspinlock: stm32: implement the relax() ops

PATCH Applied Fabien Dessenne 3 participants 4 messages Mar 7, 2019 – Jun 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwspinlock: stm32: implement the relax() ops

Implement this optional ops, called by hwspinlock core while spinning on a lock, between two successive invocations of trylock().

---
 drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hwspinlock/stm32_hwspinlock.c +7 -0
index 4418392..c8eacf4 100644
@@ -5,6 +5,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/hwspinlock.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -42,9 +43,15 @@ static void stm32_hwspinlock_unlock(struct hwspinlock *lock)
 	writel(STM32_MUTEX_COREID, lock_addr);
 }
 
+static void stm32_hwspinlock_relax(struct hwspinlock *lock)
+{
+	ndelay(50);
+}
+
 static const struct hwspinlock_ops stm32_hwspinlock_ops = {
 	.trylock	= stm32_hwspinlock_trylock,
 	.unlock		= stm32_hwspinlock_unlock,
+	.relax		= stm32_hwspinlock_relax,
 };
 
 static int stm32_hwspinlock_probe(struct platform_device *pdev)
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Fabien Dessenne

Implement this optional ops, called by hwspinlock core while spinning on a lock, between two successive invocations of trylock().

Quoted 40 lines
---
 drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hwspinlock/stm32_hwspinlock.c +7 -1
index 4418392..c8eacf4 100644
@@ -5,6 +5,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/hwspinlock.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -42,9 +43,15 @@ static void stm32_hwspinlock_unlock(struct hwspinlock *lock)
        writel(STM32_MUTEX_COREID, lock_addr);
 }
 
+static void stm32_hwspinlock_relax(struct hwspinlock *lock)
+{
+       ndelay(50);
+}
+
 static const struct hwspinlock_ops stm32_hwspinlock_ops = {
        .trylock        = stm32_hwspinlock_trylock,
        .unlock         = stm32_hwspinlock_unlock,
+       .relax          = stm32_hwspinlock_relax,
 };
 
 static int stm32_hwspinlock_probe(struct platform_device *pdev)
--

2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 7 lines
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog
#2 lore raw

Hi

Any further comments?

Fabien

Quoted 49 lines · Benjamin Gaignard
Quoted 4 lines · Fabien Dessenne

Implement this optional ops, called by hwspinlock core while spinning on a lock, between two successive invocations of trylock().

Quoted 40 lines
---
  drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/hwspinlock/stm32_hwspinlock.c +7 -1
index 4418392..c8eacf4 100644
@@ -5,6 +5,7 @@
   */
 
  #include <linux/clk.h>
+#include <linux/delay.h>
  #include <linux/hwspinlock.h>
  #include <linux/io.h>
  #include <linux/kernel.h>
@@ -42,9 +43,15 @@ static void stm32_hwspinlock_unlock(struct hwspinlock *lock)
         writel(STM32_MUTEX_COREID, lock_addr);
  }
 
+static void stm32_hwspinlock_relax(struct hwspinlock *lock)
+{
+       ndelay(50);
+}
+
  static const struct hwspinlock_ops stm32_hwspinlock_ops = {
         .trylock        = stm32_hwspinlock_trylock,
         .unlock         = stm32_hwspinlock_unlock,
+       .relax          = stm32_hwspinlock_relax,
  };
 
  static int stm32_hwspinlock_probe(struct platform_device *pdev)
--

2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw
In reply to Fabien Dessenne
Quoted 4 lines · Fabien Dessenne

Implement this optional ops, called by hwspinlock core while spinning on a lock, between two successive invocations of trylock().

Applied

Thanks,
Bjorn

Quoted 35 lines
---
 drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hwspinlock/stm32_hwspinlock.c +7 -0
index 4418392..c8eacf4 100644
@@ -5,6 +5,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/hwspinlock.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -42,9 +43,15 @@ static void stm32_hwspinlock_unlock(struct hwspinlock *lock)
 	writel(STM32_MUTEX_COREID, lock_addr);
 }
 
+static void stm32_hwspinlock_relax(struct hwspinlock *lock)
+{
+	ndelay(50);
+}
+
 static const struct hwspinlock_ops stm32_hwspinlock_ops = {
 	.trylock	= stm32_hwspinlock_trylock,
 	.unlock		= stm32_hwspinlock_unlock,
+	.relax		= stm32_hwspinlock_relax,
 };
 
 static int stm32_hwspinlock_probe(struct platform_device *pdev)
Signature · 1 line
2.7.4