From patchwork Thu Oct 23 17:32:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 5142301 Return-Path: X-Original-To: patchwork-linux-arm@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 7D9959F349 for ; Thu, 23 Oct 2014 17:35:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A27D1201FB for ; Thu, 23 Oct 2014 17:35:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 808DD20204 for ; Thu, 23 Oct 2014 17:35:15 +0000 (UTC) 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 1XhMGC-0002fG-1o; Thu, 23 Oct 2014 17:33:16 +0000 Received: from galahad.ideasonboard.com ([185.26.127.97]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XhMG8-0002aF-My for linux-arm-kernel@lists.infradead.org; Thu, 23 Oct 2014 17:33:13 +0000 Received: from avalon.ideasonboard.com (dsl-hkibrasgw3-50ddcc-40.dhcp.inet.fi [80.221.204.40]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 21B9120062; Thu, 23 Oct 2014 19:30:49 +0200 (CEST) From: Laurent Pinchart To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] clocksource: arm_arch_timer: Don't wait for probe of unexisting timers Date: Thu, 23 Oct 2014 20:32:38 +0300 Message-Id: <1414085558-2148-1-git-send-email-laurent.pinchart+renesas@ideasonboard.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-20141023_103312_914321_73C6F2A7 X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.4 (-) Cc: Mark Rutland , Daniel Lezcano , Stephen Boyd , Sudeep Holla 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, 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 Commit c387f07e6205 ("clocksource: arm_arch_timer: Discard unavailable timers correctly") attempted to avoid waiting for probe of disabled timers, but got its condition check wrong and resulted in the driver waiting for probe of timers not present in DT at all. Fix it. Fixes: c387f07e6205 ("clocksource: arm_arch_timer: Discard unavailable timers correctly") Signed-off-by: Laurent Pinchart --- drivers/clocksource/arm_arch_timer.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) This patch fixes a regression introduced in v3.18-rc1. diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 2133f9d..5caf32c 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -657,17 +657,17 @@ static const struct of_device_id arch_timer_mem_of_match[] __initconst = { }; static bool __init -arch_timer_probed(int type, const struct of_device_id *matches) +arch_timer_need_probe(int type, const struct of_device_id *matches) { struct device_node *dn; - bool probed = false; + bool need_probe = false; 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)) + need_probe = true; of_node_put(dn); - return probed; + return need_probe; } static void __init arch_timer_common_init(void) @@ -676,9 +676,10 @@ static void __init arch_timer_common_init(void) /* Wait until both nodes are probed if we have two timers */ if ((arch_timers_present & mask) != mask) { - if (!arch_timer_probed(ARCH_MEM_TIMER, arch_timer_mem_of_match)) + if (arch_timer_need_probe(ARCH_MEM_TIMER, + arch_timer_mem_of_match)) return; - if (!arch_timer_probed(ARCH_CP15_TIMER, arch_timer_of_match)) + if (arch_timer_need_probe(ARCH_CP15_TIMER, arch_timer_of_match)) return; }