Skip to content

Commit 06a81c1

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Fix tegra194-cpufreq module build failure caused by __cpu_logical_map not being exported. - Improve fixed_addresses comment regarding the fixmap buffer sizes. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Fix __cpu_logical_map undefined issue arm64/fixmap: make notes of fixed_addresses more precisely
2 parents 11030fe + eaecca9 commit 06a81c1

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

arch/arm64/include/asm/fixmap.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
* compile time, but to set the physical address only
2929
* in the boot process.
3030
*
31-
* These 'compile-time allocated' memory buffers are
32-
* page-sized. Use set_fixmap(idx,phys) to associate
33-
* physical memory with fixmap indices.
34-
*
31+
* Each enum increment in these 'compile-time allocated'
32+
* memory buffers is page-sized. Use set_fixmap(idx,phys)
33+
* to associate physical memory with a fixmap index.
3534
*/
3635
enum fixed_addresses {
3736
FIX_HOLE,

arch/arm64/include/asm/smp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
4646
* Logical CPU mapping.
4747
*/
4848
extern u64 __cpu_logical_map[NR_CPUS];
49-
#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
49+
extern u64 cpu_logical_map(int cpu);
50+
51+
static inline void set_cpu_logical_map(int cpu, u64 hwid)
52+
{
53+
__cpu_logical_map[cpu] = hwid;
54+
}
5055

5156
struct seq_file;
5257

arch/arm64/kernel/setup.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ u64 __cacheline_aligned boot_args[4];
8585
void __init smp_setup_processor_id(void)
8686
{
8787
u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
88-
cpu_logical_map(0) = mpidr;
88+
set_cpu_logical_map(0, mpidr);
8989

9090
/*
9191
* clear __my_cpu_offset on boot CPU to avoid hang caused by
@@ -276,6 +276,12 @@ arch_initcall(reserve_memblock_reserved_regions);
276276

277277
u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
278278

279+
u64 cpu_logical_map(int cpu)
280+
{
281+
return __cpu_logical_map[cpu];
282+
}
283+
EXPORT_SYMBOL_GPL(cpu_logical_map);
284+
279285
void __init __no_sanitize_address setup_arch(char **cmdline_p)
280286
{
281287
init_mm.start_code = (unsigned long) _text;

arch/arm64/kernel/smp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
566566
return;
567567

568568
/* map the logical cpu id to cpu MPIDR */
569-
cpu_logical_map(cpu_count) = hwid;
569+
set_cpu_logical_map(cpu_count, hwid);
570570

571571
cpu_madt_gicc[cpu_count] = *processor;
572572

@@ -680,7 +680,7 @@ static void __init of_parse_and_init_cpus(void)
680680
goto next;
681681

682682
pr_debug("cpu logical map 0x%llx\n", hwid);
683-
cpu_logical_map(cpu_count) = hwid;
683+
set_cpu_logical_map(cpu_count, hwid);
684684

685685
early_map_cpu_to_node(cpu_count, of_node_to_nid(dn));
686686
next:
@@ -721,7 +721,7 @@ void __init smp_init_cpus(void)
721721
for (i = 1; i < nr_cpu_ids; i++) {
722722
if (cpu_logical_map(i) != INVALID_HWID) {
723723
if (smp_cpu_setup(i))
724-
cpu_logical_map(i) = INVALID_HWID;
724+
set_cpu_logical_map(i, INVALID_HWID);
725725
}
726726
}
727727
}

0 commit comments

Comments
 (0)