From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220AbbCaBhP (ORCPT ); Mon, 30 Mar 2015 21:37:15 -0400 Received: from mail-ig0-f170.google.com ([209.85.213.170]:35112 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753892AbbCaBhM convert rfc822-to-8bit (ORCPT ); Mon, 30 Mar 2015 21:37:12 -0400 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Andrew Bresticker , "Stephen Boyd" From: Michael Turquette In-Reply-To: Cc: "Ralf Baechle" , "devicetree@vger.kernel.org" , "Linux-MIPS" , "linux-kernel@vger.kernel.org" , "Ezequiel Garcia" , "James Hartley" , "James Hogan" References: <1424836567-7252-1-git-send-email-abrestic@chromium.org> <1424836567-7252-3-git-send-email-abrestic@chromium.org> <5519E37C.9010201@codeaurora.org> Message-ID: <20150331013659.25195.31669@quantum> User-Agent: alot/0.3.5 Subject: Re: [PATCH 2/7] clk: Add basic infrastructure for Pistachio clocks Date: Mon, 30 Mar 2015 18:36:59 -0700 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Andrew Bresticker (2015-03-30 17:15:43) > On Mon, Mar 30, 2015 at 4:59 PM, Stephen Boyd wrote: > > On 02/24/15 19:56, Andrew Bresticker wrote: > >> + > >> +void pistachio_clk_force_enable(struct pistachio_clk_provider *p, > >> + unsigned int *clk_ids, unsigned int num) > >> +{ > >> + unsigned int i; > >> + int err; > >> + > >> + for (i = 0; i < num; i++) { > >> + struct clk *clk = p->clk_data.clks[clk_ids[i]]; > >> + > >> + if (IS_ERR(clk)) > >> + continue; > >> + > >> + err = clk_prepare_enable(clk); > >> + if (err) > >> + pr_err("Failed to enable clock %s: %d\n", > >> + __clk_get_name(clk), err); > >> + } > >> +} > >> > > > > Is this to workaround some problems in the framework where clocks are > > turned off? Or is it that these clocks are already on before we boot > > Linux and we need to make sure the framework knows that? > > It's the former. These clocks are enabled at POR and may only be > gated as the final step to entering suspend, so they must remain on at > runtime. The issue we were running into was that consumers of these > critical clocks or their descendants would enable/disable their clocks > during boot or runtime PM and cause these clocks to get disabled. > Bumping up the prepare/enable count of these critical clocks seemed > like the best way to handle this - is there a more preferred way? > FWIW, this is also how the Tegra and Rockchip drivers handled this > problem. Hi Andrew, Why are your drivers allowed to disable clocks which must not be disabled? (you mentioned boot and runtime pm) Is this the case that a critical clock is not directly disabled, but a parent of that critical clock is and it is gated as a result? Regards, Mike