]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.13/clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.13 / clk-bcm2835-pll_off-should-only-update-cm_pll_anarst.patch
CommitLineData
375caec0
GKH
1From 6727f086cfe4ddcc651eb2bf4301abfcf619be06 Mon Sep 17 00:00:00 2001
2From: Martin Sperl <kernel@martin.sperl.org>
3Date: Mon, 29 Feb 2016 11:39:17 +0000
4Subject: clk: bcm2835: pll_off should only update CM_PLL_ANARST
5
6From: Martin Sperl <kernel@martin.sperl.org>
7
8commit 6727f086cfe4ddcc651eb2bf4301abfcf619be06 upstream.
9
10bcm2835_pll_off is currently assigning CM_PLL_ANARST to the control
11register, which may lose the other bits that are currently set by the
12clock dividers.
13
14It also now locks during the read/modify/write cycle of both
15registers.
16
17Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the
18audio domain clocks")
19
20Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
21Signed-off-by: Eric Anholt <eric@anholt.net>
22Reviewed-by: Eric Anholt <eric@anholt.net>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 drivers/clk/bcm/clk-bcm2835.c | 10 ++++++++--
27 1 file changed, 8 insertions(+), 2 deletions(-)
28
29--- a/drivers/clk/bcm/clk-bcm2835.c
30+++ b/drivers/clk/bcm/clk-bcm2835.c
31@@ -890,8 +890,14 @@ static void bcm2835_pll_off(struct clk_h
32 struct bcm2835_cprman *cprman = pll->cprman;
33 const struct bcm2835_pll_data *data = pll->data;
34
35- cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST);
36- cprman_write(cprman, data->a2w_ctrl_reg, A2W_PLL_CTRL_PWRDN);
37+ spin_lock(&cprman->regs_lock);
38+ cprman_write(cprman, data->cm_ctrl_reg,
39+ cprman_read(cprman, data->cm_ctrl_reg) |
40+ CM_PLL_ANARST);
41+ cprman_write(cprman, data->a2w_ctrl_reg,
42+ cprman_read(cprman, data->a2w_ctrl_reg) |
43+ A2W_PLL_CTRL_PWRDN);
44+ spin_unlock(&cprman->regs_lock);
45 }
46
47 static int bcm2835_pll_on(struct clk_hw *hw)