From patchwork Sun Dec 28 14:20:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 42634 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F3B3B25B8B for ; Sun, 28 Dec 2014 14:20:56 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf7339316lbv.1 for ; Sun, 28 Dec 2014 06:20:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=imFlOVywEPDk97pD6t+roIuzRdT82AYEkPsLT07aqCU=; b=aWbOiCE4I7tuN74KjvT/Xb14gn7DHzAlbAjM1ENnBQ0qebIWJp1bh61ah/OtCoHRAj psd5K+aR6EgziM91UVqmwmPSBuKvPuVCBVEH8FWSlYyQd+aYE07OU/T+3LUnUqqMW0cc u410LCCFgSIJ799tk4a2rduxDuxdNVLB9Xv2cpcVJnTKncOjcijYTXoitPxcnniOq6Lu YpImg/D6uB8wJ9HtCqqvRJvGN818uP9F0+XFPFA63oL+s9zOA6iQp2SMR/3xiDX3aToV Vh3vU4H0Ly/JgczbPdcOsiFxj9EUBV4hCSYfAxFbvfILA48wn9NkRGPEZ6kRFcb98bqh x+jQ== X-Gm-Message-State: ALoCoQktye6HldmaHoJHNJ9QcSsbbB2/+C9iAttac72SRTSaIHgUYYMAx7AaCy4wJETsDaoiOv1t X-Received: by 10.180.108.101 with SMTP id hj5mr5351694wib.3.1419776455440; Sun, 28 Dec 2014 06:20:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.203 with SMTP id ug11ls619909lac.67.gmail; Sun, 28 Dec 2014 06:20:55 -0800 (PST) X-Received: by 10.152.37.74 with SMTP id w10mr52302843laj.85.1419776455181; Sun, 28 Dec 2014 06:20:55 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id c4si36612436lbv.53.2014.12.28.06.20.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Dec 2014 06:20:55 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so11128973lbj.27 for ; Sun, 28 Dec 2014 06:20:55 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr52145284lal.29.1419776455049; Sun, 28 Dec 2014 06:20:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp2555847lbb; Sun, 28 Dec 2014 06:20:54 -0800 (PST) X-Received: by 10.70.90.209 with SMTP id by17mr83539787pdb.162.1419776453244; Sun, 28 Dec 2014 06:20:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ux2si49218989pbc.55.2014.12.28.06.20.52; Sun, 28 Dec 2014 06:20:53 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751867AbaL1OUe (ORCPT + 27 others); Sun, 28 Dec 2014 09:20:34 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:44437 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751824AbaL1OU3 (ORCPT ); Sun, 28 Dec 2014 09:20:29 -0500 Received: by mail-la0-f44.google.com with SMTP id gd6so10444843lab.3 for ; Sun, 28 Dec 2014 06:20:27 -0800 (PST) X-Received: by 10.112.51.44 with SMTP id h12mr52172179lbo.5.1419776427706; Sun, 28 Dec 2014 06:20:27 -0800 (PST) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id b4sm9267771lbp.17.2014.12.28.06.20.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Dec 2014 06:20:26 -0800 (PST) From: Christoffer Dall To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Christoffer Dall , Sonny Rao , Catalin Marinas , Daniel Lezcano , Olof Johansson , Mark Rutland , Marc Zyngier , Yingjoe Chen Subject: [PATCH] clocksource: arch_timer: Fix arm64 platforms not booting Date: Sun, 28 Dec 2014 15:20:31 +0100 Message-Id: <1419776431-26217-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 0b46b8a718c6e ("clocksource: arch_timer: Fix code to...") fixes timer issues with certain ARMv7 platforms, but unfortunately breaks arm64 platforms with hyp mode (EL2) enabled. The commit only sets arch_timer_use_virtual to false under CONFIG_ARM, but forgets that the config variable is also set in other code paths (actually, right underneath the check in the patch) with detrimental consequences as we've now introduced a direct early call to BUG() on practically all arm64 platforms. One could argue that this code could be refactored to use different variables for checking which *timer* to use and which *counter* to use, which seems to be the desired difference between ARM and arm64 in this case, but this approach fixes an urgent issue for now. Cc: Sonny Rao Cc: Catalin Marinas Cc: Daniel Lezcano Cc: Olof Johansson Cc: Mark Rutland Cc: Catalin Marinas Cc: Marc Zyngier Cc: Yingjoe Chen Signed-off-by: Christoffer Dall --- This was apparently already discovered by Yingjoe Chen in this thread https://lkml.org/lkml/2014/11/24/41 and Catalin recommended a similar fix. drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 6a79fc4..095c177 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -462,7 +462,7 @@ static void __init arch_counter_register(unsigned type) /* Register the CP15 based counter if we have one */ if (type & ARCH_CP15_TIMER) { - if (arch_timer_use_virtual) + if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual) arch_timer_read_counter = arch_counter_get_cntvct; else arch_timer_read_counter = arch_counter_get_cntpct;