public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Mark Salter <msalter@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v3 11/24] C6X: time management
Date: Wed, 28 Sep 2011 01:41:25 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1109280130570.2711@ionos> (raw)
In-Reply-To: <1317155405-26235-12-git-send-email-msalter@redhat.com>

On Tue, 27 Sep 2011, Mark Salter wrote:

> The C6X architecture includes a 64-bit free running core clock counter which
> is used as the clocksource. The SoCs have a number of 64-bit programmable
> timers. One of these is used as the clockevent timer.
> 
> + *  Port on Texas Instruments TMS320C6x architecture
> + *
> + *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
> + *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
> + *
> + *  Modified for 2.6.34: Mark Salter <msalter@redhat.com>

Hmm. Who wrote that code and who is assigned the authorship? If the
original Author is Aurelian, then this patch is missing:

  - An extra From: ....

  - A SOB from the orginal author or an explnation why it's not
    available.

If not, then this want's to be documented in a proper form.

Please do not attribute other peoples code to yourself w/o a fcking
good reason. And porting forward itself is not considered to be one.

> +/*
> + * This should be close enough...

What's the point of that comment ?

> + */
> +#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6)
> +
> +/* 64-bit timestamp */
> +typedef unsigned long long cycles_t;

...

> +static int next_event(unsigned long delta,
> +		      struct clock_event_device *evt)
> +{
> +	soc_writel(soc_readl(&timer->tcr) & ~TCR_ENAMODELO_MASK, &timer->tcr);
> +	soc_writel(delta - 1, &timer->prdlo);
> +	soc_writel(0, &timer->cntlo);
> +	soc_writel(soc_readl(&timer->tcr) | TCR_ENAMODELO_ONCE, &timer->tcr);
> +
> +	return 0;
> +}
> +
> +static void set_clock_mode(enum clock_event_mode mode,
> +			   struct clock_event_device *evt)
> +{

So there is no way to disable that thing ?

> +}
> +
> +static struct clock_event_device t64_clockevent_device = {
> +	.name		= "TIMER64_EVT32_TIMER",
> +	.features	= CLOCK_EVT_FEAT_ONESHOT,
> +	.rating		= 200,
> +	.set_mode	= set_clock_mode,
> +	.set_next_event	= next_event,
> +};
> +
> +static irqreturn_t timer_interrupt(int irq, void *dev_id)
> +{
> +	struct clock_event_device *cd = &t64_clockevent_device;

If proper set up, then you can just hand in dev_id to the handler.

> +
> +	cd->event_handler(cd);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +static struct irqaction timer_iact = {
> +	.name		= "timer",
> +	.flags		= IRQF_TIMER,
> +	.handler	= timer_interrupt,
> +	.dev_id		= &t64_clockevent_device,

Which seems to be the case :)

Thanks,

	tglx

  reply	other threads:[~2011-09-27 23:41 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 20:29 [PATCH v3 00/24] C6X: New architecture Mark Salter
2011-09-27 20:29 ` [PATCH v3 01/24] fix default __strnlen_user macro Mark Salter
2011-09-28 13:20   ` Arnd Bergmann
2011-09-28 13:20     ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 02/24] fixed generic page.h for non-zero PAGE_OFFSET Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-27 20:29 ` [PATCH v3 03/24] add ELF machine define for TI C6X DSPs Mark Salter
2011-09-27 20:29 ` [PATCH v3 04/24] add missing __iomem to generic iounmap declaration Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:19   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 05/24] C6X: build infrastructure Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:23   ` Arnd Bergmann
2011-09-28 14:32     ` Mark Salter
2011-09-28 14:57       ` Arnd Bergmann
2011-09-28 14:57         ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 06/24] C6X: early boot code Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:26   ` Arnd Bergmann
2011-09-28 14:06     ` Mark Salter
2011-09-28 15:00       ` Arnd Bergmann
2011-09-28 15:00         ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 07/24] C6X: devicetree support Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:31   ` Arnd Bergmann
2011-09-28 14:44     ` Mark Salter
2011-09-28 14:57       ` Arnd Bergmann
2011-09-28 23:11     ` Grant Likely
2011-09-28 23:11       ` Grant Likely
2011-09-27 20:29 ` [PATCH v3 08/24] C6X: memory management and DMA support Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:46   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 09/24] C6X: process management Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:47   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 10/24] C6X: signal management Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:48   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 11/24] C6X: time management Mark Salter
2011-09-27 23:41   ` Thomas Gleixner [this message]
2011-09-28 12:48     ` Mark Salter
2011-09-27 20:29 ` [PATCH v3 12/24] C6X: interrupt handling Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-27 23:30   ` Thomas Gleixner
2011-09-27 20:29 ` [PATCH v3 13/24] C6X: syscalls Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:49   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 14/24] C6X: traps Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:50   ` Arnd Bergmann
2011-09-28 13:50     ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 15/24] C6X: clocks Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:51   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 16/24] C6X: cache control Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:52   ` Arnd Bergmann
2011-09-28 13:52     ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 17/24] C6X: loadable module support Mark Salter
2011-09-27 20:29   ` Mark Salter
2011-09-28 13:54   ` Arnd Bergmann
2011-09-27 20:29 ` [PATCH v3 18/24] C6X: ptrace support Mark Salter
2011-09-28 13:57   ` Arnd Bergmann
2011-09-28 13:57     ` Arnd Bergmann
2011-09-27 20:30 ` [PATCH v3 19/24] C6X: headers Mark Salter
2011-09-27 20:30   ` Mark Salter
2011-09-28 14:07   ` Arnd Bergmann
2011-09-28 14:07     ` Arnd Bergmann
2011-09-29 13:32     ` Mark Salter
2011-09-29 13:32       ` Mark Salter
2011-09-29 14:24     ` Mark Salter
2011-09-29 14:41       ` Arnd Bergmann
2011-09-27 20:30 ` [PATCH v3 20/24] C6X: library code Mark Salter
2011-09-27 20:30   ` Mark Salter
2011-09-28 14:09   ` Arnd Bergmann
2011-09-28 14:09     ` Arnd Bergmann
2011-09-27 20:30 ` [PATCH v3 21/24] C6X: general SoC support Mark Salter
2011-09-28 14:19   ` Arnd Bergmann
2011-09-27 20:30 ` [PATCH v3 22/24] C6X: EMIF - External Memory Interface Mark Salter
2011-09-28 14:13   ` Arnd Bergmann
2011-09-27 20:30 ` [PATCH v3 23/24] C6X: DSCR - Device State Configuration Registers Mark Salter
2011-09-27 20:30   ` Mark Salter
2011-09-28 14:11   ` Arnd Bergmann
2011-09-27 20:30 ` [PATCH v3 24/24] C6X: MAINTAINERS Mark Salter
2011-09-27 20:30   ` Mark Salter
2011-09-28 14:09   ` Arnd Bergmann
2011-09-28 14:09     ` Arnd Bergmann
2011-09-27 23:15 ` [PATCH v3 00/24] C6X: New architecture Stephen Rothwell
2011-09-28 14:33   ` Arnd Bergmann
2011-09-28 21:49 ` Valdis.Kletnieks
2011-09-29 10:33   ` Arnd Bergmann
2011-09-29 12:21     ` Mark Salter
2011-09-29 12:42       ` Valdis.Kletnieks
2011-09-29 13:02         ` Mark Salter
2011-09-29 13:02           ` Mark Salter
2011-09-29 13:18           ` Arnd Bergmann

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.1109280130570.2711@ionos \
    --to=tglx@linutronix.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msalter@redhat.com \
    /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