Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254AbcDVHj3 (ORCPT ); Fri, 22 Apr 2016 03:39:29 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:53643 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbcDVHj2 (ORCPT ); Fri, 22 Apr 2016 03:39:28 -0400 X-AuditID: cbfec7f5-f792a6d000001302-7a-5719d52cebcc From: Krzysztof Kozlowski To: Russell King , Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Zapolskiy , Bartlomiej Zolnierkiewicz Subject: [PATCH] ARM: EXYNOS: Properly skip unitialized parent clock in power domain on Date: Fri, 22 Apr 2016 09:39:18 +0200 Message-id: <1461310758-20615-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4ZV2dq5LhBncP6VpsnLGe1eL1C0OL /sevmS02Pb7GanF51xw2ixnn9zFZ3L7Ma/H/VzOzA4dHS3MPm8emVZ1sHpuX1Hv8WziFxaNv yypGj8+b5ALYorhsUlJzMstSi/TtErgyfv3RLljMXTFn43LGBsbFnF2MnBwSAiYSs6etYYew xSQu3FvP1sXIxSEksJRRYsufT0wQTiOTxKM5e1lBqtgEjCU2L18CViUi8IRRYt2jJWDtzAKx EpNO9TGC2MICkRL9N46wgdgsAqoSXRNWMXcxcnDwCrhLLNvMA7FNTuLkscmsExi5FzAyrGIU TS1NLihOSs810itOzC0uzUvXS87P3cQICZmvOxiXHrM6xCjAwajEw/uhQTJciDWxrLgy9xCj BAezkgjvvPNAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwzd70PERJITyxJzU5NLUgtgskycXBK NTDGqbxwcjDWuHCD3+eqyzfZu9dZki5213w15ryct1FoWWu7hdDu6RtKhf3YeZQC3VYfMduq //dsy54Slb76wOypBvJ//+SJJZ8yvTJdT3mDhg2TaMM5z/JbNuXzrglK+YsdmXO6WzikpnpC qvh2PhahwzNbdszg7fte9uLnDfmN0nM/XPh6IkiJpTgj0VCLuag4EQCmtEiSFQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 33 We want to skip reparenting a clock on turning on power domain, if we do not have the parent yet. The parent is obtained when turning the domain off. However due to a typo, the loop is continued on IS_ERR() of clock being reparented, not on the IS_ERR() of the parent. Theoretically this could lead to OOPS on first turn on of a power domain, if there was no turn off before. Practically that should never happen because all power domains are turned on by default (reset value, bootloader does not turn off them usually) so the first action will be always turn off. Fixes: 29e5eea06bc1 ("ARM: EXYNOS: Get current parent clock for power domain on/off") Reported-by: Vladimir Zapolskiy Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/pm_domains.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 7c21760f590f..875a2bab64f6 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -92,7 +92,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) if (IS_ERR(pd->clk[i])) break; - if (IS_ERR(pd->clk[i])) + if (IS_ERR(pd->pclk[i])) continue; /* Skip on first power up */ if (clk_set_parent(pd->clk[i], pd->pclk[i])) pr_err("%s: error setting parent to clock%d\n", -- 1.9.1