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: 5008001 Return-Path: X-Original-To: patchwork-linux-arm@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 1B4CDBEEA6 for ; Tue, 30 Sep 2014 21:42:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27B842010C for ; Tue, 30 Sep 2014 21:42:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ADEA20115 for ; Tue, 30 Sep 2014 21:42:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ586-0006yg-IT; Tue, 30 Sep 2014 21:38:42 +0000 Received: from mail-pd0-f176.google.com ([209.85.192.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ583-0006ue-NW for linux-arm-kernel@lists.infradead.org; Tue, 30 Sep 2014 21:38:40 +0000 Received: by mail-pd0-f176.google.com with SMTP id fp1so6849744pdb.21 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=bSdPfkl/tgWSMeoSXyntrUxOHj5PN6kNA35m33Zx5R6pATnvegL+pzEfs8BkXp1D5r esj9wstVUJJkIe/tCFotVfYPtvlJzzY6TQ0OrSv+kOMhtqOMr4lH1exN8kKB2iNHPF/S kwcSJ6h+YWVuSMsJm86KwOgmHctsNZu7+AWLqUntszKijPhmVgEwrtnG6Hueibz9ukyR q7fQdEm+7i5cFfunIpMamEILQPIKZxihYbzMvRWrtjgFCPO6pTtAGalx/5F1wveFXuNh irPuU8LLkzPq9QqfkGO0Mp9JntzQKCWW02FLq5WL7FBG5AhxEpdTVceCU/mxLPIzOfA+ 4I/A== X-Gm-Message-State: ALoCoQkF5qBLTOTf75yZ3zH2Q+oTB1/jaPJV9PtFHo5O4gLzR46FmsLSK21kmm2zVUi7bLiQo5Qj 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> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140930_143839_788556_040E0E0B X-CRM114-Status: GOOD ( 26.13 ) X-Spam-Score: -0.9 (/) Cc: Linux Fbdev development list , Stephen Warren , Stephen Warren , Luc Verhaegen , Hans de Goede , linux-sunxi , Tomi Valkeinen , Geert Uytterhoeven , Mark Brown , Jean-Christophe Plagniol-Villard , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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]