lkml.org 
[lkml]   [2018]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] powerpc: Replaced msleep with usleep_range
Date
Hi Daniel,

Daniel Klamt <eleon@ele0n.de> writes:
> Replaced msleep for less than 10ms with usleep_range because will
> often sleep longer than intended.
> For original explanation see:
> Documentation/timers/timers-howto.txt
>
> Signed-off-by: Daniel Klamt <eleon@ele0n.de>
> Signed-off-by: Bjoern Noetel <bjoern@br3ak3r.de>
> ---
> arch/powerpc/sysdev/xive/native.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
> index 311185b9960a..b164b1cdf4d6 100644
> --- a/arch/powerpc/sysdev/xive/native.c
> +++ b/arch/powerpc/sysdev/xive/native.c
> @@ -109,7 +109,7 @@ int xive_native_configure_irq(u32 hw_irq, u32 target, u8 prio, u32 sw_irq)
> rc = opal_xive_set_irq_config(hw_irq, target, prio, sw_irq);
> if (rc != OPAL_BUSY)
> break;
> - msleep(1);
> + usleep_range(1000, 1100)
> }

We have actually recently added OPAL_BUSY_DELAY_MS (see opal.h) and
should convert these to use that. eg:

msleep(OPAL_BUSY_DELAY_MS);


That has the effect of documenting that this is a short sleep to wait
for opal (our firmware), and we aren't concerned about rounding errors
in msleep().

If you send me a patch doing that I'd be happy to merge it.

cheers

\
 
 \ /
  Last update: 2018-07-11 16:15    [W:0.067 / U:9.844 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site