From patchwork Fri Feb 27 21:14:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 45265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9ED20204BC for ; Fri, 27 Feb 2015 21:23:14 +0000 (UTC) Received: by wesu56 with SMTP id u56sf16071437wes.1 for ; Fri, 27 Feb 2015 13:23:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=QqeKePz3IQp6aGVaM+IoRTvdEpJXYeeeJwZS62KRxx0=; b=lgiBL3H52IjG3auLBZ3r5lCNfU9j/kPFe8h90zBUym46xLYZmP0RRc0GC9vourh+47 YyHx0q1FIYnkNj2DSE4Sy/R0JoZsZWm47ILRi6VNhoXFVyxBKHDrziyaYDzwbzVSn1D2 H9LwXx+WZ8AbvVSDXKNPnTyl+o9vTfNIjQqMzV0TfGmYeK4fvb+8EEZZpzwItmrdEuP2 +qSSmPMCWXJ18dHEnOIEv+D6NXXy8IIF5ZI5eixiU+zWgauXjEkZXKqwyTqJG57MIV6d DVIq7Swl+3OoMvqC+zp4N1IwU2y5lauSCCNeQBniWEaukaWgBcBEAdbe+lvAcRKmt4yC AEuw== X-Gm-Message-State: ALoCoQkKAM9DHjnoyz/ZakR4yhjYmOUKE5FGzJl0ZywFiU5ZFmRZbGyE01R2hZBN2omKgLnHvdTz X-Received: by 10.112.144.130 with SMTP id sm2mr2398814lbb.9.1425072193853; Fri, 27 Feb 2015 13:23:13 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.5 with SMTP id g5ls194452lag.28.gmail; Fri, 27 Feb 2015 13:23:13 -0800 (PST) X-Received: by 10.112.171.65 with SMTP id as1mr14575429lbc.45.1425072193679; Fri, 27 Feb 2015 13:23:13 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id x1si3755007lax.123.2015.02.27.13.23.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 13:23:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labgd6 with SMTP id gd6so20050933lab.8 for ; Fri, 27 Feb 2015 13:23:13 -0800 (PST) X-Received: by 10.152.179.172 with SMTP id dh12mr14180532lac.76.1425072193595; Fri, 27 Feb 2015 13:23:13 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp4163863lbj; Fri, 27 Feb 2015 13:23:12 -0800 (PST) X-Received: by 10.68.200.166 with SMTP id jt6mr27358122pbc.11.1425072191760; Fri, 27 Feb 2015 13:23:11 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fj14si375587pac.128.2015.02.27.13.23.10; Fri, 27 Feb 2015 13:23:11 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755438AbbB0VWz (ORCPT + 28 others); Fri, 27 Feb 2015 16:22:55 -0500 Received: from mail-we0-f171.google.com ([74.125.82.171]:44104 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755169AbbB0VWu (ORCPT ); Fri, 27 Feb 2015 16:22:50 -0500 Received: by wesk11 with SMTP id k11so22747140wes.11 for ; Fri, 27 Feb 2015 13:22:49 -0800 (PST) X-Received: by 10.180.19.193 with SMTP id h1mr10614463wie.2.1425072169754; Fri, 27 Feb 2015 13:22:49 -0800 (PST) Received: from localhost.localdomain ([31.91.229.167]) by mx.google.com with ESMTPSA id hs7sm4477856wib.4.2015.02.27.13.22.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Feb 2015 13:22:48 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, kernel@stlinux.com, mturquette@linaro.org, sboyd@codeaurora.org, devicetree@vger.kernel.org Subject: [PATCH 3/4] clk: Provide always-on clock support Date: Fri, 27 Feb 2015 21:14:33 +0000 Message-Id: <1425071674-16995-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425071674-16995-1-git-send-email-lee.jones@linaro.org> References: <1425071674-16995-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Lots of platforms contain clocks which if turned off would prove fatal. The only way to recover from these catastrophic failures is to restart the board(s). Now, when a clock is registered with the framework it is compared against a list of provided always-on clock names which must be kept ungated. If it matches, we enable the existing CLK_IGNORE_UNUSED flag, which will prevent the common clk framework from attempting to gate it during the clk_disable_unused() procedure. Signed-off-by: Lee Jones --- drivers/clk/clk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 61c3fc5..3aab75e 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2856,6 +2856,9 @@ int of_clk_add_provider(struct device_node *np, void *data) { struct of_clk_provider *cp; + struct property *prop; + struct clk *clk; + const char *clkname; int ret; cp = kzalloc(sizeof(struct of_clk_provider), GFP_KERNEL); @@ -2875,6 +2878,14 @@ int of_clk_add_provider(struct device_node *np, if (ret < 0) of_clk_del_provider(np); + of_property_for_each_string(np, "clock-always-on", prop, clkname) { + clk = __clk_lookup(clkname); + if (!clk) + continue; + + clk->core->flags |= CLK_IGNORE_UNUSED; + } + return ret; } EXPORT_SYMBOL_GPL(of_clk_add_provider);