From patchwork Mon May 8 12:32:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 98819 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1304117qge; Mon, 8 May 2017 05:32:48 -0700 (PDT) X-Received: by 10.98.198.4 with SMTP id m4mr32029231pfg.160.1494246768234; Mon, 08 May 2017 05:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494246768; cv=none; d=google.com; s=arc-20160816; b=VEyEKoJTVEcoQNG04kumgTlXkey64CrTNu4lucTyi8fr+TbPnW1++3x0NUg6JfuQ9p tScXUSMWb092+YKNjia/OndmkVC5vIAjZo96TjNMXnv1Ud8s4k7u2+2/zKU3/jrB+vlI E4e9lQXkZmtmo9KvC5ym0D1C3fIi5CzpQ9ahRgtFTijvXS+W0yHjrjmb5WQ/WA0snmVy 1xbq46QUTvzKz2rlZWPN0qGh+ypJFYlURqsl1MN3h6VFIzQ01z8oBG+hZnqqbt1bMapF lw6DUfMf1f0hCYKPhIATgim9Ls5LNnS2tb6r/VijLnukyva7qnGE8v7hWPiXFAFcQfVc uh8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CJRSeybMNkLLEeEli3BSLI+drke+1TsFRRlzgvTs7ns=; b=NMMlgl5WEERgRNiatwG7+XSMi9sn3TyTHNsKyEA7YQXBfx+VVbXmf3/Yrixk/PFi4l wjk8j6Yjue/FNHbpYd+jZgPUOsUwpj5c0j80chjU61Y9Il87q+/uQTvusXij0qxftU7d Zr2a8h8iCCv2fG+VKHMagrwktfYVUebwCn1rLOftIkgj7uV+x63PNbH++jmp2IjNkSoE DW0ip5YbcSP9ohw4DM/bI4s6e4MjoUwvqQYB5tloWkv97Epw+jx4HEChaeC+DS4YqvAF pJ8Ao4+f2/kmyzc7i0PyyBBAOOS11YjfTXQq+lqPz8gGJd8eQwg73KX8Z9aJlmr0s4bT DVSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si9790870pgn.392.2017.05.08.05.32.47; Mon, 08 May 2017 05:32:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754714AbdEHMcl (ORCPT + 25 others); Mon, 8 May 2017 08:32:41 -0400 Received: from foss.arm.com ([217.140.101.70]:42126 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdEHMck (ORCPT ); Mon, 8 May 2017 08:32:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 607951516; Mon, 8 May 2017 05:32:34 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3A14C3F220; Mon, 8 May 2017 05:32:33 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Thomas Gleixner , Daniel Lezcano , Mark Rutland , Marc Zyngier Subject: [PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame Date: Mon, 8 May 2017 13:32:27 +0100 Message-Id: <1494246747-17267-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org arch_timer_mem_find_best_frame looks through ARCH_TIMER_MEM_MAX_FRAMES frames even after finding matches to ensure the best frame is chosen, which means the variable frame will point to the last valid frame but not necessarily the best frame. On Juno, we get the following error as wrong frame is returned as the best frame from arch_timer_mem_find_best_frame: " arch_timer: Unable to map frame @ 0x0000000000000000 arch_timer: Frame missing phys irq. Failed to initialize '/timer@2a810000': -22 " This patch fixes the issue by correctly returning the best frame from arch_timer_mem_find_best_frame. Fixes: c389d701dfb7 ("clocksource: arm_arch_timer: split MMIO timer probing.") Signed-off-by: Sudeep Holla Cc: Mark Rutland Cc: Marc Zyngier --- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 Acked-by: Mark Rutland diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index a1fb918b8021..4bed671e490e 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -1268,7 +1268,7 @@ arch_timer_mem_find_best_frame(struct arch_timer_mem *timer_mem) pr_err("Unable to find a suitable frame in timer @ %pa\n", &timer_mem->cntctlbase); - return frame; + return best_frame; } static int __init