public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, horms@verge.net.au,
	linux-sh@vger.kernel.org, johnstul@us.ibm.com, rjw@sisk.pl,
	lethal@linux-sh.org, gregkh@linuxfoundation.org, olof@lixom.net
Subject: Re: [PATCH 02/03] clocksource: em_sti: Emma Mobile STI driver V2
Date: Fri, 25 May 2012 01:42:14 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1205250135340.3231@ionos> (raw)
In-Reply-To: <20120509143942.27521.8595.sendpatchset@w520>

On Wed, 9 May 2012, Magnus Damm wrote:
> +static irqreturn_t em_sti_interrupt(int irq, void *dev_id)
> +{
> +	struct em_sti_priv *p = dev_id;
> +
> +	/* Always regprogram timer compare A */
> +	if (p->ced.mode == CLOCK_EVT_MODE_PERIODIC)
> +		em_sti_update(p);

Why do you want to do that? The core code already handles timers which
only support oneshot mode.

> +	spin_lock_irqsave(&p->lock, flags);

Please make that a raw_spinlock.

> +static void em_sti_clock_event_mode(enum clock_event_mode mode,
> +				    struct clock_event_device *ced)
> +{
> +	struct em_sti_priv *p = ced_to_em_sti(ced);
> +
> +	/* deal with old setting first */
> +	switch (ced->mode) {
> +	case CLOCK_EVT_MODE_PERIODIC:
> +	case CLOCK_EVT_MODE_ONESHOT:
> +		em_sti_stop(p, USER_CLOCKEVENT);
> +		break;
> +	default:
> +		break;
> +	}
> +
> +	switch (mode) {
> +	case CLOCK_EVT_MODE_PERIODIC:
> +		dev_info(&p->pdev->dev, "used for periodic clock events\n");
> +		em_sti_start(p, USER_CLOCKEVENT);
> +		clockevents_config(&p->ced, p->rate);
> +		p->delta = (p->rate + HZ/2) / HZ;
> +		p->next = em_sti_count(p);
> +		em_sti_update(p);
> +		break;

All that code in this case can go away.

> +static void em_sti_register_clockevent(struct em_sti_priv *p)
> +{
> +	struct clock_event_device *ced = &p->ced;
> +
> +	memset(ced, 0, sizeof(*ced));
> +	ced->name = dev_name(&p->pdev->dev);
> +	ced->features = CLOCK_EVT_FEAT_PERIODIC;
> +	ced->features |= CLOCK_EVT_FEAT_ONESHOT;

If you make that:

	ced->features = CLOCK_EVT_FEAT_ONESHOT;

Thanks,

	tglx

  reply	other threads:[~2012-05-24 23:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 14:39 [PATCH 00/03] clocksource: Emma Mobile STI V2 patches Magnus Damm
2012-05-09 14:39 ` [PATCH 01/03] clockevents: Make clockevents_config() a global symbol Magnus Damm
2012-05-23  6:32   ` Paul Mundt
2012-05-23  7:15     ` Magnus Damm
2012-05-24 10:27     ` Thomas Gleixner
2012-05-24 10:28       ` Thomas Gleixner
2012-05-24 23:53   ` [tip:timers/core] " tip-bot for Magnus Damm
2012-05-09 14:39 ` [PATCH 02/03] clocksource: em_sti: Emma Mobile STI driver V2 Magnus Damm
2012-05-24 23:42   ` Thomas Gleixner [this message]
2012-05-25  3:39     ` Magnus Damm
2012-05-09 14:39 ` [PATCH 03/03] clocksource: em_sti: Add DT support Magnus Damm
2012-05-25  9:39   ` [tip:timers/core] " tip-bot for Magnus Damm
2012-05-11  6:55 ` [PATCH 00/03] clocksource: Emma Mobile STI V2 patches Simon Horman

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.1205250135340.3231@ionos \
    --to=tglx@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@verge.net.au \
    --cc=johnstul@us.ibm.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=olof@lixom.net \
    --cc=rjw@sisk.pl \
    /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