From patchwork Thu Nov 5 23:14:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 57943 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA5NEiHq017767 for ; Thu, 5 Nov 2009 23:14:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756462AbZKEXOi (ORCPT ); Thu, 5 Nov 2009 18:14:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758390AbZKEXOi (ORCPT ); Thu, 5 Nov 2009 18:14:38 -0500 Received: from 124x34x33x190.ap124.ftth.ucom.ne.jp ([124.34.33.190]:42791 "EHLO master.linux-sh.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756462AbZKEXOi (ORCPT ); Thu, 5 Nov 2009 18:14:38 -0500 Received: from localhost (unknown [127.0.0.1]) by master.linux-sh.org (Postfix) with ESMTP id 0FD546375A; Thu, 5 Nov 2009 23:14:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at linux-sh.org Received: from master.linux-sh.org ([127.0.0.1]) by localhost (master.linux-sh.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fQ8GLufKrR7z; Fri, 6 Nov 2009 08:14:20 +0900 (JST) Received: from localhost (82-38-64-26.cable.ubr06.brad.blueyonder.co.uk [82.38.64.26]) by master.linux-sh.org (Postfix) with ESMTP id 9B94F63758; Fri, 6 Nov 2009 08:14:19 +0900 (JST) From: Matt Fleming To: Paul Mundt Cc: linux-sh@vger.kernel.org Subject: [PATCH] sh: Account for cache aliases in flush_icache_range() Date: Thu, 5 Nov 2009 23:14:39 +0000 Message-Id: <1257462879-16865-1-git-send-email-matt@console-pimps.org> X-Mailer: git-send-email 1.6.2.5 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index b5abe94..6bfd08d 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c @@ -65,6 +65,7 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args) for (v = start; v < end; v += L1_CACHE_BYTES) { unsigned long icacheaddr; + int j, n; __ocbwb(v); @@ -72,8 +73,10 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args) cpu_data->icache.entry_mask); /* Clear i-cache line valid-bit */ + n = boot_cpu_data.icache.n_aliases; for (i = 0; i < cpu_data->icache.ways; i++) { - __raw_writel(0, icacheaddr); + for (j = 0; j < n; j++) + __raw_writel(0, icacheaddr + (j * PAGE_SIZE)); icacheaddr += cpu_data->icache.way_incr; } }