Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752957AbdFSXiR (ORCPT ); Mon, 19 Jun 2017 19:38:17 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58730 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752750AbdFSXg5 (ORCPT ); Mon, 19 Jun 2017 19:36:57 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C168060799 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org Date: Mon, 19 Jun 2017 16:36:55 -0700 From: Stephen Boyd To: Leo Yan Cc: Wei Xu , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Michael Turquette , Zhangfei Gao , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Guodong Xu , Haojian Zhuang Subject: Re: [PATCH v3 1/2] clk: Hi3660: register fixed_rate_clks with CLK_OF_DECLARE_DRIVER Message-ID: <20170619233655.GR20170@codeaurora.org> References: <1495428748-11153-1-git-send-email-leo.yan@linaro.org> <1495428748-11153-2-git-send-email-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495428748-11153-2-git-send-email-leo.yan@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1476 Lines: 34 On 05/22, Leo Yan wrote: > The timer will register into system at very early phase at kernel boot; > if timer needs to use clock, the clock should be get ready in function > of_clk_init() so later the timer driver probe can retrieve clock > successfully. This is finished in below flow on arm64: > > start_kernel() > `-> time_init() > `-> of_clk_init(NULL) => register timer's clock > `-> clocksource_probe() => register timer > > On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered > as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result, > sp804 timer probe returns failure due if cannot bind clock properly. > > To fix the failure, this patch is to split crgctrl clocks into two > subsets. One part is for fixed_rate_clks which includes pre-defined > fixed rate clocks, and "osc32k" clock is in this category; So we change > their registration to CLK_OF_DECLARE_DRIVER method, as result the clocks > can be registered ahead with function of_clk_init() and timer driver can > bind timer clock successfully; the rest of the crgctrl clocks are still > registered by the probe of the platform driver. > > This patch also adds checking for all crgctrl clocks registration and > print out log if any clock has failure. > > Signed-off-by: Leo Yan > --- Applied to clk-next -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project