c8e7151003f4e67e26d13b3bf1d91e5bbd3aec0a
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.9 / 950-0185-clk-bcm2835-Mark-used-PLLs-and-dividers-CRITICAL.patch
1 From a2ca8b47db0d08735e1c0ebeaf34e88522091662 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 13 Feb 2017 17:20:08 +0000
4 Subject: [PATCH] clk-bcm2835: Mark used PLLs and dividers CRITICAL
5
6 The VPU configures and relies on several PLLs and dividers. Mark all
7 enabled dividers and their PLLs as CRITICAL to prevent the kernel from
8 switching them off.
9
10 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
11 ---
12 drivers/clk/bcm/clk-bcm2835.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15 --- a/drivers/clk/bcm/clk-bcm2835.c
16 +++ b/drivers/clk/bcm/clk-bcm2835.c
17 @@ -1370,6 +1370,11 @@ bcm2835_register_pll_divider(struct bcm2
18 divider->div.hw.init = &init;
19 divider->div.table = NULL;
20
21 + if (!(cprman_read(cprman, data->cm_reg) & data->hold_mask)) {
22 + init.flags |= CLK_IS_CRITICAL;
23 + divider->div.flags |= CLK_IS_CRITICAL;
24 + }
25 +
26 divider->cprman = cprman;
27 divider->data = data;
28