From patchwork Wed Oct 15 15:06:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 38786 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF44720C4E for ; Wed, 15 Oct 2014 15:09:15 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id m15sf861454wgh.3 for ; Wed, 15 Oct 2014 08:09:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=gVA7J97LO2cl8vah2CNALsT5x4fxxRYfxZwZ8APZ/Zc=; b=BhkqpA8O6sM/lfOLfHMWxAy57/bKJdFWDg0RaAmQXPD8Y/p611Guh09Ge/yX6QQlcI 7PTberYCqp6pIoEhKKquoG/rCHkdm868+pGGaNEdn3VIsqlSsp1nRGE9ei/RzSzmiiCQ 9pn7xwwOnigwacO093txEwN6C95WsULiHEG+ToKeqn14aSssCA3d4iFcV8O3bZOJff90 CDHjtHXY1FBolPfodZxg0gGx/zsLF5/g3iFtHIz2ycxV6LNmeVa+YiOh5imWyTwUc6VT 0RgmsvodgxSCyU8XaO8zIaNSbw4odKWVl2n+IQwrgGWY13rM0OtRnQga2Cl9DO7KV7OY x+WQ== X-Gm-Message-State: ALoCoQnVOeX8E+CR6BXQ/xPoymj02P86FCchIJCIcWfthAsvcGkiti/1HTMJM+1wx1D3Mpz3ecR2 X-Received: by 10.180.74.130 with SMTP id t2mr331920wiv.4.1413385754768; Wed, 15 Oct 2014 08:09:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.39 with SMTP id y7ls73721lag.0.gmail; Wed, 15 Oct 2014 08:09:14 -0700 (PDT) X-Received: by 10.112.35.229 with SMTP id l5mr12995603lbj.60.1413385754612; Wed, 15 Oct 2014 08:09:14 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx.google.com with ESMTPS id be18si27253951lab.113.2014.10.15.08.09.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Oct 2014 08:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so1238672lbi.9 for ; Wed, 15 Oct 2014 08:09:14 -0700 (PDT) X-Received: by 10.152.120.200 with SMTP id le8mr12672518lab.67.1413385754483; Wed, 15 Oct 2014 08:09:14 -0700 (PDT) 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.84.229 with SMTP id c5csp616734lbz; Wed, 15 Oct 2014 08:09:13 -0700 (PDT) X-Received: by 10.70.90.173 with SMTP id bx13mr13374929pdb.89.1413385752952; Wed, 15 Oct 2014 08:09:12 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id wq7si2655716pbc.257.2014.10.15.08.09.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Oct 2014 08:09:12 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XeQAW-0004NP-7o; Wed, 15 Oct 2014 15:07:16 +0000 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XeQA4-0004Jd-2q for linux-arm-kernel@lists.infradead.org; Wed, 15 Oct 2014 15:06:48 +0000 Received: from foss-smtp-na-1.foss.arm.com (unknown [10.80.61.8]) by foss-mx-na.foss.arm.com (Postfix) with ESMTP id 924E6AF; Wed, 15 Oct 2014 10:06:24 -0500 (CDT) Received: from collaborate-mta1.arm.com (highbank-bc01-b06.austin.arm.com [10.112.81.134]) by foss-smtp-na-1.foss.arm.com (Postfix) with ESMTP id 4B2C85FAD7; Wed, 15 Oct 2014 10:06:22 -0500 (CDT) Received: from e102391-lin.cambridge.arm.com (e102391-lin.cambridge.arm.com [10.1.209.143]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 048D013F806; Wed, 15 Oct 2014 10:06:20 -0500 (CDT) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH] ARM/ARM64: arch-timer: fix arch_timer_probed logic Date: Wed, 15 Oct 2014 16:06:20 +0100 Message-Id: <1413385580-23317-1-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.0.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141015_080648_128176_DE31ABA9 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Mark Rutland , Riku Voipio , Daniel Lezcano , Stephen Boyd , Sudeep Holla , Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com 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.178 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 Commit c387f07e6205 (clocksource: arm_arch_timer: Discard unavailable timers correctly) changed the way the driver makes sure both the memory and system-register timers have been probed before finalizing the probing. There is a interesting flaw in this logic that leads to this final step never to be executed. Things seems to work pretty well until something actually needs the data that is produced during this final stage. For example, KVM explodes on the first run of a guest when executed on a platform that has both memory and sysreg nodes (Juno, for example). Just fix the damned logic, and enjoy booting VMs again. Tested on a Juno system. Cc: Sudeep Holla Cc: Stephen Boyd Cc: Mark Rutland Cc: Daniel Lezcano Cc: Christoffer Dall Reported-by: Riku Voipio Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Acked-by: Sudeep Holla Tested-by: Sudeep Holla --- drivers/clocksource/arm_arch_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 2133f9d..43005d4 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -660,11 +660,11 @@ static bool __init arch_timer_probed(int type, const struct of_device_id *matches) { struct device_node *dn; - bool probed = false; + bool probed = true; dn = of_find_matching_node(NULL, matches); - if (dn && of_device_is_available(dn) && (arch_timers_present & type)) - probed = true; + if (dn && of_device_is_available(dn) && !(arch_timers_present & type)) + probed = false; of_node_put(dn); return probed;