From patchwork Fri Nov 22 10:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 179983 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp30460ilf; Fri, 22 Nov 2019 02:47:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxd8KAZD56uASHQ5CUrEjj+tAfFJ5fC+TpTiVlV0pHOSXVrMZjdF2lqnDDJ8oeNWDYC4BFp X-Received: by 2002:a17:906:2893:: with SMTP id o19mr21815860ejd.32.1574419663325; Fri, 22 Nov 2019 02:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574419663; cv=none; d=google.com; s=arc-20160816; b=tajVX51MJ4jtjpf/4wh17UO9dOBxsevrIxA0TMZKJ5plr8BL7YUU3apbUYatuRtvrv EKgANaI0nIf+7ONJYA6XfAnLMIBNtrrzFnADbvz64BnJ8kyuz9wdtjBGXu6tD2Jf1Oed SBhSkLi0y/2ZleCHdxOTpLunYH2bBAAUyb0nnF3RDKSu7i0juMID7DqOcePqZDg5bhB8 158kd0F9MoxO4+mHslg5wAzvk7ZwDSBByCasu+Nqi/7PQvrzF3pWWIhKWR5WdeZmq5UX vBpCh55YKOcLIXsJPmMCsEdVkDPa7jzCLK7GOB7ZJLe0hbcD9mXhyDD7pOEcmTRq0xBl XjDw== 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=S4VTd4wTlDvBnbz/rrMCeLOlHcQJEcm/DeLFJRH8S3o=; b=SiiaDg7iyt83lsddsNJ4NcSW5GMvzSnZE2RueNyThsOuc52xv5dpAkFwKVRz08JEYC URdaMECCMTdP1j54D0s1rGbnsbcEd/NiIFuhFpl7hsLN+F4vFgZ/23eFNLH1dg21otwg 7nd2EL9LKowBmzMGvCmqzCUNnLWQQE3BWe8VuBzKeTW8hSK0coRHeeG/Hsw90/L+4PQp 4aS14s4VG5xIM03KpEisVWqemU3juQoLNM9Kln8aGCjyd6D4peGU7Ce8HDMf/7RLwczJ mVObPecBeOReuuruo8BXOsqAqB8WnTnxEf7E+N5bw0V7xkCktnmhnhbyqTlQIAf1KL1K RZDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rca6HGei; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 24si4297543eje.293.2019.11.22.02.47.43; Fri, 22 Nov 2019 02:47:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=Rca6HGei; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729083AbfKVKrl (ORCPT + 15 others); Fri, 22 Nov 2019 05:47:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:55712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729797AbfKVKrk (ORCPT ); Fri, 22 Nov 2019 05:47:40 -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 E821720637; Fri, 22 Nov 2019 10:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419659; bh=Zgkwqrff4/iY33NyPBf0FfOVn1J4uPqkRyaGWhNjPxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rca6HGeiEXMG/vGT+mXRsvU0k/6tryAmflqgKqrneSWOXS1nE6w0JZDh8xOcmwiwM kXqmKOkdkD/7h5ajMi/pbSq01IRJ8nHUlrEtrP1ymW/3NFiGq7CCq7XXinULGJD84i g90WR8CPBl8G3tocBIcIoX1dH4iBEtXCh5gHGM0M= 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.9 188/222] clk: samsung: Use clk_hw API for calling clk framework from clk notifiers Date: Fri, 22 Nov 2019 11:28:48 +0100 Message-Id: <20191122100915.891944996@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100830.874290814@linuxfoundation.org> References: <20191122100830.874290814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 8bf7e805fd349..1271315b0c25b 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;