From patchwork Wed Jun 22 07:40:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erin Lo X-Patchwork-Id: 9192115 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 10A2260756 for ; Wed, 22 Jun 2016 07:46:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02CED283E8 for ; Wed, 22 Jun 2016 07:46:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB3B9283F0; Wed, 22 Jun 2016 07:46:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89842283E8 for ; Wed, 22 Jun 2016 07:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbcFVHl1 (ORCPT ); Wed, 22 Jun 2016 03:41:27 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:16691 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750890AbcFVHlZ (ORCPT ); Wed, 22 Jun 2016 03:41:25 -0400 Received: from mtkhts07.mediatek.inc [(172.21.101.69)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 549293199; Wed, 22 Jun 2016 15:40:44 +0800 Received: from mtkslt209.mediatek.inc (10.21.15.96) by mtkhts07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.266.1; Wed, 22 Jun 2016 15:40:43 +0800 From: Erin Lo To: Matthias Brugger , Mike Turquette , Stephen Boyd , Rob Herring CC: John Crispin , Arnd Bergmann , Sascha Hauer , Daniel Kurtz , Philipp Zabel , , , , , , , James Liao , Erin Lo Subject: [PATCH v9 01/10] clk: fix initial state of critical clock's parents Date: Wed, 22 Jun 2016 15:40:20 +0800 Message-ID: <1466581229-2342-2-git-send-email-erin.lo@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466581229-2342-1-git-send-email-erin.lo@mediatek.com> References: <1466581229-2342-1-git-send-email-erin.lo@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: James Liao This patch fixed wrong state of parent clocks if they are registered after critical clocks. Signed-off-by: James Liao Signed-off-by: Erin Lo --- drivers/clk/clk.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index d584004..e9f5f89 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2388,8 +2388,15 @@ static int __clk_core_init(struct clk_core *core) hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) { struct clk_core *parent = __clk_init_parent(orphan); - if (parent) + if (parent) { clk_core_reparent(orphan, parent); + + if (orphan->prepare_count) + clk_core_prepare(parent); + + if (orphan->enable_count) + clk_core_enable(parent); + } } /*