Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbbF2Rbs (ORCPT ); Mon, 29 Jun 2015 13:31:48 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:56721 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbbF2Rbl (ORCPT ); Mon, 29 Jun 2015 13:31:41 -0400 X-AuditID: cbfee61a-f79516d000006302-17-559180fbf090 From: Bartlomiej Zolnierkiewicz To: Thomas Abraham , Sylwester Nawrocki , Michael Turquette , Kukjin Kim , Kukjin Kim , Viresh Kumar , Krzysztof Kozlowski , Dan Carpenter Cc: Tomasz Figa , Lukasz Majewski , Heiko Stuebner , Chanwoo Choi , Kevin Hilman , Javier Martinez Canillas , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH] clk: samsung: fix cpu clock's flags checking Date: Mon, 29 Jun 2015 19:29:38 +0200 Message-id: <1435598978-21800-1-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t9jAd3fDRNDDZp+yVhsnLGe1eL6l+es Fq//TWex+P/oNavF0d8FFq9fGFr0LrjKZtH/+DWzxdfDKxgt3jzczGix6fE1VouPPfdYLS7v msNm8bn3CKPFjPP7mCwunnK1OPymndWiYxmjxapdfxgtNn71cBDxeH+jld3j7/PrLB47Z91l 99i0qpPN4861PWwem5fUe3x8eovFo2/LKkaP7dfmMXt83iQXwBXFZZOSmpNZllqkb5fAlfH8 /Um2gvdiFbs2bGFuYJwp3MXIySEhYCKx5E0bC4QtJnHh3nq2LkYuDiGBRYwS++b/YwJJCAn8 YpRoWa0AYrMJWElMbF/FCFIkInCFSeLlw9fMIA6zwC5miTX/G5hBqoQFbCWOtbxjB7FZBFQl Jj3bxAZi8wp4SJzrXMoKsU5O4uSxyawTGLkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/d xAgO6GdSOxhXNlgcYhTgYFTi4fV4PyFUiDWxrLgy9xCjBAezkggvU+zEUCHelMTKqtSi/Pii 0pzU4kOM0hwsSuK8J/N9QoUE0hNLUrNTUwtSi2CyTBycUg2M8/m5Glz6jp32XMvKt9Cld6LH vuUOj+b0f1dfzp5zrWdCSRxHUF9M66f/D1Ijmsq5zSeoivjXunzZ9Fcu933k07dGl5c7FXGc aZfqrXwheDSRy/GA8xS9X+dO2dm/rxWM0DCW+2DimZDevSiPp4N1XsHi76cbPeRFwuOVE1J3 phz8v+/OxVNKLMUZiYZazEXFiQB9YKj7ZAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3104 Lines: 73 CLK_CPU_HAS_DIV1 and CLK_CPU_NEEDS_DEBUG_ALT_DIV masks were incorrectly used as a bit numbers. Fix it. Tested on Exynos4210 based Origen board and on Exynos5250 based Arndale board. Cc: Tomasz Figa Cc: Michael Turquette Cc: Javier Martinez Canillas Cc: Thomas Abraham Reported-by: Dan Carpenter Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/clk/samsung/clk-cpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c index 3a1fe07..dd02356 100644 --- a/drivers/clk/samsung/clk-cpu.c +++ b/drivers/clk/samsung/clk-cpu.c @@ -161,7 +161,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata, * the values for DIV_COPY and DIV_HPM dividers need not be set. */ div0 = cfg_data->div0; - if (test_bit(CLK_CPU_HAS_DIV1, &cpuclk->flags)) { + if (cpuclk->flags & CLK_CPU_HAS_DIV1) { div1 = cfg_data->div1; if (readl(base + E4210_SRC_CPU) & E4210_MUX_HPM_MASK) div1 = readl(base + E4210_DIV_CPU1) & @@ -182,7 +182,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata, alt_div = DIV_ROUND_UP(alt_prate, tmp_rate) - 1; WARN_ON(alt_div >= MAX_DIV); - if (test_bit(CLK_CPU_NEEDS_DEBUG_ALT_DIV, &cpuclk->flags)) { + if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { /* * In Exynos4210, ATB clock parent is also mout_core. So * ATB clock also needs to be mantained at safe speed. @@ -203,7 +203,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata, writel(div0, base + E4210_DIV_CPU0); wait_until_divider_stable(base + E4210_DIV_STAT_CPU0, DIV_MASK_ALL); - if (test_bit(CLK_CPU_HAS_DIV1, &cpuclk->flags)) { + if (cpuclk->flags & CLK_CPU_HAS_DIV1) { writel(div1, base + E4210_DIV_CPU1); wait_until_divider_stable(base + E4210_DIV_STAT_CPU1, DIV_MASK_ALL); @@ -222,7 +222,7 @@ static int exynos_cpuclk_post_rate_change(struct clk_notifier_data *ndata, unsigned long mux_reg; /* find out the divider values to use for clock data */ - if (test_bit(CLK_CPU_NEEDS_DEBUG_ALT_DIV, &cpuclk->flags)) { + if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { while ((cfg_data->prate * 1000) != ndata->new_rate) { if (cfg_data->prate == 0) return -EINVAL; @@ -237,7 +237,7 @@ static int exynos_cpuclk_post_rate_change(struct clk_notifier_data *ndata, writel(mux_reg & ~(1 << 16), base + E4210_SRC_CPU); wait_until_mux_stable(base + E4210_STAT_CPU, 16, 1); - if (test_bit(CLK_CPU_NEEDS_DEBUG_ALT_DIV, &cpuclk->flags)) { + if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { div |= (cfg_data->div0 & E4210_DIV0_ATB_MASK); div_mask |= E4210_DIV0_ATB_MASK; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/