Commit a0a966b8 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski

ARM: EXYNOS: Properly skip unitialized parent clock in power domain on

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: 29e5eea0 ("ARM: EXYNOS: Get current parent clock for power domain on/off")
Reported-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
parent f55532a0
...@@ -92,7 +92,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) ...@@ -92,7 +92,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
if (IS_ERR(pd->clk[i])) if (IS_ERR(pd->clk[i]))
break; break;
if (IS_ERR(pd->clk[i])) if (IS_ERR(pd->pclk[i]))
continue; /* Skip on first power up */ continue; /* Skip on first power up */
if (clk_set_parent(pd->clk[i], pd->pclk[i])) if (clk_set_parent(pd->clk[i], pd->pclk[i]))
pr_err("%s: error setting parent to clock%d\n", pr_err("%s: error setting parent to clock%d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment