From: Fabien Dessenne Date: Thu, 7 Mar 2019 15:42:16 +0000 (+0100) Subject: hwspinlock: stm32: implement the relax() ops X-Git-Tag: v5.3-rc1~54^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5cd69f13deef804d113d31c5c744396b1a1b8a9a;p=thirdparty%2Flinux.git 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(). Reviewed-by: Benjamin Gaignard Signed-off-by: Fabien Dessenne Signed-off-by: Bjorn Andersson --- diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c index 4418392888935..c8eacf4f9692b 100644 --- a/drivers/hwspinlock/stm32_hwspinlock.c +++ b/drivers/hwspinlock/stm32_hwspinlock.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -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)