Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'timers-core-2023-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull more timer updates from Thomas Gleixner:
"Timekeeping and clocksource/event driver updates the second batch:

- A trivial documentation fix in the timekeeping core

- A really boring set of small fixes, enhancements and cleanups in
the drivers code. No new clocksource/clockevent drivers for a
change"

* tag 'timers-core-2023-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timekeeping: Fix references to nonexistent ktime_get_fast_ns()
dt-bindings: timer: rockchip: Add rk3588 compatible
dt-bindings: timer: rockchip: Drop superfluous rk3288 compatible
clocksource/drivers/ti: Use of_property_read_bool() for boolean properties
clocksource/drivers/timer-ti-dm: Fix finding alwon timer
clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails
clocksource/drivers/stm32-lp: Drop of_match_ptr for ID table
clocksource/drivers/timer-ti-dm: Convert to platform remove callback returning void
clocksource/drivers/timer-tegra186: Convert to platform remove callback returning void
clocksource/drivers/timer-ti-dm: Improve error message in .remove
clocksource/drivers/timer-stm32-lp: Mark driver as non-removable
clocksource/drivers/sh_mtu2: Mark driver as non-removable
clocksource/drivers/timer-ti-dm: Use of_address_to_resource()
clocksource/drivers/timer-imx-gpt: Remove non-DT function
clocksource/drivers/timer-mediatek: Split out CPUXGPT timers
clocksource/drivers/exynos_mct: Explicitly return 0 for shared timer

+220 -204
+1 -1
Documentation/devicetree/bindings/timer/rockchip,rk-timer.yaml
··· 23 23 - rockchip,rk3188-timer 24 24 - rockchip,rk3228-timer 25 25 - rockchip,rk3229-timer 26 - - rockchip,rk3288-timer 27 26 - rockchip,rk3368-timer 27 + - rockchip,rk3588-timer 28 28 - rockchip,px30-timer 29 29 - const: rockchip,rk3288-timer 30 30 reg:
+9
drivers/clocksource/Kconfig
··· 479 479 help 480 480 Support for Mediatek timer driver. 481 481 482 + config MTK_CPUX_TIMER 483 + bool "MediaTek CPUX timer driver" if COMPILE_TEST 484 + depends on HAS_IOMEM 485 + default ARCH_MEDIATEK 486 + select TIMER_OF 487 + select CLKSRC_MMIO 488 + help 489 + Support for MediaTek CPUXGPT timer driver. 490 + 482 491 config SPRD_TIMER 483 492 bool "Spreadtrum timer driver" if EXPERT 484 493 depends on HAS_IOMEM
+1
drivers/clocksource/Makefile
··· 51 51 obj-$(CONFIG_VF_PIT_TIMER) += timer-vf-pit.o 52 52 obj-$(CONFIG_CLKSRC_QCOM) += timer-qcom.o 53 53 obj-$(CONFIG_MTK_TIMER) += timer-mediatek.o 54 + obj-$(CONFIG_MTK_CPUX_TIMER) += timer-mediatek-cpux.o 54 55 obj-$(CONFIG_CLKSRC_PISTACHIO) += timer-pistachio.o 55 56 obj-$(CONFIG_CLKSRC_TI_32K) += timer-ti-32k.o 56 57 obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o
+1 -1
drivers/clocksource/exynos_mct.c
··· 682 682 * processor cannot use the global comparator. 683 683 */ 684 684 if (frc_shared) 685 - return ret; 685 + return 0; 686 686 687 687 return exynos4_clockevent_init(); 688 688 }
+1 -6
drivers/clocksource/sh_mtu2.c
··· 484 484 return 0; 485 485 } 486 486 487 - static int sh_mtu2_remove(struct platform_device *pdev) 488 - { 489 - return -EBUSY; /* cannot unregister clockevent */ 490 - } 491 - 492 487 static const struct platform_device_id sh_mtu2_id_table[] = { 493 488 { "sh-mtu2", 0 }, 494 489 { }, ··· 498 503 499 504 static struct platform_driver sh_mtu2_device_driver = { 500 505 .probe = sh_mtu2_probe, 501 - .remove = sh_mtu2_remove, 502 506 .driver = { 503 507 .name = "sh_mtu2", 504 508 .of_match_table = of_match_ptr(sh_mtu2_of_table), 509 + .suppress_bind_attrs = true, 505 510 }, 506 511 .id_table = sh_mtu2_id_table, 507 512 };
+24 -6
drivers/clocksource/timer-davinci.c
··· 257 257 resource_size(&timer_cfg->reg), 258 258 "davinci-timer")) { 259 259 pr_err("Unable to request memory region\n"); 260 - return -EBUSY; 260 + rv = -EBUSY; 261 + goto exit_clk_disable; 261 262 } 262 263 263 264 base = ioremap(timer_cfg->reg.start, resource_size(&timer_cfg->reg)); 264 265 if (!base) { 265 266 pr_err("Unable to map the register range\n"); 266 - return -ENOMEM; 267 + rv = -ENOMEM; 268 + goto exit_mem_region; 267 269 } 268 270 269 271 davinci_timer_init(base); 270 272 tick_rate = clk_get_rate(clk); 271 273 272 274 clockevent = kzalloc(sizeof(*clockevent), GFP_KERNEL); 273 - if (!clockevent) 274 - return -ENOMEM; 275 + if (!clockevent) { 276 + rv = -ENOMEM; 277 + goto exit_iounmap_base; 278 + } 275 279 276 280 clockevent->dev.name = "tim12"; 277 281 clockevent->dev.features = CLOCK_EVT_FEAT_ONESHOT; ··· 300 296 "clockevent/tim12", clockevent); 301 297 if (rv) { 302 298 pr_err("Unable to request the clockevent interrupt\n"); 303 - return rv; 299 + goto exit_free_clockevent; 304 300 } 305 301 306 302 davinci_clocksource.dev.rating = 300; ··· 327 323 rv = clocksource_register_hz(&davinci_clocksource.dev, tick_rate); 328 324 if (rv) { 329 325 pr_err("Unable to register clocksource\n"); 330 - return rv; 326 + goto exit_free_irq; 331 327 } 332 328 333 329 sched_clock_register(davinci_timer_read_sched_clock, 334 330 DAVINCI_TIMER_CLKSRC_BITS, tick_rate); 335 331 336 332 return 0; 333 + 334 + exit_free_irq: 335 + free_irq(timer_cfg->irq[DAVINCI_TIMER_CLOCKEVENT_IRQ].start, 336 + clockevent); 337 + exit_free_clockevent: 338 + kfree(clockevent); 339 + exit_iounmap_base: 340 + iounmap(base); 341 + exit_mem_region: 342 + release_mem_region(timer_cfg->reg.start, 343 + resource_size(&timer_cfg->reg)); 344 + exit_clk_disable: 345 + clk_disable_unprepare(clk); 346 + return rv; 337 347 } 338 348 339 349 static int __init of_davinci_timer_register(struct device_node *np)
-19
drivers/clocksource/timer-imx-gpt.c
··· 420 420 return mxc_clockevent_init(imxtm); 421 421 } 422 422 423 - void __init mxc_timer_init(unsigned long pbase, int irq, enum imx_gpt_type type) 424 - { 425 - struct imx_timer *imxtm; 426 - 427 - imxtm = kzalloc(sizeof(*imxtm), GFP_KERNEL); 428 - BUG_ON(!imxtm); 429 - 430 - imxtm->clk_per = clk_get_sys("imx-gpt.0", "per"); 431 - imxtm->clk_ipg = clk_get_sys("imx-gpt.0", "ipg"); 432 - 433 - imxtm->base = ioremap(pbase, SZ_4K); 434 - BUG_ON(!imxtm->base); 435 - 436 - imxtm->type = type; 437 - imxtm->irq = irq; 438 - 439 - _mxc_timer_init(imxtm); 440 - } 441 - 442 423 static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type type) 443 424 { 444 425 struct imx_timer *imxtm;
+140
drivers/clocksource/timer-mediatek-cpux.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * MediaTek SoCs CPUX General Purpose Timer handling 4 + * 5 + * Based on timer-mediatek.c: 6 + * Copyright (C) 2014 Matthias Brugger <matthias.bgg@gmail.com> 7 + * 8 + * Copyright (C) 2022 Collabora Ltd. 9 + * AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 10 + */ 11 + 12 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13 + 14 + #include <linux/clockchips.h> 15 + #include <linux/clocksource.h> 16 + #include <linux/interrupt.h> 17 + #include <linux/irqreturn.h> 18 + #include <linux/sched_clock.h> 19 + #include <linux/slab.h> 20 + #include "timer-of.h" 21 + 22 + #define TIMER_SYNC_TICKS 3 23 + 24 + /* cpux mcusys wrapper */ 25 + #define CPUX_CON_REG 0x0 26 + #define CPUX_IDX_REG 0x4 27 + 28 + /* cpux */ 29 + #define CPUX_IDX_GLOBAL_CTRL 0x0 30 + #define CPUX_ENABLE BIT(0) 31 + #define CPUX_CLK_DIV_MASK GENMASK(10, 8) 32 + #define CPUX_CLK_DIV1 BIT(8) 33 + #define CPUX_CLK_DIV2 BIT(9) 34 + #define CPUX_CLK_DIV4 BIT(10) 35 + #define CPUX_IDX_GLOBAL_IRQ 0x30 36 + 37 + static u32 mtk_cpux_readl(u32 reg_idx, struct timer_of *to) 38 + { 39 + writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG); 40 + return readl(timer_of_base(to) + CPUX_CON_REG); 41 + } 42 + 43 + static void mtk_cpux_writel(u32 val, u32 reg_idx, struct timer_of *to) 44 + { 45 + writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG); 46 + writel(val, timer_of_base(to) + CPUX_CON_REG); 47 + } 48 + 49 + static void mtk_cpux_set_irq(struct timer_of *to, bool enable) 50 + { 51 + const unsigned long *irq_mask = cpumask_bits(cpu_possible_mask); 52 + u32 val; 53 + 54 + val = mtk_cpux_readl(CPUX_IDX_GLOBAL_IRQ, to); 55 + 56 + if (enable) 57 + val |= *irq_mask; 58 + else 59 + val &= ~(*irq_mask); 60 + 61 + mtk_cpux_writel(val, CPUX_IDX_GLOBAL_IRQ, to); 62 + } 63 + 64 + static int mtk_cpux_clkevt_shutdown(struct clock_event_device *clkevt) 65 + { 66 + /* Clear any irq */ 67 + mtk_cpux_set_irq(to_timer_of(clkevt), false); 68 + 69 + /* 70 + * Disabling CPUXGPT timer will crash the platform, especially 71 + * if Trusted Firmware is using it (usually, for sleep states), 72 + * so we only mask the IRQ and call it a day. 73 + */ 74 + return 0; 75 + } 76 + 77 + static int mtk_cpux_clkevt_resume(struct clock_event_device *clkevt) 78 + { 79 + mtk_cpux_set_irq(to_timer_of(clkevt), true); 80 + return 0; 81 + } 82 + 83 + static struct timer_of to = { 84 + /* 85 + * There are per-cpu interrupts for the CPUX General Purpose Timer 86 + * but since this timer feeds the AArch64 System Timer we can rely 87 + * on the CPU timer PPIs as well, so we don't declare TIMER_OF_IRQ. 88 + */ 89 + .flags = TIMER_OF_BASE | TIMER_OF_CLOCK, 90 + 91 + .clkevt = { 92 + .name = "mtk-cpuxgpt", 93 + .cpumask = cpu_possible_mask, 94 + .rating = 10, 95 + .set_state_shutdown = mtk_cpux_clkevt_shutdown, 96 + .tick_resume = mtk_cpux_clkevt_resume, 97 + }, 98 + }; 99 + 100 + static int __init mtk_cpux_init(struct device_node *node) 101 + { 102 + u32 freq, val; 103 + int ret; 104 + 105 + /* If this fails, bad things are about to happen... */ 106 + ret = timer_of_init(node, &to); 107 + if (ret) { 108 + WARN(1, "Cannot start CPUX timers.\n"); 109 + return ret; 110 + } 111 + 112 + /* 113 + * Check if we're given a clock with the right frequency for this 114 + * timer, otherwise warn but keep going with the setup anyway, as 115 + * that makes it possible to still boot the kernel, even though 116 + * it may not work correctly (random lockups, etc). 117 + * The reason behind this is that having an early UART may not be 118 + * possible for everyone and this gives a chance to retrieve kmsg 119 + * for eventual debugging even on consumer devices. 120 + */ 121 + freq = timer_of_rate(&to); 122 + if (freq > 13000000) 123 + WARN(1, "Requested unsupported timer frequency %u\n", freq); 124 + 125 + /* Clock input is 26MHz, set DIV2 to achieve 13MHz clock */ 126 + val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to); 127 + val &= ~CPUX_CLK_DIV_MASK; 128 + val |= CPUX_CLK_DIV2; 129 + mtk_cpux_writel(val, CPUX_IDX_GLOBAL_CTRL, &to); 130 + 131 + /* Enable all CPUXGPT timers */ 132 + val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to); 133 + mtk_cpux_writel(val | CPUX_ENABLE, CPUX_IDX_GLOBAL_CTRL, &to); 134 + 135 + clockevents_config_and_register(&to.clkevt, timer_of_rate(&to), 136 + TIMER_SYNC_TICKS, 0xffffffff); 137 + 138 + return 0; 139 + } 140 + TIMER_OF_DECLARE(mtk_mt6795, "mediatek,mt6795-systimer", mtk_cpux_init);
-114
drivers/clocksource/timer-mediatek.c
··· 22 22 23 23 #define TIMER_SYNC_TICKS (3) 24 24 25 - /* cpux mcusys wrapper */ 26 - #define CPUX_CON_REG 0x0 27 - #define CPUX_IDX_REG 0x4 28 - 29 - /* cpux */ 30 - #define CPUX_IDX_GLOBAL_CTRL 0x0 31 - #define CPUX_ENABLE BIT(0) 32 - #define CPUX_CLK_DIV_MASK GENMASK(10, 8) 33 - #define CPUX_CLK_DIV1 BIT(8) 34 - #define CPUX_CLK_DIV2 BIT(9) 35 - #define CPUX_CLK_DIV4 BIT(10) 36 - #define CPUX_IDX_GLOBAL_IRQ 0x30 37 - 38 25 /* gpt */ 39 26 #define GPT_IRQ_EN_REG 0x00 40 27 #define GPT_IRQ_ENABLE(val) BIT((val) - 1) ··· 71 84 #define SYST_CON_IRQ_CLR BIT(4) 72 85 73 86 static void __iomem *gpt_sched_reg __read_mostly; 74 - 75 - static u32 mtk_cpux_readl(u32 reg_idx, struct timer_of *to) 76 - { 77 - writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG); 78 - return readl(timer_of_base(to) + CPUX_CON_REG); 79 - } 80 - 81 - static void mtk_cpux_writel(u32 val, u32 reg_idx, struct timer_of *to) 82 - { 83 - writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG); 84 - writel(val, timer_of_base(to) + CPUX_CON_REG); 85 - } 86 - 87 - static void mtk_cpux_set_irq(struct timer_of *to, bool enable) 88 - { 89 - const unsigned long *irq_mask = cpumask_bits(cpu_possible_mask); 90 - u32 val; 91 - 92 - val = mtk_cpux_readl(CPUX_IDX_GLOBAL_IRQ, to); 93 - 94 - if (enable) 95 - val |= *irq_mask; 96 - else 97 - val &= ~(*irq_mask); 98 - 99 - mtk_cpux_writel(val, CPUX_IDX_GLOBAL_IRQ, to); 100 - } 101 - 102 - static int mtk_cpux_clkevt_shutdown(struct clock_event_device *clkevt) 103 - { 104 - /* Clear any irq */ 105 - mtk_cpux_set_irq(to_timer_of(clkevt), false); 106 - 107 - /* 108 - * Disabling CPUXGPT timer will crash the platform, especially 109 - * if Trusted Firmware is using it (usually, for sleep states), 110 - * so we only mask the IRQ and call it a day. 111 - */ 112 - return 0; 113 - } 114 - 115 - static int mtk_cpux_clkevt_resume(struct clock_event_device *clkevt) 116 - { 117 - mtk_cpux_set_irq(to_timer_of(clkevt), true); 118 - return 0; 119 - } 120 87 121 88 static void mtk_syst_ack_irq(struct timer_of *to) 122 89 { ··· 281 340 }, 282 341 }; 283 342 284 - static int __init mtk_cpux_init(struct device_node *node) 285 - { 286 - static struct timer_of to_cpux; 287 - u32 freq, val; 288 - int ret; 289 - 290 - /* 291 - * There are per-cpu interrupts for the CPUX General Purpose Timer 292 - * but since this timer feeds the AArch64 System Timer we can rely 293 - * on the CPU timer PPIs as well, so we don't declare TIMER_OF_IRQ. 294 - */ 295 - to_cpux.flags = TIMER_OF_BASE | TIMER_OF_CLOCK; 296 - to_cpux.clkevt.name = "mtk-cpuxgpt"; 297 - to_cpux.clkevt.rating = 10; 298 - to_cpux.clkevt.cpumask = cpu_possible_mask; 299 - to_cpux.clkevt.set_state_shutdown = mtk_cpux_clkevt_shutdown; 300 - to_cpux.clkevt.tick_resume = mtk_cpux_clkevt_resume; 301 - 302 - /* If this fails, bad things are about to happen... */ 303 - ret = timer_of_init(node, &to_cpux); 304 - if (ret) { 305 - WARN(1, "Cannot start CPUX timers.\n"); 306 - return ret; 307 - } 308 - 309 - /* 310 - * Check if we're given a clock with the right frequency for this 311 - * timer, otherwise warn but keep going with the setup anyway, as 312 - * that makes it possible to still boot the kernel, even though 313 - * it may not work correctly (random lockups, etc). 314 - * The reason behind this is that having an early UART may not be 315 - * possible for everyone and this gives a chance to retrieve kmsg 316 - * for eventual debugging even on consumer devices. 317 - */ 318 - freq = timer_of_rate(&to_cpux); 319 - if (freq > 13000000) 320 - WARN(1, "Requested unsupported timer frequency %u\n", freq); 321 - 322 - /* Clock input is 26MHz, set DIV2 to achieve 13MHz clock */ 323 - val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to_cpux); 324 - val &= ~CPUX_CLK_DIV_MASK; 325 - val |= CPUX_CLK_DIV2; 326 - mtk_cpux_writel(val, CPUX_IDX_GLOBAL_CTRL, &to_cpux); 327 - 328 - /* Enable all CPUXGPT timers */ 329 - val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to_cpux); 330 - mtk_cpux_writel(val | CPUX_ENABLE, CPUX_IDX_GLOBAL_CTRL, &to_cpux); 331 - 332 - clockevents_config_and_register(&to_cpux.clkevt, timer_of_rate(&to_cpux), 333 - TIMER_SYNC_TICKS, 0xffffffff); 334 - 335 - return 0; 336 - } 337 - 338 343 static int __init mtk_syst_init(struct device_node *node) 339 344 { 340 345 int ret; ··· 339 452 } 340 453 TIMER_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_gpt_init); 341 454 TIMER_OF_DECLARE(mtk_mt6765, "mediatek,mt6765-timer", mtk_syst_init); 342 - TIMER_OF_DECLARE(mtk_mt6795, "mediatek,mt6795-systimer", mtk_cpux_init);
+3 -8
drivers/clocksource/timer-stm32-lp.c
··· 195 195 return ret; 196 196 } 197 197 198 - static int stm32_clkevent_lp_remove(struct platform_device *pdev) 199 - { 200 - return -EBUSY; /* cannot unregister clockevent */ 201 - } 202 - 203 198 static const struct of_device_id stm32_clkevent_lp_of_match[] = { 204 199 { .compatible = "st,stm32-lptimer-timer", }, 205 200 {}, ··· 202 207 MODULE_DEVICE_TABLE(of, stm32_clkevent_lp_of_match); 203 208 204 209 static struct platform_driver stm32_clkevent_lp_driver = { 205 - .probe = stm32_clkevent_lp_probe, 206 - .remove = stm32_clkevent_lp_remove, 210 + .probe = stm32_clkevent_lp_probe, 207 211 .driver = { 208 212 .name = "stm32-lptimer-timer", 209 - .of_match_table = of_match_ptr(stm32_clkevent_lp_of_match), 213 + .of_match_table = stm32_clkevent_lp_of_match, 214 + .suppress_bind_attrs = true, 210 215 }, 211 216 }; 212 217 module_platform_driver(stm32_clkevent_lp_driver);
+2 -4
drivers/clocksource/timer-tegra186.c
··· 447 447 return err; 448 448 } 449 449 450 - static int tegra186_timer_remove(struct platform_device *pdev) 450 + static void tegra186_timer_remove(struct platform_device *pdev) 451 451 { 452 452 struct tegra186_timer *tegra = platform_get_drvdata(pdev); 453 453 454 454 clocksource_unregister(&tegra->usec); 455 455 clocksource_unregister(&tegra->osc); 456 456 clocksource_unregister(&tegra->tsc); 457 - 458 - return 0; 459 457 } 460 458 461 459 static int __maybe_unused tegra186_timer_suspend(struct device *dev) ··· 503 505 .of_match_table = tegra186_timer_of_match, 504 506 }, 505 507 .probe = tegra186_timer_probe, 506 - .remove = tegra186_timer_remove, 508 + .remove_new = tegra186_timer_remove, 507 509 }; 508 510 module_platform_driver(tegra186_wdt_driver); 509 511
+28 -29
drivers/clocksource/timer-ti-dm-systimer.c
··· 251 251 counter_32k = -ENODEV; 252 252 253 253 for_each_matching_node(np, dmtimer_match_table) { 254 + struct resource res; 254 255 if (!dmtimer_is_preferred(np)) 255 256 continue; 256 257 257 - if (of_property_read_bool(np, "ti,timer-alwon")) { 258 - const __be32 *addr; 258 + if (!of_property_read_bool(np, "ti,timer-alwon")) 259 + continue; 259 260 260 - addr = of_get_address(np, 0, NULL, NULL); 261 - pa = of_translate_address(np, addr); 262 - if (pa) { 263 - /* Quirky omap3 boards must use dmtimer12 */ 264 - if (quirk_unreliable_oscillator && 265 - pa == 0x48318000) 266 - continue; 261 + if (of_address_to_resource(np, 0, &res)) 262 + continue; 267 263 268 - of_node_put(np); 269 - break; 270 - } 271 - } 264 + pa = res.start; 265 + 266 + /* Quirky omap3 boards must use dmtimer12 */ 267 + if (quirk_unreliable_oscillator && pa == 0x48318000) 268 + continue; 269 + 270 + of_node_put(np); 271 + break; 272 272 } 273 273 274 274 /* Usually no need for dmtimer clocksource if we have counter32 */ ··· 285 285 static u32 __init dmtimer_systimer_find_first_available(void) 286 286 { 287 287 struct device_node *np; 288 - const __be32 *addr; 289 288 u32 pa = 0; 290 289 291 290 for_each_matching_node(np, dmtimer_match_table) { 291 + struct resource res; 292 292 if (!dmtimer_is_preferred(np)) 293 293 continue; 294 294 295 - addr = of_get_address(np, 0, NULL, NULL); 296 - pa = of_translate_address(np, addr); 297 - if (pa) { 298 - if (pa == clocksource || pa == clockevent) { 299 - pa = 0; 300 - continue; 301 - } 295 + if (of_address_to_resource(np, 0, &res)) 296 + continue; 302 297 303 - of_node_put(np); 304 - break; 305 - } 298 + if (res.start == clocksource || res.start == clockevent) 299 + continue; 300 + 301 + pa = res.start; 302 + of_node_put(np); 303 + break; 306 304 } 307 305 308 306 return pa; ··· 584 586 writel_relaxed(OMAP_TIMER_INT_OVERFLOW, t->base + t->wakeup); 585 587 586 588 pr_info("TI gptimer %s: %s%lu Hz at %pOF\n", 587 - name, of_find_property(np, "ti,timer-alwon", NULL) ? 589 + name, of_property_read_bool(np, "ti,timer-alwon") ? 588 590 "always-on " : "", t->rate, np->parent); 589 591 590 592 return 0; ··· 785 787 t->base + t->ctrl); 786 788 787 789 pr_info("TI gptimer clocksource: %s%pOF\n", 788 - of_find_property(np, "ti,timer-alwon", NULL) ? 790 + of_property_read_bool(np, "ti,timer-alwon") ? 789 791 "always-on " : "", np->parent); 790 792 791 793 if (!dmtimer_sched_clock_counter) { ··· 810 812 */ 811 813 static int __init dmtimer_systimer_init(struct device_node *np) 812 814 { 813 - const __be32 *addr; 815 + struct resource res; 814 816 u32 pa; 815 817 816 818 /* One time init for the preferred timer configuration */ ··· 824 826 return -EINVAL; 825 827 } 826 828 827 - addr = of_get_address(np, 0, NULL, NULL); 828 - pa = of_translate_address(np, addr); 829 + 830 + of_address_to_resource(np, 0, &res); 831 + pa = (u32)res.start; 829 832 if (!pa) 830 833 return -EINVAL; 831 834
+8 -7
drivers/clocksource/timer-ti-dm.c
··· 1104 1104 platform_set_drvdata(pdev, timer); 1105 1105 1106 1106 if (dev->of_node) { 1107 - if (of_find_property(dev->of_node, "ti,timer-alwon", NULL)) 1107 + if (of_property_read_bool(dev->of_node, "ti,timer-alwon")) 1108 1108 timer->capability |= OMAP_TIMER_ALWON; 1109 - if (of_find_property(dev->of_node, "ti,timer-dsp", NULL)) 1109 + if (of_property_read_bool(dev->of_node, "ti,timer-dsp")) 1110 1110 timer->capability |= OMAP_TIMER_HAS_DSP_IRQ; 1111 - if (of_find_property(dev->of_node, "ti,timer-pwm", NULL)) 1111 + if (of_property_read_bool(dev->of_node, "ti,timer-pwm")) 1112 1112 timer->capability |= OMAP_TIMER_HAS_PWM; 1113 - if (of_find_property(dev->of_node, "ti,timer-secure", NULL)) 1113 + if (of_property_read_bool(dev->of_node, "ti,timer-secure")) 1114 1114 timer->capability |= OMAP_TIMER_SECURE; 1115 1115 } else { 1116 1116 timer->id = pdev->id; ··· 1177 1177 * In addition to freeing platform resources it also deletes the timer 1178 1178 * entry from the local list. 1179 1179 */ 1180 - static int omap_dm_timer_remove(struct platform_device *pdev) 1180 + static void omap_dm_timer_remove(struct platform_device *pdev) 1181 1181 { 1182 1182 struct dmtimer *timer; 1183 1183 unsigned long flags; ··· 1197 1197 1198 1198 pm_runtime_disable(&pdev->dev); 1199 1199 1200 - return ret; 1200 + if (ret) 1201 + dev_err(&pdev->dev, "Unable to determine timer entry in list of drivers on remove\n"); 1201 1202 } 1202 1203 1203 1204 static const struct omap_dm_timer_ops dmtimer_ops = { ··· 1273 1272 1274 1273 static struct platform_driver omap_dm_timer_driver = { 1275 1274 .probe = omap_dm_timer_probe, 1276 - .remove = omap_dm_timer_remove, 1275 + .remove_new = omap_dm_timer_remove, 1277 1276 .driver = { 1278 1277 .name = "omap_timer", 1279 1278 .of_match_table = omap_timer_match,
-7
include/soc/imx/timer.h
··· 13 13 GPT_TYPE_IMX6DL, /* i.MX6DL/SX/SL */ 14 14 }; 15 15 16 - /* 17 - * This is a stop-gap solution for clock drivers like imx1/imx21 which call 18 - * mxc_timer_init() to initialize timer for non-DT boot. It can be removed 19 - * when these legacy non-DT support is converted or dropped. 20 - */ 21 - void mxc_timer_init(unsigned long pbase, int irq, enum imx_gpt_type type); 22 - 23 16 #endif /* __SOC_IMX_TIMER_H__ */
+2 -2
kernel/time/timekeeping.c
··· 526 526 * partially updated. Since the tk->offs_boot update is a rare event, this 527 527 * should be a rare occurrence which postprocessing should be able to handle. 528 528 * 529 - * The caveats vs. timestamp ordering as documented for ktime_get_fast_ns() 529 + * The caveats vs. timestamp ordering as documented for ktime_get_mono_fast_ns() 530 530 * apply as well. 531 531 */ 532 532 u64 notrace ktime_get_boot_fast_ns(void) ··· 576 576 /** 577 577 * ktime_get_real_fast_ns: - NMI safe and fast access to clock realtime. 578 578 * 579 - * See ktime_get_fast_ns() for documentation of the time stamp ordering. 579 + * See ktime_get_mono_fast_ns() for documentation of the time stamp ordering. 580 580 */ 581 581 u64 ktime_get_real_fast_ns(void) 582 582 {