diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2016-04-24 13:03:39 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2016-04-24 13:03:39 +0200 |
commit | 525b311bf869d7e252d744e501e227263a955c8e (patch) | |
tree | 4c644f534e5b577b9256d26b1e9a2e4a0453698e /target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch | |
parent | 0ab31bfced9666f3fb58acdb5833a93e4f4f5f7e (diff) | |
download | mtk-20170518-525b311bf869d7e252d744e501e227263a955c8e.zip mtk-20170518-525b311bf869d7e252d744e501e227263a955c8e.tar.gz mtk-20170518-525b311bf869d7e252d744e501e227263a955c8e.tar.bz2 |
brcm2708: update linux 4.4 patches to latest version
As usual these patches were extracted from the raspberry pi repo:
https://github.com/raspberrypi/linux/tree/rpi-4.4.y
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch')
-rw-r--r-- | target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch new file mode 100644 index 0000000..29f4552 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch @@ -0,0 +1,53 @@ +From 39c3c0d0a8d038a692b95cc13e7d6acf2d04cf14 Mon Sep 17 00:00:00 2001 +From: Martin Sperl <kernel@martin.sperl.org> +Date: Mon, 29 Feb 2016 11:39:18 +0000 +Subject: [PATCH 257/304] clk: bcm2835: add locking to pll*_on/off methods + +Add missing locking to: +* bcm2835_pll_divider_on +* bcm2835_pll_divider_off +to protect the read modify write cycle for the +register access protecting both cm_reg and a2w_reg +registers. + +Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the +audio domain clocks") + +Signed-off-by: Martin Sperl <kernel@martin.sperl.org> +Signed-off-by: Eric Anholt <eric@anholt.net> +Reviewed-by: Eric Anholt <eric@anholt.net> +(cherry picked from commit ec36a5c6682fdd5328abf15c3c67281bed0241d7) +--- + drivers/clk/bcm/clk-bcm2835.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -1097,10 +1097,12 @@ static void bcm2835_pll_divider_off(stru + struct bcm2835_cprman *cprman = divider->cprman; + const struct bcm2835_pll_divider_data *data = divider->data; + ++ spin_lock(&cprman->regs_lock); + cprman_write(cprman, data->cm_reg, + (cprman_read(cprman, data->cm_reg) & + ~data->load_mask) | data->hold_mask); + cprman_write(cprman, data->a2w_reg, A2W_PLL_CHANNEL_DISABLE); ++ spin_unlock(&cprman->regs_lock); + } + + static int bcm2835_pll_divider_on(struct clk_hw *hw) +@@ -1109,12 +1111,14 @@ static int bcm2835_pll_divider_on(struct + struct bcm2835_cprman *cprman = divider->cprman; + const struct bcm2835_pll_divider_data *data = divider->data; + ++ spin_lock(&cprman->regs_lock); + cprman_write(cprman, data->a2w_reg, + cprman_read(cprman, data->a2w_reg) & + ~A2W_PLL_CHANNEL_DISABLE); + + cprman_write(cprman, data->cm_reg, + cprman_read(cprman, data->cm_reg) & ~data->hold_mask); ++ spin_unlock(&cprman->regs_lock); + + return 0; + } |