Skip to contentSkip to conversation

clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk

PATCH New Boris Brezillon 3 participants 3 messages Dec 1, 2016 – Dec 8, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk

bcm2835_pll_divider_off() is resetting the divider field in the A2W reg to zero when disabling the clock.

Make sure we preserve this value by reading the previous a2w_reg value first and ORing the result with A2W_PLL_CHANNEL_DISABLE.

Fixes 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks")
---
 drivers/clk/bcm/clk-bcm2835.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/bcm/clk-bcm2835.c +3 -1
index 836d07550be3..2acaa77ad482 100644
@@ -751,7 +751,9 @@ static void bcm2835_pll_divider_off(struct clk_hw *hw)
 	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);
+	cprman_write(cprman, data->a2w_reg,
+		     cprman_read(cprman, data->a2w_reg) |
+		     A2W_PLL_CHANNEL_DISABLE);
 	spin_unlock(&cprman->regs_lock);
 }
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk

Quoted 9 lines · Boris Brezillon

bcm2835_pll_divider_off() is resetting the divider field in the A2W reg to zero when disabling the clock.

Make sure we preserve this value by reading the previous a2w_reg value first and ORing the result with A2W_PLL_CHANNEL_DISABLE.

Fixes 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks")

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161201/9182a06b/attachment.sig>

Applied
#2 lore raw

PATCH 1/1 clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk

In reply to Boris Brezillon
Quoted 10 lines · Boris Brezillon

bcm2835_pll_divider_off() is resetting the divider field in the A2W reg to zero when disabling the clock.

Make sure we preserve this value by reading the previous a2w_reg value first and ORing the result with A2W_PLL_CHANNEL_DISABLE.

Fixes 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks")

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project