diff mbox series

hwspinlock: stm32: implement the relax() ops

Message ID 1551973336-23048-1-git-send-email-fabien.dessenne@st.com (mailing list archive)
State New, archived
Headers show
Series hwspinlock: stm32: implement the relax() ops | expand

Commit Message

Fabien DESSENNE March 7, 2019, 3:42 p.m. UTC
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(+)

Comments

Benjamin Gaignard March 8, 2019, 12:42 p.m. UTC | #1
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
Fabien DESSENNE May 13, 2019, 9:07 a.m. UTC | #2
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
>
>
Bjorn Andersson June 30, 2019, 4:05 a.m. UTC | #3
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
>
diff mbox series

Patch

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)