Thread (77 messages) 77 messages, 2 authors, 2011-02-21

Re: [PATCH v2 14/21] ARM: tegra: clock: Refcount periph clock enables

From: Olof Johansson <hidden>
Date: 2011-02-21 04:18:13
Also in: linux-arm-kernel, lkml

Hi,

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Some peripheral clocks share enable bits.  Refcount the enables so
that calling clk_disable on one clock will not turn off another
clock.

Signed-off-by: Colin Cross <redacted>
---
 arch/arm/mach-tegra/tegra2_clocks.c |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index 196c249..2734889 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -154,6 +154,12 @@ static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
 */
 static DEFINE_SPINLOCK(clock_register_lock);

+/*
+ * Some peripheral clocks share an enable bit, so refcount the enable bits
+ * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
+ */
+static int tegra_periph_clk_enable_refcount[3 * 32];
Given that this is always locked when incrementing/decrementing,
should it just be switched to an array of atomics instead?


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help