Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp54367pja; Fri, 22 Nov 2019 03:22:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyL4qaK3UbO+XEbZJ9wgbPpXiM6JMMNo+nlFf6+Cuc5WFxWiXurOyYRk5bD9opr3g+dZu6x X-Received: by 2002:a17:906:a28d:: with SMTP id i13mr5092907ejz.154.1574421727140; Fri, 22 Nov 2019 03:22:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421727; cv=none; d=google.com; s=arc-20160816; b=1IyJnRNxO2V0QBigUaRr0BLz9rYY7OygwLwB/KXaCc7XTPrhw93D3Zes/2J93ou//p I7FvqvNYZlSP4omGEGkNOTE/FaDoeIWkcv1axf09s60jQu/IgSpo4DT/402pnvxmCMwt FS5RY5E90bKh6CdZtzhZhIFPjUdSDw7eu56ZlYZbbKBjlu8FLU6ignh4tLLaX4ppE4yv Enk6ip1mg4GwgXP6DB1fJjB68PEMNKKZpUa5WWoslWgiKFUhj0wfIeqVV7YGcwsH61Og ApoyYQeImldBgq0DjEvotgFrn7g6nMgfA3bkIiNQ7hgARSjjIMpW0E5W6ZdxxRX5jqzO sHNA== 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=Z648et5IYdJFUAWgpTVeUc05K1yH+I9ldSrvv/btvZRuYZljGSu5uBUSDGJ98xm5Mm llS8ecd057e2yEe0gnZ9hZ384LkcFqGf1Rv3A92AoDtC8t/2zefOsNMUFgj3Nlr7Z96F rdNOT8F9f8RdHl5MNpBbxbvPvUg14phJvieTP1vWQH4QOjdJgniBwz4qTVY22f3/5rLZ 69lM04P6brbBc7Tx3Q9KjJSybyyDCNelL9pSVcdMKB0IdC1U7AcOu4oy1deX/yRRmLcB 5P+yEfR/KLO3ln6KCUivoWgFQZRxWldo08ZuH4mYZtMTvGFomJUpjQ9SV2tIBBJJxXEL 1PrQ== 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 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 x21si4072874edq.297.2019.11.22.03.21.43; Fri, 22 Nov 2019 03:22:07 -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=Rca6HGei; 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 S1729776AbfKVKrn (ORCPT + 99 others); Fri, 22 Nov 2019 05:47:43 -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 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: 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(-) 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; -- 2.20.1