From: Serge Semin <Sergey.Semin@baikalelectronics.ru> To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Rob Herring <rob.herring@calxeda.com>, Heiko Stuebner <heiko@sntech.de>, Dinh Nguyen <dinguyen@altera.com>, Arnd Bergmann <arnd@arndb.de>, Jamie Iles <jamie@jamieiles.com> Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>, Serge Semin <fancer.lancer@gmail.com>, Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>, Paul Burton <paulburton@kernel.org>, Ralf Baechle <ralf@linux-mips.org>, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Rob Herring <robh+dt@kernel.org>, <linux-mips@vger.kernel.org>, <linux-rtc@vger.kernel.org>, <devicetree@vger.kernel.org>, Alexios Zavras <alexios.zavras@intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Allison Randal <allison@lohutok.net>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 5/7] clocksource: dw_apb_timer_of: Fix missing clockevent timers Date: Thu, 7 May 2020 00:41:05 +0300 [thread overview] Message-ID: <20200506214107.25956-6-Sergey.Semin@baikalelectronics.ru> (raw) In-Reply-To: <20200506214107.25956-1-Sergey.Semin@baikalelectronics.ru> Commit 100214889973 ("clocksource: dw_apb_timer_of: use clocksource_of_init") replaced a publicly available driver initialization method with one called by the timer_probe() method available after CLKSRC_OF. In current implementation it traverses all the timers available in the system and calls their initialization methods if corresponding devices were either in dtb or in acpi. But if before the commit any number of available timers would be installed as clockevent and clocksource devices, after that there would be at most two. The rest are just ignored since default case branch doesn't do anything. I don't see a reason of such behaviour, neither the commit message explains it. Moreover this might be wrong if on some platforms these timers might be used for different purpose, as virtually CPU-local clockevent timers and as an independent broadcast timer. So in order to keep the compatibility with the platforms where the order of the timers detection has some meaning, lets add the secondly discovered timer to be of clocksource/sched_clock type, while the very first and the others would provide the clockevents service. Fixes: 100214889973 ("clocksource: dw_apb_timer_of: use clocksource_of_init") Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Rob Herring <robh+dt@kernel.org> Cc: linux-mips@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: devicetree@vger.kernel.org --- drivers/clocksource/dw_apb_timer_of.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c index 0a2505b323d7..0b61b90a525e 100644 --- a/drivers/clocksource/dw_apb_timer_of.c +++ b/drivers/clocksource/dw_apb_timer_of.c @@ -146,10 +146,6 @@ static int num_called; static int __init dw_apb_timer_init(struct device_node *timer) { switch (num_called) { - case 0: - pr_debug("%s: found clockevent timer\n", __func__); - add_clockevent(timer); - break; case 1: pr_debug("%s: found clocksource timer\n", __func__); add_clocksource(timer); @@ -160,6 +156,8 @@ static int __init dw_apb_timer_init(struct device_node *timer) #endif break; default: + pr_debug("%s: found clockevent timer\n", __func__); + add_clockevent(timer); break; } -- 2.25.1
next prev parent reply other threads:[~2020-05-06 21:42 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20200306125622.839ED80307C4@mail.baikalelectronics.ru> 2020-03-24 17:43 ` [PATCH v2 0/6] clocksource: Fix MIPS GIC and DW APB Timer for Baikal-T1 SoC support Sergey.Semin 2020-03-24 17:43 ` [PATCH v2 1/6] dt-bindings: rtc: Convert snps,dw-apb-timer to DT schema Sergey.Semin 2020-03-24 18:07 ` Alexandre Belloni 2020-03-24 18:20 ` Serge Semin 2020-03-31 20:14 ` Rob Herring 2020-03-24 17:43 ` [PATCH v2 2/6] dt-bindings: interrupt-controller: Convert mti,gic " Sergey.Semin 2020-03-31 21:02 ` Rob Herring 2020-04-01 10:19 ` Sergey Semin 2020-04-01 14:13 ` Rob Herring 2020-04-01 22:07 ` Sergey Semin 2020-05-06 21:41 ` [PATCH v3 0/7] clocksource: Fix MIPS GIC and DW APB Timer for Baikal-T1 SoC support Serge Semin 2020-05-06 21:41 ` [PATCH v3 1/7] dt-bindings: rtc: Convert snps,dw-apb-timer to DT schema Serge Semin 2020-05-06 21:41 ` [PATCH v3 2/7] dt-bindings: timer: Move snps,dw-apb-timer DT schema from rtc Serge Semin 2020-05-07 12:03 ` Alexandre Belloni 2020-05-14 19:04 ` Rob Herring 2020-05-06 21:41 ` [PATCH v3 3/7] dt-bindings: interrupt-controller: Convert mti,gic to DT schema Serge Semin 2020-05-14 19:06 ` Rob Herring 2020-05-18 14:51 ` Serge Semin 2020-05-06 21:41 ` [PATCH v3 4/7] clocksource: dw_apb_timer: Set clockevent any-possible-CPU mask Serge Semin 2020-05-06 21:41 ` Serge Semin [this message] 2020-05-06 21:41 ` [PATCH v3 6/7] clocksource: mips-gic-timer: Register as sched_clock Serge Semin 2020-05-06 21:41 ` [PATCH v3 7/7] clocksource: mips-gic-timer: Set limitations on clocksource/sched-clocks usage Serge Semin 2020-05-15 17:10 ` Daniel Lezcano 2020-05-16 12:16 ` Serge Semin 2020-05-18 13:59 ` Daniel Lezcano 2020-05-18 14:40 ` Serge Semin 2020-05-18 14:45 ` Serge Semin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200506214107.25956-6-Sergey.Semin@baikalelectronics.ru \ --to=sergey.semin@baikalelectronics.ru \ --cc=Alexey.Malahov@baikalelectronics.ru \ --cc=a.zummo@towertech.it \ --cc=alexandre.belloni@bootlin.com \ --cc=alexios.zavras@intel.com \ --cc=allison@lohutok.net \ --cc=arnd@arndb.de \ --cc=daniel.lezcano@linaro.org \ --cc=devicetree@vger.kernel.org \ --cc=dinguyen@altera.com \ --cc=fancer.lancer@gmail.com \ --cc=gregkh@linuxfoundation.org \ --cc=heiko@sntech.de \ --cc=jamie@jamieiles.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mips@vger.kernel.org \ --cc=linux-rtc@vger.kernel.org \ --cc=paulburton@kernel.org \ --cc=ralf@linux-mips.org \ --cc=rob.herring@calxeda.com \ --cc=robh+dt@kernel.org \ --cc=tglx@linutronix.de \ --cc=tsbogend@alpha.franken.de \ --subject='Re: [PATCH v3 5/7] clocksource: dw_apb_timer_of: Fix missing clockevent timers' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).