Skip to content

Commit

Permalink
ARCv2: smp-boot: wake_flag polling by non-Masters needs to be uncached
Browse files Browse the repository at this point in the history
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 <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Jan 24, 2017
1 parent bf02454 commit 78f824d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions arch/arc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,23 @@ void __init smp_cpus_done(unsigned int max_cpus)
*/
static volatile int wake_flag;

#ifdef CONFIG_ISA_ARCOMPACT

#define __boot_read(f) f
#define __boot_write(f, v) f = v

#else

#define __boot_read(f) arc_read_uncached_32(&f)
#define __boot_write(f, v) arc_write_uncached_32(&f, v)

#endif

static void arc_default_smp_cpu_kick(int cpu, unsigned long pc)
{
BUG_ON(cpu == 0);
wake_flag = cpu;

__boot_write(wake_flag, cpu);
}

void arc_platform_smp_wait_to_boot(int cpu)
Expand All @@ -102,10 +115,10 @@ void arc_platform_smp_wait_to_boot(int cpu)
if (IS_ENABLED(CONFIG_ARC_SMP_HALT_ON_RESET))
return;

while (wake_flag != cpu)
while (__boot_read(wake_flag) != cpu)
;

wake_flag = 0;
__boot_write(wake_flag, 0);
}

const char *arc_platform_smp_cpuinfo(void)
Expand Down

0 comments on commit 78f824d

Please sign in to comment.