From patchwork Sun Oct 19 15:22:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 39024 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B1CE020534 for ; Sun, 19 Oct 2014 15:23:50 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b57sf1789635eek.4 for ; Sun, 19 Oct 2014 08:23:49 -0700 (PDT) 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=pWwc5RBopvofcNwIgHcTQtGe3NQ1/S/VkxMXCG0OFRk=; b=Ne4Dm8Ea704q9klmEMdSGPW1OWXo2RHD2bm7LsOxBSzmhaOwPBKKRpp+aGlQj24aYF z7Mimw4aWpkFqzFCXu3fKB0meohnyOjaQZOR4++DlWbUlE10iVqWkR1jci4tv20jKg4/ TpAuSL9gS+IgapZZJnZrY0XZ5CLMxsrKh5uJQULHzkZDbBUgNMgBzXu89xQNZSgidikW Te0w8116xSSgaCpQ8HkfVrB7mCXRvvczkZfnXrz66RQ52TAi2c4szgReEyzoKjyOgvnF PBxzzNcGKYw8GuE38POX8MFkdrXSxMPC70Kv2KA5fzEu1o8t5RMiOR46nE/UEWlIBre5 wLog== X-Gm-Message-State: ALoCoQnnCAr18oeMjYupN8y0VxDivDmRIiRj624cIx1w+W4S5nhPDHoGeGzLJ2dm6MBZ+ZwuDnUm X-Received: by 10.180.105.74 with SMTP id gk10mr2412012wib.0.1413732229830; Sun, 19 Oct 2014 08:23:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.68 with SMTP id p4ls373108laa.52.gmail; Sun, 19 Oct 2014 08:23:49 -0700 (PDT) X-Received: by 10.152.115.131 with SMTP id jo3mr21594164lab.20.1413732229610; Sun, 19 Oct 2014 08:23:49 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id ay3si10651002lbc.4.2014.10.19.08.23.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 19 Oct 2014 08:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so2750081lbv.33 for ; Sun, 19 Oct 2014 08:23:49 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr21385842lbc.23.1413732229451; Sun, 19 Oct 2014 08:23:49 -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 c5csp177789lbz; Sun, 19 Oct 2014 08:23:48 -0700 (PDT) X-Received: by 10.66.140.8 with SMTP id rc8mr21794735pab.83.1413732227984; Sun, 19 Oct 2014 08:23:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yt3si5645230pbc.100.2014.10.19.08.23.47 for ; Sun, 19 Oct 2014 08:23:47 -0700 (PDT) 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 S1751581AbaJSPXo (ORCPT + 27 others); Sun, 19 Oct 2014 11:23:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46495 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbaJSPXn (ORCPT ); Sun, 19 Oct 2014 11:23:43 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9JFN8xD009039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 19 Oct 2014 11:23:08 -0400 Received: from deneb.redhat.com (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9JFN7dU009887; Sun, 19 Oct 2014 11:23:07 -0400 From: Mark Salter To: Daniel Lezcano , Sudeep Holla Cc: Thomas Gleixner , Stephen Boyd , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Salter Subject: [PATCH] clocksource: arm_arch_timer: fix system hang Date: Sun, 19 Oct 2014 11:22:44 -0400 Message-Id: <1413732164-19545-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 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: msalter@redhat.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.174 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: , Arm allows for two possible architectural clock sources. One memory mapped and the other coprocessor based. If both timers exist, then the driver waits for both to be probed before registering a clocksource. Commit c387f07e6205 ("clocksource: arm_arch_timer: Discard unavailable timers correctly") attempted to fix a hang occurring when one of the two possible timers had a device node, but was disabled. In that case, the second probe would never occur and the system would hang without a clocksource being registered. Unfortunately, incorrect logic in that commit made things worse such that a hang would occur unless both timers had a device node and were enabled. This patch fixes the logic so that we don't wait to probe a second timer unless it exists and is enabled. Signed-off-by: Mark Salter --- drivers/clocksource/arm_arch_timer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index d1a5e35..b73392b 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -666,13 +666,14 @@ 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; - of_node_put(dn); - + if (dn) { + if (of_device_is_available(dn) && !(arch_timers_present & type)) + probed = false; + of_node_put(dn); + } return probed; }