linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: k.kozlowski@samsung.com (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clocksource: exynos_mct: Fix stall after CPU hotplugging
Date: Tue, 25 Mar 2014 14:54:32 +0100	[thread overview]
Message-ID: <1395755672.24026.0.camel@AMDC1943> (raw)
In-Reply-To: <53316966.90600@samsung.com>

On Tue, 2014-03-25 at 12:32 +0100, Tomasz Figa wrote:
> Hi Krzysztof,
> 
> Two comments inline.
> 
> On 25.03.2014 11:41, Krzysztof Kozlowski wrote:
> 
> [snip]
> 
> > diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
> > index 48f76bc05da0..0b49b09dd1a9 100644
> > --- a/drivers/clocksource/exynos_mct.c
> > +++ b/drivers/clocksource/exynos_mct.c
> > @@ -339,7 +339,14 @@ 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 = this_cpu_ptr(&percpu_mct_tick);
> > +	/*
> > +	 * In case of hotplugging non-boot CPU, the set_next_event could be
> > +	 * called on CPU0 by ISR before IRQ affinity is set to proper CPU.
> 
> Hmm, is this a desired behavior? I guess this is a question for Thomas 
> and Daniel.
> 
> > +	 * Thus for accessing proper MCT Lx timer, 'per_cpu' for cpumask
> > +	 * in event must be used instead of 'this_cpu_ptr'.
> > +	 */
> > +	struct mct_clock_event_device *mevt = &per_cpu(percpu_mct_tick,
> > +			cpumask_first(evt->cpumask));
> >
> >   	exynos4_mct_tick_start(cycles, mevt);
> >
> > @@ -371,23 +378,13 @@ static inline void exynos4_tick_set_mode(enum clock_event_mode mode,
> >
> >   static int exynos4_mct_tick_clear(struct mct_clock_event_device *mevt)
> >   {
> > -	struct clock_event_device *evt = &mevt->evt;
> > -
> > -	/*
> > -	 * This is for supporting oneshot mode.
> > -	 * Mct would generate interrupt periodically
> > -	 * without explicit stopping.
> > -	 */
> > -	if (evt->mode != CLOCK_EVT_MODE_PERIODIC)
> > -		exynos4_mct_tick_stop(mevt);
> > -
> >   	/* Clear the MCT tick interrupt */
> >   	if (__raw_readl(reg_base + mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) {
> >   		exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
> >   		return 1;
> > -	} else {
> > -		return 0;
> >   	}
> > +
> > +	return 0;
> 
> Nobody seems to be checking return value of this function (and I don't 
> see what it could be used for anyway), so I guess it could be simply 
> made void.

I'll send a another patch for it.

Best regards,
Krzysztof

      reply	other threads:[~2014-03-25 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 10:41 [PATCH] clocksource: exynos_mct: Fix stall after CPU hotplugging Krzysztof Kozlowski
2014-03-25 11:32 ` Tomasz Figa
2014-03-25 13:54   ` Krzysztof Kozlowski [this message]

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=1395755672.24026.0.camel@AMDC1943 \
    --to=k.kozlowski@samsung.com \
    --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).