From: Sebastian Andrzej Siewior <[email protected]>

If alarm_try_to_cancel() requires a retry, then depending on the
priority setting the retry loop might prevent timer callback completion
on RT. Prevent that by waiting for completion on RT, no change for a
non RT kernel.

Cc: [email protected]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
 kernel/time/alarmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 6fcc367ad531..9d5eac2c9275 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -392,7 +392,7 @@ int alarm_cancel(struct alarm *alarm)
                int ret = alarm_try_to_cancel(alarm);
                if (ret >= 0)
                        return ret;
-               cpu_relax();
+               hrtimer_wait_for_timer(&alarm->timer);
        }
 }
 EXPORT_SYMBOL_GPL(alarm_cancel);
-- 
2.14.3

Reply via email to