Skip to content

Commit 78f824d

Browse files
committed
ARCv2: smp-boot: wake_flag polling by non-Masters needs to be uncached
This is needed on HS38 cores, for setting up IO-Coherency aperture properly The polling could perturb the caches and coherecy fabric which could be wrong in the small window when Master is setting up IOC aperture etc in arc_cache_init() We do it only for ARCv2 based builds to not affect EZChip ARCompact based platform. Signed-off-by: Vineet Gupta <[email protected]>
1 parent bf02454 commit 78f824d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

arch/arc/kernel/smp.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,23 @@ void __init smp_cpus_done(unsigned int max_cpus)
9090
*/
9191
static volatile int wake_flag;
9292

93+
#ifdef CONFIG_ISA_ARCOMPACT
94+
95+
#define __boot_read(f) f
96+
#define __boot_write(f, v) f = v
97+
98+
#else
99+
100+
#define __boot_read(f) arc_read_uncached_32(&f)
101+
#define __boot_write(f, v) arc_write_uncached_32(&f, v)
102+
103+
#endif
104+
93105
static void arc_default_smp_cpu_kick(int cpu, unsigned long pc)
94106
{
95107
BUG_ON(cpu == 0);
96-
wake_flag = cpu;
108+
109+
__boot_write(wake_flag, cpu);
97110
}
98111

99112
void arc_platform_smp_wait_to_boot(int cpu)
@@ -102,10 +115,10 @@ void arc_platform_smp_wait_to_boot(int cpu)
102115
if (IS_ENABLED(CONFIG_ARC_SMP_HALT_ON_RESET))
103116
return;
104117

105-
while (wake_flag != cpu)
118+
while (__boot_read(wake_flag) != cpu)
106119
;
107120

108-
wake_flag = 0;
121+
__boot_write(wake_flag, 0);
109122
}
110123

111124
const char *arc_platform_smp_cpuinfo(void)

0 commit comments

Comments
 (0)