Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi-ng: Fix inverted test condition in ccu_helper_wait_for_lock

The condition passed to read*_poll_timeout() is the break condition,
i.e. wait for this condition to happen and return success.

The original code assumed the opposite, resulting in a warning when
the PLL clock rate was changed but never lost it's lock as far as
the readout indicated. This was verified by checking the read out
register value.

Fixes: 1d80c14248d6 ("clk: sunxi-ng: Add common infrastructure")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Chen-Yu Tsai and committed by
Stephen Boyd
ed0ab110 29b4817d

+1 -1
+1 -1
drivers/clk/sunxi-ng/ccu_common.c
··· 31 31 return; 32 32 33 33 WARN_ON(readl_relaxed_poll_timeout(common->base + common->reg, reg, 34 - !(reg & lock), 100, 70000)); 34 + reg & lock, 100, 70000)); 35 35 } 36 36 37 37 int sunxi_ccu_probe(struct device_node *node, void __iomem *reg,