浏览代码

MIPS: MIPSxx SC: Avoid destructive invalidation on partial L2 cachelines.

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

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Kevin Cernekee 15 年之前
父节点
当前提交
96983ffefc
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      arch/mips/mm/sc-mips.c

+ 5 - 0
arch/mips/mm/sc-mips.c

@@ -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)
 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);
 	blast_inv_scache_range(addr, addr + size);
 }
 }