linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 00/15] Make SMP timers standalone
Date: Thu, 5 Jan 2012 16:26:50 +0000	[thread overview]
Message-ID: <20120105162650.GY11810@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4F05CC0D.6090101@arm.com>

On Thu, Jan 05, 2012 at 04:13:01PM +0000, Marc Zyngier wrote:
> On 05/01/12 12:10, Russell King - ARM Linux wrote:
> > On Thu, Jan 05, 2012 at 11:35:56AM +0000, Marc Zyngier wrote:
> >> On 05/01/12 11:26, Russell King - ARM Linux wrote:
> >>> Look, local timers *are* special.  They're not the same as global timers.
> >>> They're treated differently.  Ripping out the local timer setup stuff
> >>> from the SMP code is not the right solution, especially when we've
> >>> already got a separation of the local timer core from the hardware
> >>> implementation.
> >>
> >> OK. I'll try to work out something different.
> > 
> > Why?  What's wrong with the existing structure?
> 
> My main goal here is not to use a local timer as a global timer, but
> rather to be able to support multiple local timer implementations in the
> same kernel (TWD, MCT...). The "local timer on UP" is merely a consequence.
> 
> I could come up with another registration interface that fits into the
> existing structure, but I thought something could be done with what we
> currently have.

That's easy - but the solution depends on exactly how you're trying to
solve it.

In local_timer.h:

struct local_timer {
	int (*setup)(struct clock_event_device *);
	void (*stop)(struct clock_event_device *);
};

int local_timer_register(struct local_timer *);

In arch/arm/kernel/smp.c:

static struct local_timer *local_timer;

int local_timer_register(struct local_timer *lt)
{
	if (local_timer)
		return -EBUSY;
	local_timer = lt;
	return 0;
}

static int local_timer_setup(struct clock_event_device *ce)
{
	return local_timer ? local_timer->setup(ce) : -ENXIO;
}

static void local_timer_stop(struct clock_event_device *ce)
{
	if (local_timer)
		local_timer->stop(ce);
}

And, for twd:

struct local_timer twd_local_timer = {
	.setup = twd_timer_setup,
	.stop = twd_timer_stop,
};

But... it's not quite that simple because platforms need to intercept the
local_timer_setup() call to do platform specific things - such as finding
the twd base, and setting the twd IRQ.  That can be solved by moving
that out of platform code (why is it there in the first place?) into
smp_twd.c, and providing twd_local_timer_dt.

  reply	other threads:[~2012-01-05 16:26 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22 17:27 [PATCH v2 00/15] Make SMP timers standalone Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 01/15] ARM: local timers: allow smp_twd to be used standalone Marc Zyngier
2011-12-22 20:38   ` Russell King - ARM Linux
2011-12-22 17:27 ` [PATCH v2 02/15] ARM: smp_twd: add device tree support Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 03/15] ARM: local timers: switch realview to standalone smp_twd Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 04/15] ARM: local timers: switch vexpress " Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 05/15] ARM: local timers: remove localtimer.c from plat-versatile Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 06/15] ARM: local timers: switch tegra to standalone smp_twd Marc Zyngier
2011-12-22 19:22   ` Colin Cross
2011-12-22 17:27 ` [PATCH v2 07/15] ARM: local timers: switch omap4 " Marc Zyngier
2011-12-23  6:37   ` Shilimkar, Santosh
2011-12-22 17:27 ` [PATCH v2 08/15] ARM: local timers: switch shmobile " Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 09/15] ARM: local timers: switch ux500 " Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 10/15] ARM: local timers: switch highbank " Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 11/15] ARM: local timers: switch imx6q " Marc Zyngier
2011-12-25 13:40   ` Shawn Guo
2011-12-22 17:27 ` [PATCH v2 12/15] ARM: smp_twd: remove support for non-standalone version Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 13/15] ARM: local timers: make MCT timer standalone Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 14/15] ARM: local timers: make MSM timers standalone Marc Zyngier
2011-12-22 17:27 ` [PATCH v2 15/15] ARM: local timers: Remove CONFIG_LOCAL_TIMERS support Marc Zyngier
2011-12-22 19:32 ` [PATCH v2 00/15] Make SMP timers standalone Russell King - ARM Linux
2012-01-04 17:39   ` Marc Zyngier
2012-01-04 21:47     ` Russell King - ARM Linux
2012-01-05  0:00       ` Linus Walleij
2012-01-05 11:08         ` Marc Zyngier
2012-01-05 11:13           ` Shilimkar, Santosh
2012-01-05 11:19             ` Marc Zyngier
2012-01-05 11:26               ` Russell King - ARM Linux
2012-01-05 11:35                 ` Marc Zyngier
2012-01-05 12:10                   ` Russell King - ARM Linux
2012-01-05 16:13                     ` Marc Zyngier
2012-01-05 16:26                       ` Russell King - ARM Linux [this message]
2012-01-05 16:55                         ` Russell King - ARM Linux
2012-01-05 11:31               ` Shilimkar, Santosh
2012-01-05 10:33       ` Marc Zyngier
2012-01-05 10:45         ` Shilimkar, Santosh
2012-01-05  1:17     ` David Brown
2012-01-05 10:26       ` Linus Walleij
2012-01-05 11:01         ` Russell King - ARM Linux
2012-01-05 19:34         ` johlstei

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=20120105162650.GY11810@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).