From patchwork Fri Apr 29 17:42:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sperl X-Patchwork-Id: 8984291 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: X-Original-To: patchwork-linux-clk@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6947C9F39D for ; Fri, 29 Apr 2016 17:42:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A349E2015E for ; Fri, 29 Apr 2016 17:42:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B53CA201C8 for ; Fri, 29 Apr 2016 17:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbcD2Rmq (ORCPT ); Fri, 29 Apr 2016 13:42:46 -0400 Received: from 212-186-180-163.dynamic.surfer.at ([212.186.180.163]:52670 "EHLO cgate.sperl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950AbcD2Rmq (ORCPT ); Fri, 29 Apr 2016 13:42:46 -0400 Received: from rasp3a.intern.sperl.org (account martin@sperl.org [10.10.10.43] verified) by sperl.org (CommuniGate Pro SMTP 6.1.2) with ESMTPSA id 6442904; Fri, 29 Apr 2016 17:42:39 +0000 From: kernel@martin.sperl.org To: Michael Turquette , Stephen Boyd , Stephen Warren , Lee Jones , Eric Anholt , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Martin Sperl Subject: [PATCH V4 2/2] clk: bcm2835: use CLK_ENABLE_HAND_OFF instead of CLK_IS_CRITICAL Date: Fri, 29 Apr 2016 17:42:36 +0000 Message-Id: <1461951756-16804-3-git-send-email-kernel@martin.sperl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1461951756-16804-1-git-send-email-kernel@martin.sperl.org> References: <1461951756-16804-1-git-send-email-kernel@martin.sperl.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Spam-Status: No, score=-7.9 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 From: Martin Sperl The use of CLK_IS_CRITICAL is just a stop-gap to avoid unpreparing essential PLLs that may result stopping the system without intention. This moves to use CLK_ENABLE_HAND_OFF instead of CLK_IS_CRITICAL, so that clocks (and their parents) may get released if there is a driver that claims (and then later releases) a specific clock. Signed-off-by: Martin Sperl --- Note that this requires the following patches applied: * clk: introduce CLK_ENABLE_HAND_OFF flag * clk: per-user clk prepare & enable ref counts --- drivers/clk/bcm/clk-bcm2835.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 03b7f01..6303c3a 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1251,12 +1251,12 @@ static struct clk *bcm2835_register_clock(struct bcm2835_cprman *cprman, init.flags |= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; } - /* if the clock is running, then enable CRITICAL */ + /* if the clock is running, then enable CLK_ENABLE_HAND_OFF */ if (cprman_read(cprman, data->ctl_reg) & CM_ENABLE) { dev_dbg(cprman->dev, - "found firmware enabled clock %s - enabling critical\n", + "found firmware enabled clock %s - enabling hand off\n", data->name); - init.flags |= CLK_IS_CRITICAL; + init.flags |= CLK_ENABLE_HAND_OFF; } clock = devm_kzalloc(cprman->dev, sizeof(*clock), GFP_KERNEL);