aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2015-07-24 15:21:12 -0400
committerStephen Boyd <sboyd@codeaurora.org>2015-07-28 14:59:28 -0400
commit661e2180cf050a2f859d466f30d74e990b9345be (patch)
treedee0ccf4613fa0fc115145eb144c02819e24e44b
parent169f05e80522e2848c9089a17976ebf31e735d5c (diff)
clk: basic-type: Silence warnings about lock imbalances
The basic clock types use conditional locking for the register accessor spinlocks. Add __acquire() and __release() markings in the right locations so that sparse isn't tripped up on the conditional locking. drivers/clk/clk-mux.c:68:12: warning: context imbalance in 'clk_mux_set_parent' - different lock contexts for basic block drivers/clk/clk-divider.c:379:12: warning: context imbalance in 'clk_divider_set_rate' - different lock contexts for basic block drivers/clk/clk-gate.c:71:9: warning: context imbalance in 'clk_gate_endisable' - different lock contexts for basic block drivers/clk/clk-fractional-divider.c:36:9: warning: context imbalance in 'clk_fd_recalc_rate' - different lock contexts for basic block drivers/clk/clk-fractional-divider.c:68:12: warning: context imbalance in 'clk_fd_set_rate' - different lock contexts for basic block Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r--drivers/clk/clk-divider.c4
-rw-r--r--drivers/clk/clk-fractional-divider.c8
-rw-r--r--drivers/clk/clk-gate.c4
-rw-r--r--drivers/clk/clk-mux.c4
4 files changed, 20 insertions, 0 deletions
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 2cab88b9c1a8..a417162537b8 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -395,6 +395,8 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
395 395
396 if (divider->lock) 396 if (divider->lock)
397 spin_lock_irqsave(divider->lock, flags); 397 spin_lock_irqsave(divider->lock, flags);
398 else
399 __acquire(divider->lock);
398 400
399 if (divider->flags & CLK_DIVIDER_HIWORD_MASK) { 401 if (divider->flags & CLK_DIVIDER_HIWORD_MASK) {
400 val = div_mask(divider->width) << (divider->shift + 16); 402 val = div_mask(divider->width) << (divider->shift + 16);
@@ -407,6 +409,8 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
407 409
408 if (divider->lock) 410 if (divider->lock)
409 spin_unlock_irqrestore(divider->lock, flags); 411 spin_unlock_irqrestore(divider->lock, flags);
412 else
413 __release(divider->lock);
410 414
411 return 0; 415 return 0;
412} 416}
diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c
index 140eb5844dc4..e85f856b8592 100644
--- a/drivers/clk/clk-fractional-divider.c
+++ b/drivers/clk/clk-fractional-divider.c
@@ -27,11 +27,15 @@ static unsigned long clk_fd_recalc_rate(struct clk_hw *hw,
27 27
28 if (fd->lock) 28 if (fd->lock)
29 spin_lock_irqsave(fd->lock, flags); 29 spin_lock_irqsave(fd->lock, flags);
30 else
31 __acquire(fd->lock);
30 32
31 val = clk_readl(fd->reg); 33 val = clk_readl(fd->reg);
32 34
33 if (fd->lock) 35 if (fd->lock)
34 spin_unlock_irqrestore(fd->lock, flags); 36 spin_unlock_irqrestore(fd->lock, flags);
37 else
38 __release(fd->lock);
35 39
36 m = (val & fd->mmask) >> fd->mshift; 40 m = (val & fd->mmask) >> fd->mshift;
37 n = (val & fd->nmask) >> fd->nshift; 41 n = (val & fd->nmask) >> fd->nshift;
@@ -80,6 +84,8 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate,
80 84
81 if (fd->lock) 85 if (fd->lock)
82 spin_lock_irqsave(fd->lock, flags); 86 spin_lock_irqsave(fd->lock, flags);
87 else
88 __acquire(fd->lock);
83 89
84 val = clk_readl(fd->reg); 90 val = clk_readl(fd->reg);
85 val &= ~(fd->mmask | fd->nmask); 91 val &= ~(fd->mmask | fd->nmask);
@@ -88,6 +94,8 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate,
88 94
89 if (fd->lock) 95 if (fd->lock)
90 spin_unlock_irqrestore(fd->lock, flags); 96 spin_unlock_irqrestore(fd->lock, flags);
97 else
98 __release(fd->lock);
91 99
92 return 0; 100 return 0;
93} 101}
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 551dd0672794..de0b322f5f58 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -52,6 +52,8 @@ static void clk_gate_endisable(struct clk_hw *hw, int enable)
52 52
53 if (gate->lock) 53 if (gate->lock)
54 spin_lock_irqsave(gate->lock, flags); 54 spin_lock_irqsave(gate->lock, flags);
55 else
56 __acquire(gate->lock);
55 57
56 if (gate->flags & CLK_GATE_HIWORD_MASK) { 58 if (gate->flags & CLK_GATE_HIWORD_MASK) {
57 reg = BIT(gate->bit_idx + 16); 59 reg = BIT(gate->bit_idx + 16);
@@ -70,6 +72,8 @@ static void clk_gate_endisable(struct clk_hw *hw, int enable)
70 72
71 if (gate->lock) 73 if (gate->lock)
72 spin_unlock_irqrestore(gate->lock, flags); 74 spin_unlock_irqrestore(gate->lock, flags);
75 else
76 __release(gate->lock);
73} 77}
74 78
75static int clk_gate_enable(struct clk_hw *hw) 79static int clk_gate_enable(struct clk_hw *hw)
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index c705cf573569..33c09a3bfa51 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -84,6 +84,8 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
84 84
85 if (mux->lock) 85 if (mux->lock)
86 spin_lock_irqsave(mux->lock, flags); 86 spin_lock_irqsave(mux->lock, flags);
87 else
88 __acquire(mux->lock);
87 89
88 if (mux->flags & CLK_MUX_HIWORD_MASK) { 90 if (mux->flags & CLK_MUX_HIWORD_MASK) {
89 val = mux->mask << (mux->shift + 16); 91 val = mux->mask << (mux->shift + 16);
@@ -96,6 +98,8 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
96 98
97 if (mux->lock) 99 if (mux->lock)
98 spin_unlock_irqrestore(mux->lock, flags); 100 spin_unlock_irqrestore(mux->lock, flags);
101 else
102 __release(mux->lock);
99 103
100 return 0; 104 return 0;
101} 105}