From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30CC4C35641 for ; Fri, 21 Feb 2020 08:08:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 044FB2465D for ; Fri, 21 Feb 2020 08:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582272485; bh=9ua/guR1mxyD2PxnyswtbApfsZTNnJhfiDmUW4Mgjjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e7nt8QPdgh9HLzEUu07j93DoUU4CY9aoDge82SEHNswqmp/gXNL6RgogEstNTOiqS Uz5lIJ+ilvZPUQphXtuJjpx9dS8b8iQ1lsMPDIng/GZiyjovXAuX9/XJ8vg3CtSczj KZcZOKW+WTTtJB7xjNekM8V4nV3fEHuWc02clPpE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731903AbgBUIID (ORCPT ); Fri, 21 Feb 2020 03:08:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:42304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732114AbgBUIH4 (ORCPT ); Fri, 21 Feb 2020 03:07:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B914B2465D; Fri, 21 Feb 2020 08:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582272476; bh=9ua/guR1mxyD2PxnyswtbApfsZTNnJhfiDmUW4Mgjjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hy1z/w2tenK62x+TpJBveiObDsnXAMMzl1n8p//t24Ry5wHPvOQKGG0M+jQXdkyVz irFn8RG+tXc5HbhixDNZLWhsdrppWq7wdiCNkwg8zrvLzdCXpLNWE6+a7Xgm3zYiJD r5gXTf4narUbWOontcejQa/FcPGKmuK6S1IjLtn8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerome Brunet , Stephen Boyd , Sasha Levin Subject: [PATCH 5.4 158/344] clk: actually call the clock init before any other callback of the clock Date: Fri, 21 Feb 2020 08:39:17 +0100 Message-Id: <20200221072403.163748800@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072349.335551332@linuxfoundation.org> References: <20200221072349.335551332@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet [ Upstream commit f6fa75ca912be6021335de63a32aa4d295f3c524 ] __clk_init_parent() will call the .get_parent() callback of the clock so .init() must run before. Fixes: 541debae0adf ("clk: call the clock init() callback before any other ops callback") Signed-off-by: Jerome Brunet Link: https://lkml.kernel.org/r/20190924123954.31561-2-jbrunet@baylibre.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 67f592fa083ab..b0344a1a03704 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3320,6 +3320,21 @@ static int __clk_core_init(struct clk_core *core) goto out; } + /* + * optional platform-specific magic + * + * The .init callback is not used by any of the basic clock types, but + * exists for weird hardware that must perform initialization magic. + * Please consider other ways of solving initialization problems before + * using this callback, as its use is discouraged. + * + * If it exist, this callback should called before any other callback of + * the clock + */ + if (core->ops->init) + core->ops->init(core->hw); + + core->parent = __clk_init_parent(core); /* @@ -3344,17 +3359,6 @@ static int __clk_core_init(struct clk_core *core) core->orphan = true; } - /* - * optional platform-specific magic - * - * The .init callback is not used by any of the basic clock types, but - * exists for weird hardware that must perform initialization magic. - * Please consider other ways of solving initialization problems before - * using this callback, as its use is discouraged. - */ - if (core->ops->init) - core->ops->init(core->hw); - /* * Set clk's accuracy. The preferred method is to use * .recalc_accuracy. For simple clocks and lazy developers the default -- 2.20.1