diff options
author | Eric Anholt <eric@anholt.net> | 2016-06-01 15:05:34 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-09-07 11:57:22 -0400 |
commit | eddcbe8398fc7103fccd22aa6df6917caf0123bf (patch) | |
tree | 2d9fb24ae78a480f82b903c3ebd67d6b845ba905 | |
parent | e69fdcca836f0b81a2260b69429c8622a80ea891 (diff) |
clk: bcm2835: Mark GPIO clocks enabled at boot as critical
These divide off of PLLD_PER and are used for the ethernet and wifi
PHYs source PLLs. Neither of them is currently represented by a phy
device that would grab the clock for us.
This keeps other drivers from killing the networking PHYs when they
disable their own clocks and trigger PLLD_PER's refcount going to 0.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/bcm/clk-bcm2835.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index d9db03cb3fd8..400615baea97 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c | |||
@@ -1239,6 +1239,12 @@ static struct clk *bcm2835_register_clock(struct bcm2835_cprman *cprman, | |||
1239 | } else { | 1239 | } else { |
1240 | init.ops = &bcm2835_clock_clk_ops; | 1240 | init.ops = &bcm2835_clock_clk_ops; |
1241 | init.flags |= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; | 1241 | init.flags |= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE; |
1242 | |||
1243 | /* If the clock wasn't actually enabled at boot, it's not | ||
1244 | * critical. | ||
1245 | */ | ||
1246 | if (!(cprman_read(cprman, data->ctl_reg) & CM_ENABLE)) | ||
1247 | init.flags &= ~CLK_IS_CRITICAL; | ||
1242 | } | 1248 | } |
1243 | 1249 | ||
1244 | clock = devm_kzalloc(cprman->dev, sizeof(*clock), GFP_KERNEL); | 1250 | clock = devm_kzalloc(cprman->dev, sizeof(*clock), GFP_KERNEL); |
@@ -1708,13 +1714,15 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { | |||
1708 | .div_reg = CM_GP1DIV, | 1714 | .div_reg = CM_GP1DIV, |
1709 | .int_bits = 12, | 1715 | .int_bits = 12, |
1710 | .frac_bits = 12, | 1716 | .frac_bits = 12, |
1717 | .flags = CLK_IS_CRITICAL, | ||
1711 | .is_mash_clock = true), | 1718 | .is_mash_clock = true), |
1712 | [BCM2835_CLOCK_GP2] = REGISTER_PER_CLK( | 1719 | [BCM2835_CLOCK_GP2] = REGISTER_PER_CLK( |
1713 | .name = "gp2", | 1720 | .name = "gp2", |
1714 | .ctl_reg = CM_GP2CTL, | 1721 | .ctl_reg = CM_GP2CTL, |
1715 | .div_reg = CM_GP2DIV, | 1722 | .div_reg = CM_GP2DIV, |
1716 | .int_bits = 12, | 1723 | .int_bits = 12, |
1717 | .frac_bits = 12), | 1724 | .frac_bits = 12, |
1725 | .flags = CLK_IS_CRITICAL), | ||
1718 | 1726 | ||
1719 | /* HDMI state machine */ | 1727 | /* HDMI state machine */ |
1720 | [BCM2835_CLOCK_HSM] = REGISTER_PER_CLK( | 1728 | [BCM2835_CLOCK_HSM] = REGISTER_PER_CLK( |