Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbdGAAgv (ORCPT ); Fri, 30 Jun 2017 20:36:51 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43790 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbdGAAgt (ORCPT ); Fri, 30 Jun 2017 20:36:49 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 64854607CE 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: Fri, 30 Jun 2017 17:36:42 -0700 From: Stephen Boyd To: Dong Aisheng Cc: Dong Aisheng , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mturquette@baylibre.com, shawnguo@kernel.org, Anson.Huang@nxp.com, ping.bai@nxp.com Subject: Re: [PATCH 4/9] clk: imx: add pllv4 support Message-ID: <20170701003642.GS22780@codeaurora.org> References: <1494856763-6543-1-git-send-email-aisheng.dong@nxp.com> <1494856763-6543-5-git-send-email-aisheng.dong@nxp.com> <20170620015917.GO4493@codeaurora.org> <20170620093143.GD6805@b29396-OptiPlex-7040> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170620093143.GD6805@b29396-OptiPlex-7040> 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: 1058 Lines: 29 On 06/20, Dong Aisheng wrote: > On Mon, Jun 19, 2017 at 06:59:17PM -0700, Stephen Boyd wrote: > > On 05/15, Dong Aisheng wrote: > > > + > > > + if (clk_pllv4_is_enabled(hw)) { > > > + WARN(1, "clk_pllv4: can't change rate when pll is enabled"); > > > + return -EINVAL; > > > > Sad, CLK_SET_RATE_GATE isn't working for you I suppose? > > > > CLK_SET_RATE_GATE can't work in early stage before running clk_disable_unused. > At that point, the clock tree state is still not consistent with HW. > e.g. prepare/enable count is still zero but it's actually enabled due to > reset state or bootloader. > > The code here is adding a double check in case user sets rate in early stage. > > However, probably it could also be moved into clock core as it's not platform > dependant behavior? > Ok. It would be good to fix the core framework to synchronize the prepared/enabled state at registration time so we don't need this check in the driver. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project