Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] mach-u300: cleanup clockevent code
Date: Thu, 2 Jun 2011 11:35:26 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1106021134190.3078@ionos> (raw)
In-Reply-To: <4DE6ECAF.9080409@codeaurora.org>

On Wed, 1 Jun 2011, Stephen Boyd wrote:
> On 06/01/2011 03:03 AM, Thomas Gleixner wrote:
> > Something like the below should work for both UP and SMP
> >
> > diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
> > index c027d4f..739801b 100644
> > --- a/kernel/time/clockevents.c
> > +++ b/kernel/time/clockevents.c
> > @@ -173,6 +173,12 @@ static void clockevents_notify_released(void)
> >  	}
> >  }
> >  
> > +#ifdef CONFIG_SMP
> > +# define CPU_MASK_CHECK(x)		WARN_ON(!x)
> > +#else
> > +# define CPU_MASK_CHECK(x)		(!x)
> > +#endif
> > +
> >  /**
> >   * clockevents_register_device - register a clock event device
> >   * @dev:	device to register
> > @@ -182,7 +188,8 @@ void clockevents_register_device(struct clock_event_device *dev)
> >  	unsigned long flags;
> >  
> >  	BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
> > -	BUG_ON(!dev->cpumask);
> > +	if (CPU_MASK_CHECK(dev->cpumask))
> > +		dev->cpumask = cpumask_of(smp_processor_id());
> >  
> >  	raw_spin_lock_irqsave(&clockevents_lock, flags);
> 
> Won't this print a big WARNING on SMP_ON_UP=y and is_smp() == false
> kernels? Is there a generic cross-architecture way to check for SMP at

Need to check that.

> runtime?
> 
> Also, I don't understand the original motivation for this change. The
> assignment to cpumask was there in the u300 timer code already so the
> commit text from Linus is a bit misleading/confusing.

The point is that we can remove these assignements for UP all over the
place and just do it in the core code.

  reply	other threads:[~2011-06-02  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 21:09 [PATCH 3/3] mach-u300: cleanup clockevent code Linus Walleij
2011-05-31 21:23 ` Thomas Gleixner
2011-06-01  7:37   ` Linus Walleij
2011-06-01  8:34     ` Thomas Gleixner
2011-06-01  8:53       ` Linus Walleij
2011-06-01  9:22       ` Russell King - ARM Linux
2011-06-01 10:03         ` Thomas Gleixner
2011-06-01 11:23           ` Linus Walleij
2011-06-02  1:51           ` Stephen Boyd
2011-06-02  9:35             ` Thomas Gleixner [this message]
2011-06-02 10:29               ` Thomas Gleixner

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=alpine.LFD.2.02.1106021134190.3078@ionos \
    --to=tglx@linutronix.de \
    --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