diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-04 14:34:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-04 14:34:49 -0500 |
commit | 4c4ce3022dc7352d05de4d8e1602c9a2a14458bf (patch) | |
tree | 303d93fe80bb913ed780b82c2ef911026db1f170 /drivers | |
parent | ff8d583621143d26123ac1e14470de9bd2384a31 (diff) | |
parent | c52232a49e203a65a6e1a670cd5262f59e9364a0 (diff) |
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner:
"A small set of fixes from the timer departement:
- Add a missing timer wheel clock forward when migrating timers off a
unplugged CPU to prevent operating on a stale clock base and
missing timer deadlines.
- Use the proper shift count to extract data from a register value to
prevent evaluating unrelated bits
- Make the error return check in the FSL timer driver work correctly.
Checking an unsigned variable for less than zero does not really
work well.
- Clarify the confusing comments in the ARC timer code"
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timers: Forward timer base before migrating timers
clocksource/drivers/arc_timer: Update some comments
clocksource/drivers/mips-gic-timer: Use correct shift count to extract data
clocksource/drivers/fsl_ftm_timer: Fix error return checking
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clocksource/arc_timer.c | 11 | ||||
-rw-r--r-- | drivers/clocksource/fsl_ftm_timer.c | 2 | ||||
-rw-r--r-- | drivers/clocksource/mips-gic-timer.c | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/drivers/clocksource/arc_timer.c b/drivers/clocksource/arc_timer.c index 4927355f9cbe..471b428d8034 100644 --- a/drivers/clocksource/arc_timer.c +++ b/drivers/clocksource/arc_timer.c | |||
@@ -251,9 +251,14 @@ static irqreturn_t timer_irq_handler(int irq, void *dev_id) | |||
251 | int irq_reenable = clockevent_state_periodic(evt); | 251 | int irq_reenable = clockevent_state_periodic(evt); |
252 | 252 | ||
253 | /* | 253 | /* |
254 | * Any write to CTRL reg ACks the interrupt, we rewrite the | 254 | * 1. ACK the interrupt |
255 | * Count when [N]ot [H]alted bit. | 255 | * - For ARC700, any write to CTRL reg ACKs it, so just rewrite |
256 | * And re-arm it if perioid by [I]nterrupt [E]nable bit | 256 | * Count when [N]ot [H]alted bit. |
257 | * - For HS3x, it is a bit subtle. On taken count-down interrupt, | ||
258 | * IP bit [3] is set, which needs to be cleared for ACK'ing. | ||
259 | * The write below can only update the other two bits, hence | ||
260 | * explicitly clears IP bit | ||
261 | * 2. Re-arm interrupt if periodic by writing to IE bit [0] | ||
257 | */ | 262 | */ |
258 | write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH); | 263 | write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH); |
259 | 264 | ||
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c index 3ee7e6fea621..846d18daf893 100644 --- a/drivers/clocksource/fsl_ftm_timer.c +++ b/drivers/clocksource/fsl_ftm_timer.c | |||
@@ -281,7 +281,7 @@ static int __init __ftm_clk_init(struct device_node *np, char *cnt_name, | |||
281 | 281 | ||
282 | static unsigned long __init ftm_clk_init(struct device_node *np) | 282 | static unsigned long __init ftm_clk_init(struct device_node *np) |
283 | { | 283 | { |
284 | unsigned long freq; | 284 | long freq; |
285 | 285 | ||
286 | freq = __ftm_clk_init(np, "ftm-evt-counter-en", "ftm-evt"); | 286 | freq = __ftm_clk_init(np, "ftm-evt-counter-en", "ftm-evt"); |
287 | if (freq <= 0) | 287 | if (freq <= 0) |
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index 65e18c86d9b9..986b6796b631 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c | |||
@@ -166,7 +166,7 @@ static int __init __gic_clocksource_init(void) | |||
166 | 166 | ||
167 | /* Set clocksource mask. */ | 167 | /* Set clocksource mask. */ |
168 | count_width = read_gic_config() & GIC_CONFIG_COUNTBITS; | 168 | count_width = read_gic_config() & GIC_CONFIG_COUNTBITS; |
169 | count_width >>= __fls(GIC_CONFIG_COUNTBITS); | 169 | count_width >>= __ffs(GIC_CONFIG_COUNTBITS); |
170 | count_width *= 4; | 170 | count_width *= 4; |
171 | count_width += 32; | 171 | count_width += 32; |
172 | gic_clocksource.mask = CLOCKSOURCE_MASK(count_width); | 172 | gic_clocksource.mask = CLOCKSOURCE_MASK(count_width); |