Skip to content

Commit

Permalink
Blackfin: SMP: flush CoreB cache when shutting down
Browse files Browse the repository at this point in the history
When CoreB wakes up, it needs to read variables that CoreA might have
modified, and might be in CoreB's cache.  So kill CoreB's cache before
going to sleep so that when we wake up, we are in a coherent state.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Graf Yang authored and Mike Frysinger committed Mar 23, 2011
1 parent f741a79 commit 1e924e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/blackfin/mach-bf561/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@

#include <linux/smp.h>
#include <asm/blackfin.h>
#include <asm/cacheflush.h>
#include <mach/pll.h>

int hotplug_coreb;

void platform_cpu_die(void)
{
unsigned long iwr;

hotplug_coreb = 1;

/*
* When CoreB wakes up, the code in _coreb_trampoline_start cannot
* turn off the data cache. This causes the CoreB failed to boot.
* As a workaround, we invalidate all the data cache before sleep.
*/
blackfin_invalidate_entire_dcache();

/* disable core timer */
bfin_write_TCNTL(0);

Expand Down

0 comments on commit 1e924e2

Please sign in to comment.