Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1590559ybv; Thu, 20 Feb 2020 23:52:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzj9bIAEYBKopB6XnPHYCBA9vH8ItYLtcuXgDvxjKFkzLy69juUJBZhYnA1rZP/vMX7K8td X-Received: by 2002:aca:d502:: with SMTP id m2mr904307oig.41.1582271559403; Thu, 20 Feb 2020 23:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271559; cv=none; d=google.com; s=arc-20160816; b=ifz5/cQOXjXL8JTUSDnKhK/rafdDdkLqQn77d7OYRgtABys680T5y2mdJ8umxVujaY vPXz68YZQ9pR60ekDOdtw5KqwbIZLu/ULTQQuPs5Mq9glW5oQBV+1jsyId+8PDgVkVdF 3v8uvxVAcLLFkEsB9oLFJuYgi2wqOTckjbmZGlnge4oAWqWcAhshgzVogi7Ri3frs8kl sfallzpptvGEMoORomZbLGO8sgxFAEgO65u8TrN2biyFauo7/HJIWujU+QvInkG5cRCF q3PjjFjTX34CTMMHsIoTXDS0/QYWkVQHSVC1Ok/g3h9/6Hvqn7DIHJsGuCLWTZ6UkbPY 0Cqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CN42Mr1y8h5EszBRwC6S0MFyHYpjxBaBmkg06ZokwEE=; b=hdNKrn6T055j6/R3j+08wweneHq3q7aUHPT8456saItKaBqqDBC//AEbu8ZD1e9nqE aKMy0Z+awZq4iFhtlcEs4ANWCs8hthuEYXwPlVmxCdkGEvLIJ8DGpVqEkPyBbUER8XB/ TsnjsFZAHqasgTE5DzkVrITNAbZVNePY5YqGWhoh1eD/d40W5CXfSpRj7zzs7nALS2pR P+M+w7SRZiHxwewJzzxd9OClWwHqCmlXlO3zLcu/cCCT4akFw7IgNomacxqqIYRaokqJ QcaTlSBN6eNGXKEl+Rz7vljVn2J5Uw+xDqnr5iDsXGhXfnAcGCD8rCqYSl9nfeOSZ3tS SzuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jPeKH3YC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si1089379otp.279.2020.02.20.23.52.27; Thu, 20 Feb 2020 23:52:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jPeKH3YC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbgBUHv1 (ORCPT + 99 others); Fri, 21 Feb 2020 02:51:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:48720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729738AbgBUHvY (ORCPT ); Fri, 21 Feb 2020 02:51:24 -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 37981207FD; Fri, 21 Feb 2020 07:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271483; bh=+lVoJ8WapUZPeP45CSRrrWYwdJXfBF+qqGzFeUm9ljs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jPeKH3YCBOzjoyPAiSaQ6+/nB7lDltLPaFS1emF/o5hZ6+uR0cCrDBVYQqEICupI4 JKAm5WNB2U9cEHnvIRruxFX6HgCpJelW3uCbEIWWUQQ+152dxkedlOwOHZ4GFW3Gvg rRUDcWqUSa7wcgUqTYjB1OqG7RkrbQmalZqlW1GY= 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.5 182/399] clk: actually call the clock init before any other callback of the clock Date: Fri, 21 Feb 2020 08:38:27 +0100 Message-Id: <20200221072420.455340473@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@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 772258de2d1f3..53585cfc4b9ba 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3338,6 +3338,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); /* @@ -3362,17 +3377,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