diff options
Diffstat (limited to 'arch/riscv/lib/delay.c')
-rw-r--r-- | arch/riscv/lib/delay.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/riscv/lib/delay.c b/arch/riscv/lib/delay.c index 87ff89e88f2c..f51c9a03bca1 100644 --- a/arch/riscv/lib/delay.c +++ b/arch/riscv/lib/delay.c | |||
@@ -81,9 +81,13 @@ EXPORT_SYMBOL(__delay); | |||
81 | void udelay(unsigned long usecs) | 81 | void udelay(unsigned long usecs) |
82 | { | 82 | { |
83 | u64 ucycles = (u64)usecs * lpj_fine * UDELAY_MULT; | 83 | u64 ucycles = (u64)usecs * lpj_fine * UDELAY_MULT; |
84 | u64 n; | ||
84 | 85 | ||
85 | if (unlikely(usecs > MAX_UDELAY_US)) { | 86 | if (unlikely(usecs > MAX_UDELAY_US)) { |
86 | __delay((u64)usecs * riscv_timebase / 1000000ULL); | 87 | n = (u64)usecs * riscv_timebase; |
88 | do_div(n, 1000000); | ||
89 | |||
90 | __delay(n); | ||
87 | return; | 91 | return; |
88 | } | 92 | } |
89 | 93 | ||