From patchwork Sun Jul 28 05:46:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 2834670 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 20F999F4E2 for ; Sun, 28 Jul 2013 05:46:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F2982013D for ; Sun, 28 Jul 2013 05:46:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48B1820138 for ; Sun, 28 Jul 2013 05:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752863Ab3G1FqH (ORCPT ); Sun, 28 Jul 2013 01:46:07 -0400 Received: from utopia.booyaka.com ([74.50.51.50]:39725 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752179Ab3G1FqF (ORCPT ); Sun, 28 Jul 2013 01:46:05 -0400 Received: (qmail 26525 invoked by uid 1019); 28 Jul 2013 05:46:05 -0000 Date: Sun, 28 Jul 2013 05:46:05 +0000 (UTC) From: Paul Walmsley To: Will Deacon cc: Santosh Shilimkar , Russell King - ARM Linux , Rajendra Nayak , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: [PATCH] ARM: v6: avoid remaining accesses to missing CP15 registers on ARM1136 r0 In-Reply-To: Message-ID: References: <20130722184325.GA21614@n2100.arm.linux.org.uk> <51EE2AA7.5060503@ti.com> <51EE474D.5070804@ti.com> <20130724135617.GI11072@mudshark.cambridge.arm.com> <51EFE1DD.8070801@ti.com> <20130724142059.GJ11072@mudshark.cambridge.arm.com> <20130727122221.GB6618@mudshark.cambridge.arm.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Ensure that the remaining callers of read_cpuid_ext can't attempt an extended CP15 register read on ARMv6. The only one that appears dodgy is tlb_ops_need_broadcast(). While here, convert feat_v6_fixup() to use cpu_is_arm1136_r0() to save a few lines of code. Signed-off-by: Paul Walmsley Cc: Will Deacon Cc: Russell King --- Intended for v3.12. Depends on the patch "ARM: v6: avoid read_cpuid_ext() on ARM1136r0 in cache_ops_need_broadcast()". Tested (along with the parent patch) here: http://www.pwsan.com/omap/testlogs/bisect_2430sdp_hang_v3.11-rc/20130727224434/README.txt against stock v3.11-rc2, so several boards aren't booting due to unrelated issues. arch/arm/include/asm/smp_plat.h | 3 +++ arch/arm/kernel/setup.c | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h index 76214cb..ad07564 100644 --- a/arch/arm/include/asm/smp_plat.h +++ b/arch/arm/include/asm/smp_plat.h @@ -30,6 +30,9 @@ static inline bool is_smp(void) #else static inline int tlb_ops_need_broadcast(void) { + if (cpu_is_arm1136_r0()) + return 0; + if (!is_smp()) return 0; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 63af9a7..a601843 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -389,16 +389,11 @@ static void __init cpuid_init_hwcaps(void) static void __init feat_v6_fixup(void) { - int id = read_cpuid_id(); - - if ((id & 0xff0f0000) != 0x41070000) - return; - /* * HWCAP_TLS is available only on 1136 r1p0 and later, * see also kuser_get_tls_init. */ - if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0)) + if (cpu_is_arm1136_r0()) elf_hwcap &= ~HWCAP_TLS; }