linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Rohit Vaswani <rvaswani@codeaurora.org>
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	Russell King <linux@arm.linux.org.uk>,
	Stephen Boyd <sboyd@codeaurora.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: arch timer: Set the TVAL before timer is enabled
Date: Mon, 24 Jun 2013 10:10:31 +0100	[thread overview]
Message-ID: <51C80D07.2020106@arm.com> (raw)
In-Reply-To: <1371846684-23730-1-git-send-email-rvaswani@codeaurora.org>

On 21/06/13 21:31, Rohit Vaswani wrote:
> On some hardware, the timer deasserts the interrupt when a
> new TVAL is written only when the enable bit is cleared.
> Hence explicitly disable the timer and then program the
> TVAL followed by enabling the timer.
> If this order is not followed, there are chances that
> you would not receive any timer interrupts.
> This is done as suggested in https://lkml.org/lkml/2012/8/11/39
> 
> Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
> ---
>  drivers/clocksource/arm_arch_timer.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index a2b2541..05ba0c2 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -103,9 +103,10 @@ static inline void set_next_event(const int access, unsigned long evt)
>  {
>  	unsigned long ctrl;
>  	ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL);
> -	ctrl |= ARCH_TIMER_CTRL_ENABLE;
> -	ctrl &= ~ARCH_TIMER_CTRL_IT_MASK;
> +	ctrl &= ~(ARCH_TIMER_CTRL_ENABLE | ARCH_TIMER_CTRL_IT_MASK);
> +	arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
>  	arch_timer_reg_write(access, ARCH_TIMER_REG_TVAL, evt);
> +	ctrl |= ARCH_TIMER_CTRL_ENABLE;
>  	arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
>  }

Maybe that would deserve a comment in the code so people don't get the
idea it can be reordered to save the extra write?

Other than that, and FWIW:
Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...


      reply	other threads:[~2013-06-24  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 20:31 [PATCH] ARM: arch timer: Set the TVAL before timer is enabled Rohit Vaswani
2013-06-24  9:10 ` Marc Zyngier [this message]

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=51C80D07.2020106@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rob.herring@calxeda.com \
    --cc=rvaswani@codeaurora.org \
    --cc=sboyd@codeaurora.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).