[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878t6hami4.fsf@concordia.ellerman.id.au>
Date: Thu, 12 Jul 2018 00:13:39 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Daniel Klamt <eleon@...0n.de>, benh@...nel.crashing.org
Cc: paulus@...ba.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, linux-kernel@...cs.fau.de,
Daniel Klamt <eleon@...0n.de>,
Bjoern Noetel <bjoern@...ak3r.de>
Subject: Re: [PATCH] powerpc: Replaced msleep with usleep_range
Hi Daniel,
Daniel Klamt <eleon@...0n.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@...0n.de>
> Signed-off-by: Bjoern Noetel <bjoern@...ak3r.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
Powered by blists - more mailing lists