linux-mips
[Top] [All Lists]

Re: Tracking down exception in sched.c

To: "Kevin D. Kissell" <kevink@mips.com>
Subject: Re: Tracking down exception in sched.c
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 21 Feb 2006 01:46:08 +0000
Cc: Rojhalat Ibrahim <imr@rtschenk.de>, Mark E Mason <mark.e.mason@broadcom.com>, linux-mips@linux-mips.org
In-reply-to: <43FA263B.9030601@mips.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <7E000E7F06B05C49BDBB769ADAF44D0773A636@NT-SJCA-0750.brcm.ad.broadcom.com> <43F9B168.6090105@rtschenk.de> <43F9C58E.4020606@mips.com> <43F9D215.3090506@rtschenk.de> <003c01c6362d$53ea4c90$10eca8c0@grendel> <43FA263B.9030601@mips.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Mon, Feb 20, 2006 at 09:27:39PM +0100, Kevin D. Kissell wrote:

> But apparently current sources no longer even invoke prom_build_cpu_map(),
> having merged that functionality with prom_prepare_cpus(). It looks to me
> as if calling prom_prepare_cpus() from smp_prepare_boot_cpu() as in the
> patch below, should do the right thing in all current cases, but it *is*
> standing the SMP  startup  logic a bit on its head.  Maybe this is why
> prom_build_cpu_map() had a separate existence in the first place...

Primarily historic reasons actuall.  In 2.4 mips and mips64 used to be
separate and evolution did diverge a bit in the SMP area and this is the
radioactive fallout from it ;-)

> @@ -251,6 +250,8 @@ void __devinit smp_prepare_boot_cpu(void
>         cpu_set(0, phys_cpu_present_map);
>         cpu_set(0, cpu_online_map);
>         cpu_set(0, cpu_callin_map);
> +       /* This is done early to populate phys_cpu_present_map for 
> sched_init */
> +       prom_prepare_cpus(max_cpus);
>  }

Which won't compile because smp_prepare_boot_cpu doesn't define max_cpus.

Anyway, prom_prepare_cpus was running very late and in the past that
was causing problems with firmware which relies on it's mappings still
being alive while the machine had already been taken over by Linux.  The
patch which I cooked up - and haven't yet been able to test yet since my
barrel of midnight oil is about to run out - is calling it from
setup_arch().

  Ralf

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