From patchwork Fri Apr 26 23:39:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 2496191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 34B7ADF230 for ; Fri, 26 Apr 2013 23:40:13 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVsFP-0004yH-0J; Fri, 26 Apr 2013 23:40:11 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVsFM-0007JR-DE; Fri, 26 Apr 2013 23:40:08 +0000 Received: from mail-da0-x22c.google.com ([2607:f8b0:400e:c00::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVsFK-0007J6-0y for linux-arm-kernel@lists.infradead.org; Fri, 26 Apr 2013 23:40:06 +0000 Received: by mail-da0-f44.google.com with SMTP id z20so691002dae.17 for ; Fri, 26 Apr 2013 16:40:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=z+LwexyXy2mceRhsDWy1EX9TWxC8rZseN+OfjInxTtY=; b=WtPLyZH59LEyfoztCj9KdjawtYPuAUuEDd7POu3/sQcFBhTB7YOS+z5g7nE7pAc2/F BXi8ZPDgkZ4c440JbOTwNWjkY9B7WSU4exbjAU65b7FpvErEZ4IJAtEtiONRNRb3NJuv 2/hj7f7uACzzGYxGmkqyN78PActNc672znqxHhzUixWyC5/SwfrOkYvtIQn64CQ+WC2v 9KuzqfeyaWXwg+ncFl54i+nDZBcoFlRQV/EFOoBqg7D2AGsqAivG9jj+zEXFr6I73hfM 8FXKYy0dHSGAbtXI4Rana49LERa6up+cy6bOyqvz3fLFlL3EZTLCE2XpJQKGun6UTvx+ HRPQ== X-Received: by 10.66.197.165 with SMTP id iv5mr19116760pac.67.1367019602598; Fri, 26 Apr 2013 16:40:02 -0700 (PDT) Received: from quad.lixom.net (173-13-129-225-sfba.hfc.comcastbusiness.net. [173.13.129.225]) by mx.google.com with ESMTPSA id ts3sm13432450pbc.12.2013.04.26.16.40.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 16:40:01 -0700 (PDT) From: Olof Johansson To: Mike Turquette Subject: [PATCH] clk: add option to keep boot clocks on Date: Fri, 26 Apr 2013 16:39:51 -0700 Message-Id: <1367019591-31685-1-git-send-email-olof@lixom.net> X-Mailer: git-send-email 1.8.1.192.gc4361b8 X-Gm-Message-State: ALoCoQlNoGdw37thNeWRjZ6f9gCW/rgqZp66Tgvq0L3ADr4XKw00vMBvlvblFj3Z4V3r6gdeuoOe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130426_194006_178122_264C4828 X-CRM114-Status: GOOD ( 11.96 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Olof Johansson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This is primarily useful when there's a driver that doesn't claim clocks properly, but the bootloader does. It's not expected to be used in normal cases, but for bringup and debug it's very useful to have the option to not gate unclaimed clocks that are still on. Signed-off-by: Olof Johansson --- Mike, this is a pretty trivial patch that I would love to see in 3.10 even though it's getting late. I'm definitely not picky about the naming of the boot option, so feel free to change it. -Olof drivers/clk/clk.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 20ce67f..b22551e 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -499,10 +499,24 @@ out: return; } + +static bool keep_boot_clocks; +static int __init clk_keep_boot_clocks(char *__unused) +{ + keep_boot_clocks = true; + return 1; +} +__setup("clk_keep_boot_clocks", clk_keep_boot_clocks); + static int clk_disable_unused(void) { struct clk *clk; + if (keep_boot_clocks) { + pr_warn("clk: Not disabling unused clocks\n"); + return 0; + } + clk_prepare_lock(); hlist_for_each_entry(clk, &clk_root_list, child_node)