]> git.hungrycats.org Git - linux/commit
[PATCH] ia64: clean up acpi_boot_init()
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Thu, 28 Aug 2003 09:46:09 +0000 (02:46 -0700)
committerDavid Mosberger <davidm@tiger.hpl.hp.com>
Thu, 28 Aug 2003 09:46:09 +0000 (02:46 -0700)
commitbf8414039700548ef9b21d2e820dd4d3b26d3f89
treef7c79de230bc5bd6174580c72292d85f1c5cbe3f
parent758d297b5c99fba5624074c4c315ae8c9d90c805
[PATCH] ia64: clean up acpi_boot_init()

I was confused about this bit
of code in acpi_boot_init():

        smp_boot_data.cpu_count = available_cpus;
        if (available_cpus == 0) {
                printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
                available_cpus = 1; /* We've got at least one of these, no? */
        }

        smp_build_cpu_map();

because it first saves available cpus in smp_boot_data, then potentially
modifies available_cpus.  This looked at first like a bug, but I think
actually works out correctly, because smp_boot_data.cpu_count is only
used in smp_build_cpu_map(), and if cpu_count is zero, it prevents us
from looking at smp_boot_data.cpu_phys_id[0], which hasn't been
initialized.

This should only happen with really buggy firmware, so I'm not even
sure it's worth doing more than panicking, but if we're going to deal
with it, I propose the following patch to avoid even the appearance
of a bug.  This just does what acpi_parse_lsapic() would have done
if the firmware tables were correct.
arch/ia64/kernel/acpi.c