LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] hwspinlock: stm32: implement the relax() ops
@ 2019-03-07 15:42 Fabien Dessenne
  2019-03-08 12:42 ` Benjamin Gaignard
  2019-06-30  4:05 ` Bjorn Andersson
  0 siblings, 2 replies; 4+ messages in thread
From: Fabien Dessenne @ 2019-03-07 15:42 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson, Maxime Coquelin,
	Alexandre Torgue, linux-remoteproc, linux-stm32,
	linux-arm-kernel, linux-kernel
  Cc: Fabien Dessenne, Benjamin Gaignard

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

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index 4418392..c8eacf4 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -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


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

* Re: [PATCH] hwspinlock: stm32: implement the relax() ops
  2019-03-07 15:42 [PATCH] hwspinlock: stm32: implement the relax() ops Fabien Dessenne
@ 2019-03-08 12:42 ` Benjamin Gaignard
  2019-05-13  9:07   ` Fabien DESSENNE
  2019-06-30  4:05 ` Bjorn Andersson
  1 sibling, 1 reply; 4+ messages in thread
From: Benjamin Gaignard @ 2019-03-08 12:42 UTC (permalink / raw)
  To: Fabien Dessenne
  Cc: Ohad Ben-Cohen, Bjorn Andersson, Maxime Coquelin,
	Alexandre Torgue, linux-remoteproc, linux-stm32, Linux ARM,
	Linux Kernel Mailing List, Benjamin Gaignard

Le jeu. 7 mars 2019 à 16:42, Fabien Dessenne <fabien.dessenne@st.com> a écrit :
>
> Implement this optional ops, called by hwspinlock core while spinning on
> a lock, between two successive invocations of trylock().
>
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>

Reviewed-by: Benjamin Gaignard <benjamin.gaignard@st.com>

> ---
>  drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
> index 4418392..c8eacf4 100644
> --- a/drivers/hwspinlock/stm32_hwspinlock.c
> +++ b/drivers/hwspinlock/stm32_hwspinlock.c
> @@ -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
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] hwspinlock: stm32: implement the relax() ops
  2019-03-08 12:42 ` Benjamin Gaignard
@ 2019-05-13  9:07   ` Fabien DESSENNE
  0 siblings, 0 replies; 4+ messages in thread
From: Fabien DESSENNE @ 2019-05-13  9:07 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: Ohad Ben-Cohen, Bjorn Andersson, Maxime Coquelin,
	Alexandre TORGUE, linux-remoteproc, linux-stm32, Linux ARM,
	Linux Kernel Mailing List, Benjamin GAIGNARD, Fabien DESSENNE

Hi


Any further comments?


Fabien

On 08/03/2019 1:42 PM, Benjamin Gaignard wrote:
> Le jeu. 7 mars 2019 à 16:42, Fabien Dessenne <fabien.dessenne@st.com> a écrit :
>> Implement this optional ops, called by hwspinlock core while spinning on
>> a lock, between two successive invocations of trylock().
>>
>> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@st.com>
>
>> ---
>>   drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
>> index 4418392..c8eacf4 100644
>> --- a/drivers/hwspinlock/stm32_hwspinlock.c
>> +++ b/drivers/hwspinlock/stm32_hwspinlock.c
>> @@ -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
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>

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

* Re: [PATCH] hwspinlock: stm32: implement the relax() ops
  2019-03-07 15:42 [PATCH] hwspinlock: stm32: implement the relax() ops Fabien Dessenne
  2019-03-08 12:42 ` Benjamin Gaignard
@ 2019-06-30  4:05 ` Bjorn Andersson
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2019-06-30  4:05 UTC (permalink / raw)
  To: Fabien Dessenne
  Cc: Ohad Ben-Cohen, Maxime Coquelin, Alexandre Torgue,
	linux-remoteproc, linux-stm32, linux-arm-kernel, linux-kernel,
	Benjamin Gaignard

On Thu 07 Mar 07:42 PST 2019, Fabien Dessenne wrote:

> Implement this optional ops, called by hwspinlock core while spinning on
> a lock, between two successive invocations of trylock().
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>

Applied

Thanks,
Bjorn

> ---
>  drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
> index 4418392..c8eacf4 100644
> --- a/drivers/hwspinlock/stm32_hwspinlock.c
> +++ b/drivers/hwspinlock/stm32_hwspinlock.c
> @@ -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
> 

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

end of thread, other threads:[~2019-06-30  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 15:42 [PATCH] hwspinlock: stm32: implement the relax() ops Fabien Dessenne
2019-03-08 12:42 ` Benjamin Gaignard
2019-05-13  9:07   ` Fabien DESSENNE
2019-06-30  4:05 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).