devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: srinivas.kandagatla@st.com
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Stuart Menefy <stuart.menefy@st.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Rob Herring <robherring2@gmail.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH v5] clocksource:arm_global_timer: Add ARM global timer support.
Date: Mon, 24 Jun 2013 15:00:18 -0700	[thread overview]
Message-ID: <51C8C172.8020207@codeaurora.org> (raw)
In-Reply-To: <51C8B551.9080203@st.com>

On 06/24/13 14:08, Srinivas KANDAGATLA wrote:
> On 24/06/13 21:06, Stephen Boyd wrote:
>> On 06/24/13 08:53, Srinivas KANDAGATLA wrote:
>>> +
>>> +static void gt_clockevents_stop(struct clock_event_device *clk)
>>> +{
>>> +	gt_clockevent_set_mode(CLOCK_EVT_MODE_UNUSED, clk);
>>> +	disable_percpu_irq(clk->irq);
>>> +}
>>> +
>>> +static int __cpuinit gt_clockevents_setup(struct clock_event_device *clk)
>>> +{
>>> +	struct clock_event_device *evt = this_cpu_ptr(gt_evt);
>>> +	return evt->name ? 0 : gt_clockevents_init(evt);
>>> +}
>> How does this work? gt_clockevents_stop() is using the
>> clock_event_device struct from the ARM local timer layer whereas
>> gt_clockevents_setup() is using a driver private allocation.
> Thanks for pointing this..
> This should fix it.
>
> static void gt_clockevents_stop(struct clock_event_device *clk)
> {
> 	struct clock_event_device *evt = this_cpu_ptr(gt_evt);
> 	gt_clockevent_set_mode(CLOCK_EVT_MODE_UNUSED, evt);
> 	disable_percpu_irq(evt->irq);
> }

Looks good, but even better would be to not use the local timer API.

>  Please just
>> don't use the local timer API at all and use cpu notifiers instead.
> Last time when I did try using cpu notifiers like arm_arch_timer, the
> broadcast dummy timer did kick off and took over the local timer on the
> secondary cpus. Resulting in lot of broadcast IPI's.
>
> If I use cpu notifiers I will end up two clk events on a each core (one
> dummy from arm/kernel/smp.c and other gt clk_evt). I think I can only
> use cpu notifiers in my case once your patches are in.
> Also I cant disable LOCAL_TIMERS as it y by default.
>
> Am I missing something?
>
> Am happy to move to cpu notifiers if it works, else the driver will be
> broken.

I think the problem is your clockevent has no rating. Please give it a
rating (300?) so that it prevents the dummy from taking over. You don't
need to worry about disabling the local timer API, it will register a
harmless clockevent with a low rating (100) that should be ignored.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


  reply	other threads:[~2013-06-24 22:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 15:53 [PATCH v5] clocksource:arm_global_timer: Add ARM global timer support Srinivas KANDAGATLA
     [not found] ` <1372089195-29219-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-24 20:01   ` Thomas Gleixner
2013-06-24 21:10     ` Srinivas KANDAGATLA
2013-06-24 20:06 ` Stephen Boyd
2013-06-24 21:08   ` Srinivas KANDAGATLA
2013-06-24 22:00     ` Stephen Boyd [this message]
     [not found]       ` <51C8C172.8020207-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2013-06-25  8:40         ` Srinivas KANDAGATLA
2013-06-24 22:08 ` Stephen Boyd
2013-06-25  8:38   ` Srinivas KANDAGATLA

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=51C8C172.8020207@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=arnd@arndb.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=robherring2@gmail.com \
    --cc=srinivas.kandagatla@st.com \
    --cc=stuart.menefy@st.com \
    --cc=tglx@linutronix.de \
    --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).