From patchwork Fri Nov 22 10:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 179993 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp36297ilf; Fri, 22 Nov 2019 02:53:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwEuaYNxa16GlDBrgQEkQL5G3QND18zyw0gKbLgIjEf+6oS7rAGSW87qwD7nusIFWkC2tp/ X-Received: by 2002:aa7:d295:: with SMTP id w21mr257550edq.13.1574419984029; Fri, 22 Nov 2019 02:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574419984; cv=none; d=google.com; s=arc-20160816; b=qjq3HTqSQ3YK1qLCxpbqWOLM2T+uMCtE3h28VFxwvQNH2KF50RMXt8td/HZQf60OLs rM3u5cPBr8BylOw/0V09jBIwt61gg1Y3gVW1Pw5XPh0GcuJRcSsWUgmVMOl9qa1MtTPF 3qdQu5JPX0j20jGmca2sgIp4vXJ7qHOzfshhBaobWSSLGcERrkaR5fGfmvYbiZPkGvSj SovdTV1YPFy2+IOaVWSDegRR5Pd5qB2lgswqNjHLAhKgmeondcNlc83Dstr6Li6gEN9P Dfj6e0Nh3nncm43KV9660Oa/K0CCCPWN8tdIu/06tQp7UbY/rxCxM+o888l0O7xxQH6p V8pA== 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=r1+T/wUd+YTEVNZQdu+8J1D2JSpEqIhk1Fhv7pAvSwg=; b=NGpGH0q1FDFwEymvmI7DLnsCyYqdwfl77GQ5lCjMSUp5xEpC8aV72X+dZBmlYfKj69 gPusD2/Nhke1ABWrT9RT1PVU/eSmZ9HXQgKYWDjXN0JfNOuHdJEXP/9c5W7aHcs7e8ms ixmawO61aarYo/+jPp16elKcTHZZjgITWk4CFhoY/YIqVgNIBbn8FljPHRR83PxvpR4d yMfARkD+zvBj9SALUE953m69n+gpy8vTd6+Gcz9Cr/7ZLO55evTetz4U3SiDpdiqpgPz pKUjsamT6nTKm6++9OCnwzpcugCYWtfMbqHEpqztvqWRzEMYdj5U36+td3N8y3f6Bw9T hwxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nZWJpA5f; 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 dt11si3960742ejb.126.2019.11.22.02.53.03; Fri, 22 Nov 2019 02:53:04 -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=nZWJpA5f; 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 S1729914AbfKVKxB (ORCPT + 26 others); Fri, 22 Nov 2019 05:53:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:37056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729818AbfKVKw6 (ORCPT ); Fri, 22 Nov 2019 05:52:58 -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 ECFAD2070E; Fri, 22 Nov 2019 10:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419977; bh=mBWSYqzntZrRXyv64akBAkmmXnttEMUiQhS1mPu6nLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nZWJpA5fLJg+GtToBs0HRMifwewvsnSGW5yDkykjB0fxx7XQ7vgAIOwPKCrlWu4zc 1v4GuG/puJqlzTvion3m+bfSmnPFnXF5vDVOszQKJwGnnfOzIdOiuBsQfvrtuoLqzc CVcYqRcvO+FLoV7KCuGstCW1jdI5vVxVFWlglZU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Sylwester Nawrocki , Sasha Levin Subject: [PATCH 4.14 071/122] clk: samsung: Use clk_hw API for calling clk framework from clk notifiers Date: Fri, 22 Nov 2019 11:28:44 +0100 Message-Id: <20191122100812.169654382@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100722.177052205@linuxfoundation.org> References: <20191122100722.177052205@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski [ Upstream commit 1da220e3a5d22fccda0bc8542997abc1d1741268 ] clk_notifier_register() documentation states, that the provided notifier callbacks associated with the notifier must not re-enter into the clk framework by calling any top-level clk APIs. Fix this by replacing clk_get_rate() calls with clk_hw_get_rate(), which is safe in this context. Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki Signed-off-by: Sasha Levin --- drivers/clk/samsung/clk-cpu.c | 6 +++--- drivers/clk/samsung/clk-cpu.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index 6686e8ba61f9f..82f023f29a61f 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -152,7 +152,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata, struct exynos_cpuclk *cpuclk, void __iomem *base) { const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; - unsigned long alt_prate = clk_get_rate(cpuclk->alt_parent); + unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); unsigned long alt_div = 0, alt_div_mask = DIV_MASK; unsigned long div0, div1 = 0, mux_reg; unsigned long flags; @@ -280,7 +280,7 @@ static int exynos5433_cpuclk_pre_rate_change(struct clk_notifier_data *ndata, struct exynos_cpuclk *cpuclk, void __iomem *base) { const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg; - unsigned long alt_prate = clk_get_rate(cpuclk->alt_parent); + unsigned long alt_prate = clk_hw_get_rate(cpuclk->alt_parent); unsigned long alt_div = 0, alt_div_mask = DIV_MASK; unsigned long div0, div1 = 0, mux_reg; unsigned long flags; @@ -432,7 +432,7 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx, else cpuclk->clk_nb.notifier_call = exynos_cpuclk_notifier_cb; - cpuclk->alt_parent = __clk_lookup(alt_parent); + cpuclk->alt_parent = __clk_get_hw(__clk_lookup(alt_parent)); if (!cpuclk->alt_parent) { pr_err("%s: could not lookup alternate parent %s\n", __func__, alt_parent); diff --git a/drivers/clk/samsung/clk-cpu.h b/drivers/clk/samsung/clk-cpu.h index d4b6b517fe1b4..bd38c6aa38970 100644 --- a/drivers/clk/samsung/clk-cpu.h +++ b/drivers/clk/samsung/clk-cpu.h @@ -49,7 +49,7 @@ struct exynos_cpuclk_cfg_data { */ struct exynos_cpuclk { struct clk_hw hw; - struct clk *alt_parent; + struct clk_hw *alt_parent; void __iomem *ctrl_base; spinlock_t *lock; const struct exynos_cpuclk_cfg_data *cfg;