Skip to content

Commit

Permalink
MIPS: MIPSxx SC: Avoid destructive invalidation on partial L2 cacheli…
Browse files Browse the repository at this point in the history
…nes.

This extends commit a8ca8b6 to cover
MIPSxx-style board cache code.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Kevin Cernekee authored and Ralf Baechle committed Sep 30, 2009
1 parent a648e81 commit 96983ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/mips/mm/sc-mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ static void mips_sc_wback_inv(unsigned long addr, unsigned long size)
*/
static void mips_sc_inv(unsigned long addr, unsigned long size)
{
unsigned long lsize = cpu_scache_line_size();
unsigned long almask = ~(lsize - 1);

cache_op(Hit_Writeback_Inv_SD, addr & almask);
cache_op(Hit_Writeback_Inv_SD, (addr + size - 1) & almask);
blast_inv_scache_range(addr, addr + size);
}

Expand Down

0 comments on commit 96983ff

Please sign in to comment.