From patchwork Tue Sep 30 21:37:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 5008251 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AE026BEEA6 for ; Tue, 30 Sep 2014 21:52:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C936320165 for ; Tue, 30 Sep 2014 21:52:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB1162011B for ; Tue, 30 Sep 2014 21:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754939AbaI3VwM (ORCPT ); Tue, 30 Sep 2014 17:52:12 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:46866 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbaI3ViT convert rfc822-to-8bit (ORCPT ); Tue, 30 Sep 2014 17:38:19 -0400 Received: by mail-pa0-f44.google.com with SMTP id et14so5594809pad.3 for ; Tue, 30 Sep 2014 14:38:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version :content-transfer-encoding:to:from:in-reply-to:cc:references :message-id:user-agent:subject:date; bh=y7wzpMdQYF67N1fuEh+2LsueQbS/pMygbsXHEeaskVQ=; b=FKhoA5fMF1fcLsVFOuPDyKHck6bO0RML2OtH83kz88M5ZA2FqGsslTMP3yrVxwzgLf 9KzN08UBmv8NyDOCaLOOvIgiV0M6wUX2OjLltWz9cuhpx2ORH14KGM4z2wxYBqApdnFt PiDWDy7d5zdpm5fwMp8n28mttNDK5Cs/F3Ny96BRtvL72V9R5rq1R1JSJHsZUAYnBNsR 3i56ZVv2CEbHoZ8T74PA2Zfj25UBgwz15M55WFs16J9gqOS6KGqTXU6dtp7ZjkW63Tag a+0fUJX3p57gP5msw9icLolWuqOOKJBKu5IWc3/LInOdYSKin+utnhZJXxEzIhyiZRAf AGIw== X-Gm-Message-State: ALoCoQn4NxJV9BoRUtnDTpYt+jkDzpRjVRX/1Mv+OSQhJgGsJHJiJHXHESx6XXwK8SBoG/HvP9mL X-Received: by 10.68.143.4 with SMTP id sa4mr72037787pbb.5.1412113098312; Tue, 30 Sep 2014 14:38:18 -0700 (PDT) Received: from localhost (pool-108-47-66-231.lsanca.fios.verizon.net. [108.47.66.231]) by mx.google.com with ESMTPSA id nk11sm16061582pdb.40.2014.09.30.14.38.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 14:38:17 -0700 (PDT) MIME-Version: 1.0 To: Thierry Reding , "Maxime Ripard" From: Mike Turquette In-Reply-To: <20140929135358.GC30998@ulmo> Cc: "Geert Uytterhoeven" , "Hans de Goede" , "linux-sunxi" , "Linux Fbdev development list" , "Stephen Warren" , "Stephen Warren" , "Luc Verhaegen" , "Tomi Valkeinen" , "Jean-Christophe Plagniol-Villard" , "linux-arm-kernel@lists.infradead.org" , "Mark Brown" References: <20140829141244.GH15297@lukather> <20140902092508.GR15297@lukather> <20140927235601.19023.31593@quantum> <20140929080637.GB12506@ulmo> <20140929092301.GC4388@lukather> <20140929101805.GB26008@ulmo> <20140929104454.GD26008@ulmo> <20140929113436.GA4081@lukather> <20140929135358.GC30998@ulmo> Message-ID: <20140930213753.19023.17605@quantum> User-Agent: alot/0.3.5 Subject: Re: [linux-sunxi] Re: [PATCH 4/4] simplefb: add clock handling code Date: Tue, 30 Sep 2014 14:37:53 -0700 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Quoting Thierry Reding (2014-09-29 06:54:00) > On Mon, Sep 29, 2014 at 01:34:36PM +0200, Maxime Ripard wrote: > > On Mon, Sep 29, 2014 at 12:44:57PM +0200, Thierry Reding wrote: > > > > >> Plus, speaking more specifically about the clocks, that won't prevent > > > > >> your clock to be shut down as a side effect of a later clk_disable > > > > >> call from another driver. > > > > > > > > > Furthermore isn't it a bug for a driver to call clk_disable() before a > > > > > preceding clk_enable()? There are patches being worked on that will > > > > > enable per-user clocks and as I understand it they will specifically > > > > > disallow drivers to disable the hardware clock if other drivers are > > > > > still keeping them on via their own referenc. > > > > > > > > Calling clk_disable() preceding clk_enable() is a bug. > > > > > > > > Calling clk_disable() after clk_enable() will disable the clock (and > > > > its parents) > > > > if the clock subsystem thinks there are no other users, which is what will > > > > happen here. > > > > > > Right. I'm not sure this is really applicable to this situation, though. > > > > It's actually very easy to do. Have a driver that probes, enables its > > clock, fails to probe for any reason, call clk_disable in its exit > > path. If there's no other user at that time of this particular clock > > tree, it will be shut down. Bam. You just lost your framebuffer. > > > > Really, it's just that simple, and relying on the fact that some other > > user of the same clock tree will always be their is beyond fragile. > > Perhaps the meaning clk_ignore_unused should be revised, then. What you > describe isn't at all what I'd expect from such an option. And it does > not match the description in Documentation/kernel-parameters.txt either. From e156ee56cbe26c9e8df6619dac1a993245afc1d5 Mon Sep 17 00:00:00 2001 From: Mike Turquette Date: Tue, 30 Sep 2014 14:24:38 -0700 Subject: [PATCH] doc/kernel-parameters.txt: clarify clk_ignore_unused Refine the definition around clk_ignore_unused, which caused some confusion recently on the linux-fbdev and linux-arm-kernel mailing lists[0]. [0] http://lkml.kernel.org/r/<20140929135358.GC30998@ulmo> Signed-off-by: Mike Turquette --- Thierry, Please let me know if this wording makes the feature more clear. Documentation/kernel-parameters.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 10d51c2..0ce01fb 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -605,11 +605,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See Documentation/s390/CommonIO for details. clk_ignore_unused [CLK] - Keep all clocks already enabled by bootloader on, - even if no driver has claimed them. This is useful - for debug and development, but should not be - needed on a platform with proper driver support. - For more information, see Documentation/clk.txt. + Prevents the clock framework from automatically gating + clocks that have not been explicitly enabled by a Linux + device driver but are enabled in hardware at reset or + by the bootloader/firmware. Note that this does not + force such clocks to be always-on nor does it reserve + those clocks in any way. This parameter is useful for + debug and development, but should not be needed on a + platform with proper driver support. For more + information, see Documentation/clk.txt. clock= [BUGS=X86-32, HW] gettimeofday clocksource override. [Deprecated]