Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: Kyle McMartin <kyle@parisc-linux.org>
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] [PATCH] Remove spinlock_t from cpu_data (and thus from processor.h)
Date: Sun, 26 Nov 2006 11:56:34 -0700	[thread overview]
Message-ID: <20061126185634.GE17707@colo.lackof.org> (raw)
In-Reply-To: <20061126183742.GB14193@athena.road.mcmartin.ca>

On Sun, Nov 26, 2006 at 01:37:42PM -0500, Kyle McMartin wrote:
> diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
> index 4a23a97..5b6bc6e 100644
> --- a/arch/parisc/kernel/smp.c
> +++ b/arch/parisc/kernel/smp.c
> @@ -76,6 +76,7 @@ cpumask_t cpu_possible_map __read_mostly
>  EXPORT_SYMBOL(cpu_online_map);
>  EXPORT_SYMBOL(cpu_possible_map);
>  
> +DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;

If this works - this is the right way to do it.
You rock!

thanks!
grant

>  
>  struct smp_call_struct {
>  	void (*func) (void *info);
> @@ -167,10 +168,11 @@ ipi_interrupt(int irq, void *dev_id) 
>  	mb();	/* Order interrupt and bit testing. */
>  
>  	for (;;) {
> -		spin_lock_irqsave(&(p->lock),flags);
> +		spinlock_t *lock = &per_cpu(ipi_lock, this_cpu);
> +		spin_lock_irqsave(lock, flags);
>  		ops = p->pending_ipi;
>  		p->pending_ipi = 0;
> -		spin_unlock_irqrestore(&(p->lock),flags);
> +		spin_unlock_irqrestore(lock, flags);
>  
>  		mb(); /* Order bit clearing and data access. */
>  
> @@ -275,12 +277,13 @@ static inline void
>  ipi_send(int cpu, enum ipi_message_type op)
>  {
>  	struct cpuinfo_parisc *p = &cpu_data[cpu];
> +	spinlock_t *lock = &per_cpu(ipi_lock, cpu);
>  	unsigned long flags;
>  
> -	spin_lock_irqsave(&(p->lock),flags);
> +	spin_lock_irqsave(lock, flags);
>  	p->pending_ipi |= 1 << op;
>  	gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa);
> -	spin_unlock_irqrestore(&(p->lock),flags);
> +	spin_unlock_irqrestore(lock, flags);
>  }
>  
>  
> diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
> index fd7866d..435afe5 100644
> --- a/include/asm-parisc/processor.h
> +++ b/include/asm-parisc/processor.h
> @@ -87,7 +87,6 @@ struct cpuinfo_parisc {
>  	unsigned long hpa;          /* Host Physical address */
>  	unsigned long txn_addr;     /* MMIO addr of EIR or id_eid */
>  #ifdef CONFIG_SMP
> -	spinlock_t lock;            /* synchronization for ipi's */
>  	unsigned long pending_ipi;  /* bitmap of type ipi_message_type */
>  	unsigned long ipi_count;    /* number ipi Interrupts */
>  #endif
> _______________________________________________
> parisc-linux mailing list
> parisc-linux@lists.parisc-linux.org
> http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  reply	other threads:[~2006-11-26 18:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-25 16:53 [parisc-linux] [PATCH] Remove spinlock_t from cpu_data (and thus from processor.h) Kyle McMartin
2006-11-26  7:33 ` Grant Grundler
2006-11-26 18:37   ` Kyle McMartin
2006-11-26 18:56     ` Grant Grundler [this message]
2006-11-26 18:38 ` Matthew Wilcox

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=20061126185634.GE17707@colo.lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=kyle@parisc-linux.org \
    --cc=parisc-linux@lists.parisc-linux.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