Re: [RFC PATCH] x86: Add safe_udelay() and safe_msleep()

From: Christoph Lameter
Date: Fri Jan 14 2011 - 09:46:59 EST


On Thu, 13 Jan 2011, Yinghai Lu wrote:

> > Or have a reasonable default for lpj ...
>
> x86 udelay is using percpu cpu_data.loops_per_jiffy, and it is not set yet.
>
> when x86 boot with earlyprintk=dbgp, that early console is loaded quite before setup_percpu_areas()
>
> maybe something like this could workaround it, if cpu_data(0) can be used before setup_percpu_areas().
>
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index d3cfe26..333694a 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -734,6 +734,7 @@ void __init setup_arch(char **cmdline_p)
>
> early_trap_init();
> early_cpu_init();
> + cpu_data(0).loops_per_jiffy = loops_per_jiffy;
> early_ioremap_init();
>
> setup_olpc_ofw_pgd();

That could work.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/