Skip to content
Commit c969cb20 authored by James Morse's avatar James Morse
Browse files

drivers: base: Use present CPUs in GENERIC_CPU_DEVICES



ia64 and x86 only create sysfs entries using register_cpu() for present
CPUs, whereas GENERIC_CPU_DEVICES does this for possible CPUs.

To allow all the ACPI architectures to use GENERIC_CPU_DEVICES, change
it to use for_each_present_cpu().

The following architectures use GENERIC_CPU_DEVICES but are not SMP,
so possible == present:
 * h8300
 * m68k
 * microblaze
 * nds32
 * nios2
 * um

The following architectures use GENERIC_CPU_DEVICES and consider
possible == present:
 * csky: setup_smp()
 * hexagon: compare smp_start_cpus() and smp_prepare_cpus()
 * openrisc: smp_prepare_cpus()

Those others using GENERIC_CPU_DEVICES of note:
openrisc. smp_init_cpus() makes all CPUs < NR_CPUS possible, whereas
smp_prepare_cpus() only makes CPUs < setup_max_cpus present. After this
change, openrisc systems that boot with max_cpus=1 would not see other
CPUs present in sysfs. This should not be a problem as these CPUs can't
bre brought online as _cpu_up() checks cpu_present().

parisc. processor_probe() makes all CPUs present and brings them online.
The cpu_possible_mask is initialised by INIT_ALL_POSSIBLE. After this
change, parisc systems will only show CPUs that exist.

Signed-off-by: James Morse's avatarJames Morse <james.morse@arm.com>
parent 0d02ec6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment