linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mohammed, Afzal" <afzal@ti.com>
To: Rob Herring <robherring2@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree-discuss@lists.ozlabs.org" 
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	Nicolas Pitre <nico@linaro.org>, "Nori, Sekhar" <nsekhar@ti.com>,
	Will Deacon <will.deacon@arm.com>,
	Rob Herring <rob.herring@calxeda.com>,
	"Shilimkar, Santosh" <santosh.shilimkar@ti.com>,
	"Syed Mohammed, Khasim" <khasim@ti.com>
Subject: RE: [RFC 2/8] ARM: twd: register clock event for 1 core SMP
Date: Tue, 19 Feb 2013 08:00:07 +0000	[thread overview]
Message-ID: <C8443D0743D26F4388EA172BF4E2A7A93EAA8534@DBDE01.ent.ti.com> (raw)
In-Reply-To: <512230F1.8020208@gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3011 bytes --]

Hi Rob,

On Mon, Feb 18, 2013 at 19:17:29, Rob Herring wrote:
> On 02/18/2013 12:30 AM, Afzal Mohammed wrote:

> > Register percpu local timer for scheduler tick in the case of one core
> > SMP configuration. In other cases - secondary cpu's as well as boot
> > cpu's having more than one core, this is being registered as per
> > existing boot flow, with a difference that they happens after delay
> > calibration. Registering the clock for tick in case of one core should
> > be done before Kernel calibrates delay (this is required to boot,
> > unless local timer is the only one registered for tick). Registering
> > twd local timer at init_time (which platforms are doing now) helps
> > achieve that with the proposed change.
> > 
> > This helps in an almost booting Kernel (minimal) by only relying on
> > ARM parts for an A9 one core SMP.

> >  arch/arm/kernel/smp_twd.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> > index 616268c..118f4f2 100644
> > --- a/arch/arm/kernel/smp_twd.c
> > +++ b/arch/arm/kernel/smp_twd.c
> > @@ -335,6 +335,9 @@ static int __init twd_local_timer_common_register(struct device_node *np)
> >  
> >  	twd_get_clock(np);
> >  
> > +	if (num_possible_cpus() == 1)
> > +		twd_timer_setup(evt);
> > +

> Shouldn't this be fixed in the core code, so the same issue is fixed for
> all timers?

Is the following that you had in mind ? (with it, this patch as well as
1/8 would not be required),

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index d3a22be..2b6417d 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -42,6 +42,8 @@ void handle_IPI(int ipinr, struct pt_regs *regs);
  */
 extern void smp_init_cpus(void);
 
+extern void smp_monocore_timer_setup(void);
+
 
 /*
  * Provide a function to raise an IPI cross call on CPUs in callmap.
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 5f73f70..7431b77 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -504,6 +504,15 @@ int local_timer_register(struct local_timer_ops *ops)
 }
 #endif
 
+void __init smp_monocore_timer_setup(void)
+{
+       unsigned int cpu = smp_processor_id();
+       struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
+
+       if (!lt_ops)
+               lt_ops->setup(evt);
+}
+
 static void __cpuinit percpu_timer_setup(void)
 {
        unsigned int cpu = smp_processor_id();
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 955d92d..eb023ee 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -116,5 +116,6 @@ int __init register_persistent_clock(clock_access_fn read_boot,
 void __init time_init(void)
 {
        machine_desc->init_time();
+       smp_monocore_timer_setup();
        sched_clock_postinit();
 }

Regards
Afzal

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2013-02-19  8:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18  6:28 [RFC 0/8] ARM: AM43 (OMAP2+) boot support Afzal Mohammed
2013-02-18  6:30 ` [RFC 1/8] ARM: localtimer: return percpu clkevt on register Afzal Mohammed
2013-02-18  6:30 ` [RFC 2/8] ARM: twd: register clock event for 1 core SMP Afzal Mohammed
2013-02-18 13:47   ` Rob Herring
2013-02-19  8:00     ` Mohammed, Afzal [this message]
2013-02-18  6:30 ` [RFC 3/8] ARM: twd: clock rate from DT (if no DT clk tree) Afzal Mohammed
2013-02-18  6:30 ` [RFC 4/8] ARM: am33xx: ll debug config help Afzal Mohammed
2013-02-18  6:30 ` [RFC 5/8] ARM: OMAP2+: am43: Kconfig Afzal Mohammed
2013-02-18  6:30 ` [RFC 6/8] ARM: OMAP2+: am43: basic dt support Afzal Mohammed
2013-02-18  6:30 ` [RFC 7/8] ARM: dts: am4372: initial support Afzal Mohammed
2013-02-18  6:30 ` [RFC 8/8] ARM: dts: am43-pre-silicon support Afzal Mohammed

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=C8443D0743D26F4388EA172BF4E2A7A93EAA8534@DBDE01.ent.ti.com \
    --to=afzal@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=khasim@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nico@linaro.org \
    --cc=nsekhar@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=robherring2@gmail.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).