public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/9] clocksource: time-armada-370-xp: Marvell Armada 370/XP SoC timer driver
Date: Mon, 2 Jul 2012 14:29:53 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1207021424570.2793@ionos> (raw)
In-Reply-To: <1341228809-17824-2-git-send-email-thomas.petazzoni@free-electrons.com>

On Mon, 2 Jul 2012, Thomas Petazzoni wrote:
> From: Gregory Clement <gregory.clement@free-electrons.com>
> +/*
> + * Clockevent handling.
> + */
> +static int
> +armada_370_xp_clkevt_next_event(unsigned long delta,
> +				struct clock_event_device *dev)
> +{
> +	unsigned long flags;
> +	u32 u;
> +
> +	if (delta == 0)
> +		return -ETIME;

If you have a proper min_delta_ns value set up, then delta will never
be 0. SO that check is pointless.

> +	local_irq_save(flags);

That code is guaranteed to be called with interrupts disabled. No need
for disabling them again.

> +
> +static void
> +armada_370_xp_clkevt_mode(enum clock_event_mode mode,
> +			  struct clock_event_device *dev)
> +{
> +	unsigned long flags;
> +	u32 u;
> +
> +	local_irq_save(flags);

Ditto.

> +	/*
> +	 * Setup clockevent timer (interrupt-driven).
> +	 */
> +	setup_irq(timer_irq, &armada_370_xp_timer_irq);
> +	armada_370_xp_clkevt.mult = div_sc(timer_clk, NSEC_PER_SEC,
> +					   armada_370_xp_clkevt.shift);
> +	armada_370_xp_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe,
> +							&armada_370_xp_clkevt);
> +	armada_370_xp_clkevt.min_delta_ns =
> +	    clockevent_delta2ns(1, &armada_370_xp_clkevt);

clockevents_config_and_register() please.

Thanks,

	tglx

  reply	other threads:[~2012-07-02 12:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 11:33 [PATCH v6] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 1/9] clocksource: time-armada-370-xp: Marvell Armada 370/XP SoC timer driver Thomas Petazzoni
2012-07-02 12:29   ` Thomas Gleixner [this message]
2012-07-02 13:03     ` Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 2/9] arm: mach-mvebu: add header Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 3/9] arm: mach-mvebu: add source files Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 4/9] arm: mach-mvebu: add support for Armada 370 and Armada XP with DT Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 5/9] arm: mach-mvebu: add documentation for new device tree bindings Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 6/9] arm: mach-mvebu: add defconfig Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 7/9] arm: mach-mvebu: add compilation/configuration change Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 8/9] arm: mach-mvebu: add entry to MAINTAINERS Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 9/9] ARM: mvebu: MPIC: read number of interrupts from control register Thomas Petazzoni
2012-07-02 15:30 ` [PATCH v6] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC Arnd Bergmann
2012-07-02 15:41   ` Thomas Petazzoni
2012-07-02 16:54     ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2012-07-02 15:39 [PATCH v7] " Thomas Petazzoni
2012-07-02 15:39 ` [PATCH 1/9] clocksource: time-armada-370-xp: Marvell Armada 370/XP SoC timer driver Thomas Petazzoni
2012-07-02 17:40   ` Thomas Gleixner
2012-07-03 15:12   ` Andrew Lunn

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=alpine.LFD.2.02.1207021424570.2793@ionos \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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