linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@misterjones.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Russell King <rmk@arm.linux.org.uk>,
	Changhwan Youn <chaos.youn@samsung.com>,
	Kukjin Kim <kgene.kim@samsung.com>
Subject: Re: linux-next: manual merge of the arm-soc tree with the arm tree
Date: Tue, 25 Oct 2011 13:12:03 +0100	[thread overview]
Message-ID: <20111025131203.1f21ebcf@taxman.wild-wind.fr.eu.org> (raw)
In-Reply-To: <20111025074532.cc8cf0d5a9611ecc1246f46d@canb.auug.org.au>

On Tue, 25 Oct 2011 07:45:32 +1100
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Arnd,
> 
> Today's linux-next merge of the arm-soc tree got a conflict in
> arch/arm/mach-exynos4/include/mach/entry-macro.S between commit
> 292b293ceef2 ("ARM: gic: consolidate PPI handling") from the arm tree and
> commit 3a0622811292 ("ARM: EXYNOS4: Add support MCT PPI for EXYNOS4212")
> from the arm-soc tree.
> 
> Again, I hacked it up (again probably incorrectly - I kept both
> additions).

Here's the patch I've applied to my local copy of next-20111025.
Compile-tested only.

>From bb5510b2bf42bece7f8b27fff05e8841c5832cd5 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Tue, 25 Oct 2011 12:42:01 +0100
Subject: [PATCH] ARM: EXYNOS4: convert MCT to percpu interrupt API

MCT recently gained per cpu interrupts, and missed the fact that
ARM has moved to a genirq based implementation.

This patch converts the driver to the new API.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-exynos4/mct.c |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c
index f191608..4764c5d 100644
--- a/arch/arm/mach-exynos4/mct.c
+++ b/arch/arm/mach-exynos4/mct.c
@@ -44,7 +44,7 @@ struct mct_clock_event_device {
 	char name[10];
 };
 
-struct mct_clock_event_device mct_tick[NR_CPUS];
+static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
 
 static void exynos4_mct_write(unsigned int value, void *addr)
 {
@@ -302,7 +302,7 @@ static void exynos4_mct_tick_start(unsigned long cycles,
 static int exynos4_tick_set_next_event(unsigned long cycles,
 				       struct clock_event_device *evt)
 {
-	struct mct_clock_event_device *mevt = &mct_tick[smp_processor_id()];
+	struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
 
 	exynos4_mct_tick_start(cycles, mevt);
 
@@ -312,7 +312,7 @@ static int exynos4_tick_set_next_event(unsigned long cycles,
 static inline void exynos4_tick_set_mode(enum clock_event_mode mode,
 					 struct clock_event_device *evt)
 {
-	struct mct_clock_event_device *mevt = &mct_tick[smp_processor_id()];
+	struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
 
 	exynos4_mct_tick_stop(mevt);
 
@@ -376,14 +376,16 @@ static struct irqaction mct_tick1_event_irq = {
 
 static void exynos4_mct_tick_init(struct clock_event_device *evt)
 {
+	struct mct_clock_event_device *mevt;
 	unsigned int cpu = smp_processor_id();
 
-	mct_tick[cpu].evt = evt;
+	mevt = this_cpu_ptr(&percpu_mct_tick);
+	mevt->evt = evt;
 
-	mct_tick[cpu].base = EXYNOS4_MCT_L_BASE(cpu);
-	sprintf(mct_tick[cpu].name, "mct_tick%d", cpu);
+	mevt->base = EXYNOS4_MCT_L_BASE(cpu);
+	sprintf(mevt->name, "mct_tick%d", cpu);
 
-	evt->name = mct_tick[cpu].name;
+	evt->name = mevt->name;
 	evt->cpumask = cpumask_of(cpu);
 	evt->set_next_event = exynos4_tick_set_next_event;
 	evt->set_mode = exynos4_tick_set_mode;
@@ -398,21 +400,21 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)
 
 	clockevents_register_device(evt);
 
-	exynos4_mct_write(0x1, mct_tick[cpu].base + MCT_L_TCNTB_OFFSET);
+	exynos4_mct_write(0x1, mevt->base + MCT_L_TCNTB_OFFSET);
 
 	if (mct_int_type == MCT_INT_SPI) {
 		if (cpu == 0) {
-			mct_tick0_event_irq.dev_id = &mct_tick[cpu];
+			mct_tick0_event_irq.dev_id = mevt;
 			evt->irq = IRQ_MCT_L0;
 			setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq);
 		} else {
-			mct_tick1_event_irq.dev_id = &mct_tick[cpu];
+			mct_tick1_event_irq.dev_id = mevt;
 			evt->irq = IRQ_MCT_L1;
 			setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
 			irq_set_affinity(IRQ_MCT_L1, cpumask_of(1));
 		}
 	} else {
-		gic_enable_ppi(IRQ_MCT_LOCALTIMER);
+		enable_percpu_irq(IRQ_MCT_LOCALTIMER, 0);
 	}
 }
 
@@ -427,9 +429,11 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
 void local_timer_stop(struct clock_event_device *evt)
 {
 	evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
-	disable_irq(evt->irq);
+	if (mct_int_type == MCT_INT_SPI)
+		disable_irq(evt->irq);
+	else
+		disable_percpu_irq(IRQ_MCT_LOCALTIMER);
 }
-
 #endif /* CONFIG_LOCAL_TIMERS */
 
 static void __init exynos4_timer_resources(void)
@@ -438,6 +442,16 @@ static void __init exynos4_timer_resources(void)
 	mct_clk = clk_get(NULL, "xtal");
 
 	clk_rate = clk_get_rate(mct_clk);
+
+	if (mct_int_type == MCT_INT_PPI) {
+		int err;
+
+		err = request_percpu_irq(IRQ_MCT_LOCALTIMER,
+					 exynos4_mct_tick_isr, "MCT",
+					 &percpu_mct_tick);
+		WARN(err, "MCT: can't request IRQ %d (%d)\n",
+		     IRQ_MCT_LOCALTIMER, err);
+	}		
 }
 
 static void __init exynos4_timer_init(void)
-- 
1.7.7


-- 
I'm the slime oozin' out from your TV set...

  parent reply	other threads:[~2011-10-25 12:38 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 20:45 linux-next: manual merge of the arm-soc tree with the arm tree Stephen Rothwell
2011-10-24 20:51 ` Russell King
2011-10-25  8:04 ` Marc Zyngier
2011-10-25 12:12 ` Marc Zyngier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-28  0:16 Stephen Rothwell
2021-02-01 22:01 Stephen Rothwell
2021-02-14 22:14 ` Stephen Rothwell
2021-02-20 19:45   ` Alain Volmat
2021-02-21  0:28     ` Stephen Rothwell
2021-02-21 22:03   ` Stephen Rothwell
2019-08-29 23:27 Stephen Rothwell
2019-08-30 12:29 ` Arnd Bergmann
2018-05-29 23:40 Stephen Rothwell
2018-05-23 12:25 Mark Brown
2017-01-17 22:49 Stephen Rothwell
2017-01-17 22:53 ` Florian Fainelli
2015-08-11 23:48 Stephen Rothwell
2015-08-11 23:53 ` Nicolas Pitre
2015-09-02  0:47 ` Stephen Rothwell
2015-06-01 22:47 Stephen Rothwell
2015-01-29 22:55 Stephen Rothwell
2015-01-29 23:05 ` Russell King - ARM Linux
2014-09-26  1:23 Stephen Rothwell
2014-09-26  8:18 ` Russell King - ARM Linux
2014-09-26  9:27   ` Daniel Thompson
2014-09-26 13:52     ` Russell King - ARM Linux
2014-09-26  8:19 ` Carlo Caione
2014-09-26  8:39   ` Stephen Rothwell
2014-07-25  0:13 Stephen Rothwell
2014-06-02  0:49 Stephen Rothwell
2014-06-02  3:28 ` Olof Johansson
2014-05-27  0:52 Stephen Rothwell
2014-05-27  0:48 Stephen Rothwell
2014-05-23  0:53 Stephen Rothwell
2014-05-23  0:45 Stephen Rothwell
2014-05-23 13:08 ` Gregory CLEMENT
2014-01-05 23:20 Stephen Rothwell
2013-08-15  4:36 Stephen Rothwell
2013-05-01  6:44 Stephen Rothwell
2012-11-26 10:31 Stephen Rothwell
2012-11-26 10:39 ` Nicolas Ferre
2012-09-27  5:48 Stephen Rothwell
2012-09-20  6:03 Stephen Rothwell
2012-09-20  7:04 ` Linus Walleij
2012-05-16  8:50 Stephen Rothwell
2012-05-16  9:36 ` Haojian Zhuang
2012-05-14  8:39 Stephen Rothwell
2012-05-03  5:35 Stephen Rothwell
2012-03-16  6:49 Stephen Rothwell
2012-03-16  8:31 ` Arnd Bergmann
2012-03-15  7:06 Stephen Rothwell
2012-03-15  7:06 Stephen Rothwell
2012-03-15  6:56 Stephen Rothwell
2012-03-13  8:47 Stephen Rothwell
2012-03-13  8:42 Stephen Rothwell
2012-03-13  8:36 Stephen Rothwell
2012-02-29  5:16 Stephen Rothwell
2012-02-09 23:50 Stephen Rothwell
2012-02-10  0:25 ` Olof Johansson
2012-01-24  1:20 Stephen Rothwell
2012-01-06  1:03 Stephen Rothwell
2012-01-07  4:44 ` Shawn Guo
2012-01-07  6:53   ` Stephen Rothwell
2012-01-07  5:48 ` Shawn Guo
2012-01-07  6:48   ` Stephen Rothwell
2012-01-06  1:03 Stephen Rothwell
2012-01-06  1:03 Stephen Rothwell
2012-01-06  8:48 ` Russell King - ARM Linux
2012-01-06 10:31   ` Stephen Rothwell
2012-01-05  0:27 Stephen Rothwell
2012-01-02 23:34 Stephen Rothwell
2011-12-18 23:55 Stephen Rothwell
2011-12-19  1:32 ` Shawn Guo
2011-12-18 23:55 Stephen Rothwell
2011-12-06 23:53 Stephen Rothwell
2011-12-07  2:59 ` Shawn Guo
2011-12-06 23:52 Stephen Rothwell
2011-12-07  2:57 ` Shawn Guo
2011-11-27 23:56 Stephen Rothwell
2011-11-28 19:11 ` Arnd Bergmann
2011-11-29  8:06   ` Tomi Valkeinen
2011-12-07 19:28     ` Tony Lindgren
2011-11-24  0:52 Stephen Rothwell
2011-11-24 15:54 ` Arnd Bergmann
2011-11-24 22:25   ` Shawn Guo
2011-11-25 17:08     ` Arnd Bergmann
2011-10-24 20:52 Stephen Rothwell
2011-10-24 20:39 Stephen Rothwell
2011-10-24 20:48 ` Russell King
2011-10-24 21:08   ` Rob Herring
2011-10-24 20:20 Stephen Rothwell
2011-10-24 20:30 ` Russell King
2011-10-24 21:09   ` Sascha Hauer
2011-10-24 21:16     ` Russell King
2011-10-13  0:15 Stephen Rothwell
2011-10-13  0:11 Stephen Rothwell
2011-10-13  0:17 ` Stephen Rothwell
2011-10-04  0:08 Stephen Rothwell
2011-10-04 15:48 ` Stephen Warren
2011-10-04 19:33   ` Arnd Bergmann
2011-10-04  0:05 Stephen Rothwell
2011-09-27  1:25 Stephen Rothwell
2011-09-27  6:20 ` Tixy
2011-09-27  7:25 ` Russell King
2011-09-27 15:24   ` Arnd Bergmann
2011-09-27 21:23     ` Russell King
2011-09-22  1:49 Stephen Rothwell
2011-09-22  2:44 ` Nicolas Pitre
2011-09-12  2:05 Stephen Rothwell
2011-09-12  2:05 Stephen Rothwell
2011-09-12  2:05 Stephen Rothwell
2011-09-12  2:05 Stephen Rothwell
2011-09-12  2:18 ` Stephen Boyd
2011-09-13  1:55   ` Stephen Rothwell
2011-09-14 22:58     ` David Brown
2011-11-03  2:09     ` Stephen Rothwell
2011-11-03  2:22       ` David Brown
2011-11-03 15:10         ` Linus Torvalds
2011-08-29  1:04 Stephen Rothwell
2011-08-29  9:17 ` Linus Walleij
2011-07-16  5:07 Stephen Rothwell
2011-07-17 21:44 ` 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=20111025131203.1f21ebcf@taxman.wild-wind.fr.eu.org \
    --to=maz@misterjones.org \
    --cc=arnd@arndb.de \
    --cc=chaos.youn@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=sfr@canb.auug.org.au \
    /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).