From patchwork Mon Jul 15 20:42:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 2827743 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9109C0AB2 for ; Mon, 15 Jul 2013 20:43:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB92A2027E for ; Mon, 15 Jul 2013 20:43:09 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 233CB20263 for ; Mon, 15 Jul 2013 20:43:08 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uypbo-0006CS-U4; Mon, 15 Jul 2013 20:43:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uypbm-00088Q-C9; Mon, 15 Jul 2013 20:42:58 +0000 Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uypbi-00087I-KC for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2013 20:42:55 +0000 Received: by mail-ob0-f169.google.com with SMTP id up14so14534242obb.0 for ; Mon, 15 Jul 2013 13:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=F1ePiQZpKYoRv9d8LPFtVOGedwsceYjl3bPbAqkG6sE=; b=qBBaQKmUKjIyimxPSEqmVL+qjKcXzGeJ2eUqmcGBqx+yjJWjAYsOhHH4N4FjFuDGAe 9iDlX3mAKVbfxIAlDKXVX7RJ/ll8p0QDc//Aa0dLKWwGFuwwvS+lP/dIEUv3bbh1CivI Llg1veksp2dHiKmZESvdphgXjE/7uMZeCIK3OhQWmksZfOP+BU3R3ZMWyoOraSfw/kR3 y8UfHaEIDtJ+0PY7kcdGQONbYRmmhXddl/kMKYFEJj0tYM9NthbEYpV/RC6himoON61p PCi30kmUrXOoz7HxhkdW/q5eZF9pAz71MpTMjr/AkR3TvlQE9ZxdmylQ4EDO1oW3Iv8y dZGg== X-Received: by 10.60.164.33 with SMTP id yn1mr45175958oeb.5.1373920953278; Mon, 15 Jul 2013 13:42:33 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPSA id tv3sm69752996obb.8.2013.07.15.13.42.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 13:42:32 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: Add check for Cortex-A15 errata 798181 ECO Date: Mon, 15 Jul 2013 15:42:23 -0500 Message-Id: <1373920943-18308-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130715_164254_721158_E83A30FD X-CRM114-Status: GOOD ( 13.72 ) X-Spam-Score: -1.8 (-) Cc: will.deacon@arm.com, andre.przywara@calxeda.com, Russell King , Rob Herring , Mark Langsdorf X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rob Herring The work-around for A15 errata 798181 is not needed if appropriate ECO fixes have been applied to r3p2 and earlier core revisions. This can be checked by reading REVIDR register bits 4 and 9. If only bit 4 is set, then the IPI broadcast can be skipped. Signed-off-by: Rob Herring --- Compile tested only. arch/arm/include/asm/cputype.h | 1 + arch/arm/kernel/smp_tlb.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index ec635ff..ac1c46a 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h @@ -9,6 +9,7 @@ #define CPUID_TCM 2 #define CPUID_TLBTYPE 3 #define CPUID_MPIDR 5 +#define CPUID_REVIDR 6 #ifdef CONFIG_CPU_V7M #define CPUID_EXT_PFR0 0x40 diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 9a52a07..7fd64b7 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -74,10 +74,21 @@ static inline void ipi_flush_bp_all(void *ignored) static int erratum_a15_798181(void) { unsigned int midr = read_cpuid_id(); + unsigned int revidr; /* Cortex-A15 r0p0..r3p2 affected */ if ((midr & 0xff0ffff0) != 0x410fc0f0 || midr > 0x413fc0f2) return 0; + + /* Check for Cortex A15 <= r3p2 with ECO fix */ + revidr = read_cpuid(CPUID_REVIDR); + if ((revidr & 0x210) == 0x210) + return 0; + + dummy_flush_tlb_a15_erratum(); + if (revidr & 0x10) + return 0; + return 1; } #else @@ -97,7 +108,6 @@ static void broadcast_tlb_a15_erratum(void) if (!erratum_a15_798181()) return; - dummy_flush_tlb_a15_erratum(); smp_call_function(ipi_flush_tlb_a15_erratum, NULL, 1); } @@ -109,7 +119,6 @@ static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm) if (!erratum_a15_798181()) return; - dummy_flush_tlb_a15_erratum(); this_cpu = get_cpu(); for_each_online_cpu(cpu) { if (cpu == this_cpu)