From: Tony Lindgren <tony@atomide.com> To: Grygorii Strashko <grygorii.strashko@ti.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Keerthy <j-keerthy@ti.com>, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] clocksource/drivers/timer-ti-dm: Fix posted mode status check order Date: Fri, 5 Mar 2021 09:53:35 +0200 [thread overview] Message-ID: <YEHjf6dcTByVvwBX@atomide.com> (raw) In-Reply-To: <bd551701-da42-8f9f-ad49-5d87baa9beec@ti.com> * Grygorii Strashko <grygorii.strashko@ti.com> [210304 20:58]: > On 04/03/2021 09:21, Tony Lindgren wrote: > > When the timer is configured in posted mode, we need to check the write- > > posted status register (TWPS) before writing to the register. ... > > --- a/drivers/clocksource/timer-ti-dm-systimer.c > > +++ b/drivers/clocksource/timer-ti-dm-systimer.c > > @@ -449,13 +449,13 @@ static int dmtimer_set_next_event(unsigned long cycles, > > struct dmtimer_systimer *t = &clkevt->t; > > void __iomem *pend = t->base + t->pend; > > - writel_relaxed(0xffffffff - cycles, t->base + t->counter); > > while (readl_relaxed(pend) & WP_TCRR) > > cpu_relax(); > > + writel_relaxed(0xffffffff - cycles, t->base + t->counter); > > - writel_relaxed(OMAP_TIMER_CTRL_ST, t->base + t->ctrl); > > while (readl_relaxed(pend) & WP_TCLR) > > cpu_relax(); > > + writel_relaxed(OMAP_TIMER_CTRL_ST, t->base + t->ctrl); > > It seems static [and inline] helper here could be better solution. no? Well we wanted to get rid of the confusing macros. And in this case I suspect we can eventually do just one read of the pending register for the registers used mask rather than check the status separately multiple times. But that needs to be carefully tested and is not a fix :) Regards, Tony
WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com> To: Grygorii Strashko <grygorii.strashko@ti.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Keerthy <j-keerthy@ti.com>, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] clocksource/drivers/timer-ti-dm: Fix posted mode status check order Date: Fri, 5 Mar 2021 09:53:35 +0200 [thread overview] Message-ID: <YEHjf6dcTByVvwBX@atomide.com> (raw) In-Reply-To: <bd551701-da42-8f9f-ad49-5d87baa9beec@ti.com> * Grygorii Strashko <grygorii.strashko@ti.com> [210304 20:58]: > On 04/03/2021 09:21, Tony Lindgren wrote: > > When the timer is configured in posted mode, we need to check the write- > > posted status register (TWPS) before writing to the register. ... > > --- a/drivers/clocksource/timer-ti-dm-systimer.c > > +++ b/drivers/clocksource/timer-ti-dm-systimer.c > > @@ -449,13 +449,13 @@ static int dmtimer_set_next_event(unsigned long cycles, > > struct dmtimer_systimer *t = &clkevt->t; > > void __iomem *pend = t->base + t->pend; > > - writel_relaxed(0xffffffff - cycles, t->base + t->counter); > > while (readl_relaxed(pend) & WP_TCRR) > > cpu_relax(); > > + writel_relaxed(0xffffffff - cycles, t->base + t->counter); > > - writel_relaxed(OMAP_TIMER_CTRL_ST, t->base + t->ctrl); > > while (readl_relaxed(pend) & WP_TCLR) > > cpu_relax(); > > + writel_relaxed(OMAP_TIMER_CTRL_ST, t->base + t->ctrl); > > It seems static [and inline] helper here could be better solution. no? Well we wanted to get rid of the confusing macros. And in this case I suspect we can eventually do just one read of the pending register for the registers used mask rather than check the status separately multiple times. But that needs to be carefully tested and is not a fix :) Regards, Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-03-05 7:53 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-04 7:21 [PATCH 0/3] Fixes for timer-ti-dm systimer posted mode Tony Lindgren 2021-03-04 7:21 ` Tony Lindgren 2021-03-04 7:21 ` [PATCH 1/3] clocksource/drivers/timer-ti-dm: Fix posted mode status check order Tony Lindgren 2021-03-04 7:21 ` Tony Lindgren 2021-03-04 20:57 ` Grygorii Strashko 2021-03-04 20:57 ` Grygorii Strashko 2021-03-05 7:53 ` Tony Lindgren [this message] 2021-03-05 7:53 ` Tony Lindgren 2021-03-05 10:09 ` Grygorii Strashko 2021-03-05 10:09 ` Grygorii Strashko 2021-04-09 10:27 ` [tip: timers/core] " tip-bot2 for Tony Lindgren 2021-03-04 7:21 ` [PATCH 2/3] clocksource/drivers/timer-ti-dm: Remove extra of_node_put() Tony Lindgren 2021-03-04 7:21 ` Tony Lindgren 2021-03-04 20:55 ` Grygorii Strashko 2021-03-04 20:55 ` Grygorii Strashko 2021-03-05 7:49 ` Tony Lindgren 2021-03-05 7:49 ` Tony Lindgren 2021-03-08 15:26 ` Tony Lindgren 2021-03-08 15:26 ` Tony Lindgren 2021-03-20 22:13 ` Daniel Lezcano 2021-03-20 22:13 ` Daniel Lezcano 2021-03-04 7:21 ` [PATCH 3/3] clocksource/drivers/timer-ti-dm: Add missing set_state_oneshot_stopped Tony Lindgren 2021-03-04 7:21 ` Tony Lindgren 2021-04-09 10:27 ` [tip: timers/core] " tip-bot2 for Tony Lindgren
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=YEHjf6dcTByVvwBX@atomide.com \ --to=tony@atomide.com \ --cc=daniel.lezcano@linaro.org \ --cc=grygorii.strashko@ti.com \ --cc=j-keerthy@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --cc=tglx@linutronix.de \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.