Skip to content

Commit

Permalink
delay: Fix ndelay() spuriously treated as udelay()
Browse files Browse the repository at this point in the history
A recent rework on delay functions wrongly ended up calling __udelay()
instead of __ndelay() for nanosecond delays, increasing those by 1000.

As a result hangs have been observed on boot

Restore the right function calls.

Fixes: 19e2d91 ("delay: Rework udelay and ndelay")
Reported-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/all/20241121152931.51884-1-frederic@kernel.org
  • Loading branch information
Frederic Weisbecker authored and Thomas Gleixner committed Nov 29, 2024
1 parent f5807b0 commit 4d17c25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-generic/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ static __always_inline void ndelay(unsigned long nsec)
{
if (__builtin_constant_p(nsec)) {
if (nsec >= DELAY_CONST_MAX)
__bad_udelay();
__bad_ndelay();
else
__const_udelay(nsec * NDELAY_CONST_MULT);
} else {
__udelay(nsec);
__ndelay(nsec);
}
}
#define ndelay(x) ndelay(x)
Expand Down

0 comments on commit 4d17c25

Please sign in to comment.