bcm27xx: add linux 5.4 support
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0221-clk-bcm2835-Don-t-wait-for-pllh-lock.patch
1 From 35d84e9f2944b72ccfc508dc5c540c526ab351c1 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 23 Jan 2019 16:11:50 +0000
4 Subject: [PATCH] clk-bcm2835: Don't wait for pllh lock
5
6 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7 ---
8 drivers/clk/bcm/clk-bcm2835.c | 18 ++++++++++--------
9 1 file changed, 10 insertions(+), 8 deletions(-)
10
11 --- a/drivers/clk/bcm/clk-bcm2835.c
12 +++ b/drivers/clk/bcm/clk-bcm2835.c
13 @@ -628,15 +628,17 @@ static int bcm2835_pll_on(struct clk_hw
14 spin_unlock(&cprman->regs_lock);
15
16 /* Wait for the PLL to lock. */
17 - timeout = ktime_add_ns(ktime_get(), LOCK_TIMEOUT_NS);
18 - while (!(cprman_read(cprman, CM_LOCK) & data->lock_mask)) {
19 - if (ktime_after(ktime_get(), timeout)) {
20 - dev_err(cprman->dev, "%s: couldn't lock PLL\n",
21 - clk_hw_get_name(hw));
22 - return -ETIMEDOUT;
23 - }
24 + if (strcmp(data->name, "pllh")) {
25 + timeout = ktime_add_ns(ktime_get(), LOCK_TIMEOUT_NS);
26 + while (!(cprman_read(cprman, CM_LOCK) & data->lock_mask)) {
27 + if (ktime_after(ktime_get(), timeout)) {
28 + dev_err(cprman->dev, "%s: couldn't lock PLL\n",
29 + clk_hw_get_name(hw));
30 + return -ETIMEDOUT;
31 + }
32
33 - cpu_relax();
34 + cpu_relax();
35 + }
36 }
37
38 cprman_write(cprman, data->a2w_ctrl_reg,