diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-20 12:34:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-20 12:34:24 -0400 |
commit | 2615a38f142ffda863dece40120d7fe69af46490 (patch) | |
tree | dc8007bf28a1d91d74fc76f20fe8cad64672df41 | |
parent | e46db8d2ef58f9b515f83be4608cef90ff9ae2c6 (diff) | |
parent | b60bf53abc0323f91ac59b08a7642216281e662e (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 few small fixes for timer drivers:
- Prevent infinite recursion in the arm architected timer driver with
ftrace
- Propagate error codes to the caller in case of failure in EM STI
driver
- Adjust a bogus loop iteration in the arm architected timer driver
- Add a missing Kconfig dependency to the pistachio clocksource to
prevent build failures
- Correctly check for IS_ERR() instead of NULL in the shared timer-of
code"
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource/drivers/arm_arch_timer: Avoid infinite recursion when ftrace is enabled
clocksource/drivers/Kconfig: Fix CLKSRC_PISTACHIO dependencies
clocksource/drivers/timer-of: Checking for IS_ERR() instead of NULL
clocksource/drivers/em_sti: Fix error return codes in em_sti_probe()
clocksource/drivers/arm_arch_timer: Fix mem frame loop initialization
-rw-r--r-- | arch/arm64/include/asm/arch_timer.h | 4 | ||||
-rw-r--r-- | drivers/clocksource/Kconfig | 2 | ||||
-rw-r--r-- | drivers/clocksource/arm_arch_timer.c | 2 | ||||
-rw-r--r-- | drivers/clocksource/em_sti.c | 11 | ||||
-rw-r--r-- | drivers/clocksource/timer-of.c | 4 |
5 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h index 74d08e44a651..a652ce0a5cb2 100644 --- a/arch/arm64/include/asm/arch_timer.h +++ b/arch/arm64/include/asm/arch_timer.h | |||
@@ -65,13 +65,13 @@ DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *, | |||
65 | u64 _val; \ | 65 | u64 _val; \ |
66 | if (needs_unstable_timer_counter_workaround()) { \ | 66 | if (needs_unstable_timer_counter_workaround()) { \ |
67 | const struct arch_timer_erratum_workaround *wa; \ | 67 | const struct arch_timer_erratum_workaround *wa; \ |
68 | preempt_disable(); \ | 68 | preempt_disable_notrace(); \ |
69 | wa = __this_cpu_read(timer_unstable_counter_workaround); \ | 69 | wa = __this_cpu_read(timer_unstable_counter_workaround); \ |
70 | if (wa && wa->read_##reg) \ | 70 | if (wa && wa->read_##reg) \ |
71 | _val = wa->read_##reg(); \ | 71 | _val = wa->read_##reg(); \ |
72 | else \ | 72 | else \ |
73 | _val = read_sysreg(reg); \ | 73 | _val = read_sysreg(reg); \ |
74 | preempt_enable(); \ | 74 | preempt_enable_notrace(); \ |
75 | } else { \ | 75 | } else { \ |
76 | _val = read_sysreg(reg); \ | 76 | _val = read_sysreg(reg); \ |
77 | } \ | 77 | } \ |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index fcae5ca6ac92..54a67f8a28eb 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
@@ -262,7 +262,7 @@ config CLKSRC_LPC32XX | |||
262 | 262 | ||
263 | config CLKSRC_PISTACHIO | 263 | config CLKSRC_PISTACHIO |
264 | bool "Clocksource for Pistachio SoC" if COMPILE_TEST | 264 | bool "Clocksource for Pistachio SoC" if COMPILE_TEST |
265 | depends on HAS_IOMEM | 265 | depends on GENERIC_CLOCKEVENTS && HAS_IOMEM |
266 | select TIMER_OF | 266 | select TIMER_OF |
267 | help | 267 | help |
268 | Enables the clocksource for the Pistachio SoC. | 268 | Enables the clocksource for the Pistachio SoC. |
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index aae87c4c546e..72bbfccef113 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c | |||
@@ -1440,7 +1440,7 @@ static int __init arch_timer_mem_acpi_init(int platform_timer_count) | |||
1440 | * While unlikely, it's theoretically possible that none of the frames | 1440 | * While unlikely, it's theoretically possible that none of the frames |
1441 | * in a timer expose the combination of feature we want. | 1441 | * in a timer expose the combination of feature we want. |
1442 | */ | 1442 | */ |
1443 | for (i = i; i < timer_count; i++) { | 1443 | for (i = 0; i < timer_count; i++) { |
1444 | timer = &timers[i]; | 1444 | timer = &timers[i]; |
1445 | 1445 | ||
1446 | frame = arch_timer_mem_find_best_frame(timer); | 1446 | frame = arch_timer_mem_find_best_frame(timer); |
diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c index bc48cbf6a795..269db74a0658 100644 --- a/drivers/clocksource/em_sti.c +++ b/drivers/clocksource/em_sti.c | |||
@@ -305,7 +305,7 @@ static int em_sti_probe(struct platform_device *pdev) | |||
305 | irq = platform_get_irq(pdev, 0); | 305 | irq = platform_get_irq(pdev, 0); |
306 | if (irq < 0) { | 306 | if (irq < 0) { |
307 | dev_err(&pdev->dev, "failed to get irq\n"); | 307 | dev_err(&pdev->dev, "failed to get irq\n"); |
308 | return -EINVAL; | 308 | return irq; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* map memory, let base point to the STI instance */ | 311 | /* map memory, let base point to the STI instance */ |
@@ -314,11 +314,12 @@ static int em_sti_probe(struct platform_device *pdev) | |||
314 | if (IS_ERR(p->base)) | 314 | if (IS_ERR(p->base)) |
315 | return PTR_ERR(p->base); | 315 | return PTR_ERR(p->base); |
316 | 316 | ||
317 | if (devm_request_irq(&pdev->dev, irq, em_sti_interrupt, | 317 | ret = devm_request_irq(&pdev->dev, irq, em_sti_interrupt, |
318 | IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, | 318 | IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, |
319 | dev_name(&pdev->dev), p)) { | 319 | dev_name(&pdev->dev), p); |
320 | if (ret) { | ||
320 | dev_err(&pdev->dev, "failed to request low IRQ\n"); | 321 | dev_err(&pdev->dev, "failed to request low IRQ\n"); |
321 | return -ENOENT; | 322 | return ret; |
322 | } | 323 | } |
323 | 324 | ||
324 | /* get hold of clock */ | 325 | /* get hold of clock */ |
diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index d509b500a7b5..4d7aef9d9c15 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c | |||
@@ -128,9 +128,9 @@ static __init int timer_base_init(struct device_node *np, | |||
128 | const char *name = of_base->name ? of_base->name : np->full_name; | 128 | const char *name = of_base->name ? of_base->name : np->full_name; |
129 | 129 | ||
130 | of_base->base = of_io_request_and_map(np, of_base->index, name); | 130 | of_base->base = of_io_request_and_map(np, of_base->index, name); |
131 | if (!of_base->base) { | 131 | if (IS_ERR(of_base->base)) { |
132 | pr_err("Failed to iomap (%s)\n", name); | 132 | pr_err("Failed to iomap (%s)\n", name); |
133 | return -ENXIO; | 133 | return PTR_ERR(of_base->base); |
134 | } | 134 | } |
135 | 135 | ||
136 | return 0; | 136 | return 0; |