[Top] [All Lists]

Re: [PATCH] Introduce mips_late_time_init

To: David Daney <>
Subject: Re: [PATCH] Introduce mips_late_time_init
From: Ralf Baechle <>
Date: Wed, 8 Dec 2010 20:37:04 +0000
Cc: Anoop P A <>,,,, Thomas Gleixner <>
In-reply-to: <>
Original-recipient: rfc822;
References: <1291623812.31822.6.camel@paanoop1-desktop> <>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Dec 06, 2010 at 09:42:45AM -0800, David Daney wrote:

> On 12/06/2010 12:23 AM, Anoop P A wrote:
> >This patch moves plat_time_init and clocksoure init funtion calls to
> >late_time_init.
> >
> Why would you want to do this?
> The current code works perfectly, so I see no reason to change it.

Well, not really.  By the time time_init is called kmalloc isn't ready yet.
That's why mips_clockevent_device pretty much had to be statically
allocated and is also why interrupts have to use setup_irq instead of

Keeping mips_clockevent_device statically allocated as per-CPU makes sense.
Less for the struct irqaction and he'll have to allocate one for each
VPE (think CPU) he installs a clockevent device on.

Running everything from late_time_init() instead allows the use of kmalloc.
X86 has the same issue with requiring kmalloc in time_init which is why
they had moved everything to late_time_init.

So the real question is, why can't we just move the call of time_init()
in setup_kernel() to where late_time_init() is getting called from for
all architectures, does anything rely on it getting called early?


<Prev in Thread] Current Thread [Next in Thread>