AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20090511174415.152fe35c@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:mail.onstor.net
NSV:
SSH:
R:<tsbogend@alpha.franken.de>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@exch1.onstor.net/INBOX	0	20090512003840.GA14157@alpha.franken.de
X-Sylpheed-End-Special-Headers: 1
Date: Mon, 11 May 2009 17:44:23 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: linux-mips on big_sur (broadcom 1480)
Message-ID: <20090511174423.6e5ca657@ripper.onstor.net>
In-Reply-To: <20090512003840.GA14157@alpha.franken.de>
References: <1239227598.14558.39.camel@chaos.ne.broadcom.com>
	<20090504215422.GB16886@alpha.franken.de>
	<20090511172444.40e0b307@ripper.onstor.net>
	<20090512003840.GA14157@alpha.franken.de>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Mon, 11 May 2009 17:38:40 -0700 Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:

> On Mon, May 11, 2009 at 05:24:44PM -0700, Andrew Sharp wrote:
> > Did this get applied?
> 
> Ralf applied it to the linux-mips git tree, but didn't push it to
> Linus, yet.
> 
> > Any reason not to send it to the list as a whole? I'm certainly
> > interested in it.
> 
> I've posted it to the linux-mips mailing list. Below is the mail I've
> sent.
> 
> Thomas.

Aha, thanks much.  I must have missed it the first time around.

Cheers,

a

> From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Subject: [PATCH] SIBYTE: fix locking in set_irq_affinity
> To: linux-mips@linux-mips.org
> cc: ralf@linux-mips.org
> 
> Locking of irq_desc is now done in irq_set_affinity; Don't lock it
> again in chip specific set_affinity function.
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
> 
>  arch/mips/sibyte/bcm1480/irq.c |    7 ++-----
>  arch/mips/sibyte/sb1250/irq.c  |    7 ++-----
>  2 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/mips/sibyte/bcm1480/irq.c
> b/arch/mips/sibyte/bcm1480/irq.c index 352352b..c147c4b 100644
> --- a/arch/mips/sibyte/bcm1480/irq.c
> +++ b/arch/mips/sibyte/bcm1480/irq.c
> @@ -113,7 +113,6 @@ static void bcm1480_set_affinity(unsigned int
> irq, const struct cpumask *mask) {
>  	int i = 0, old_cpu, cpu, int_on, k;
>  	u64 cur_ints;
> -	struct irq_desc *desc = irq_desc + irq;
>  	unsigned long flags;
>  	unsigned int irq_dirty;
>  
> @@ -127,8 +126,7 @@ static void bcm1480_set_affinity(unsigned int
> irq, const struct cpumask *mask) cpu = cpu_logical_map(i);
>  
>  	/* Protect against other affinity changers and IMR
> manipulation */
> -	spin_lock_irqsave(&desc->lock, flags);
> -	spin_lock(&bcm1480_imr_lock);
> +	spin_lock_irqsave(&bcm1480_imr_lock, flags);
>  
>  	/* Swizzle each CPU's IMR (but leave the IP selection alone)
> */ old_cpu = bcm1480_irq_owner[irq];
> @@ -153,8 +151,7 @@ static void bcm1480_set_affinity(unsigned int
> irq, const struct cpumask *mask) ____raw_writeq(cur_ints,
> IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H +
> (k*BCM1480_IMR_HL_SPACING))); } }
> -	spin_unlock(&bcm1480_imr_lock);
> -	spin_unlock_irqrestore(&desc->lock, flags);
> +	spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
>  }
>  #endif
>  
> diff --git a/arch/mips/sibyte/sb1250/irq.c
> b/arch/mips/sibyte/sb1250/irq.c index c08ff58..38cb998 100644
> --- a/arch/mips/sibyte/sb1250/irq.c
> +++ b/arch/mips/sibyte/sb1250/irq.c
> @@ -107,7 +107,6 @@ static void sb1250_set_affinity(unsigned int irq,
> const struct cpumask *mask) {
>  	int i = 0, old_cpu, cpu, int_on;
>  	u64 cur_ints;
> -	struct irq_desc *desc = irq_desc + irq;
>  	unsigned long flags;
>  
>  	i = cpumask_first(mask);
> @@ -121,8 +120,7 @@ static void sb1250_set_affinity(unsigned int irq,
> const struct cpumask *mask) cpu = cpu_logical_map(i);
>  
>  	/* Protect against other affinity changers and IMR
> manipulation */
> -	spin_lock_irqsave(&desc->lock, flags);
> -	spin_lock(&sb1250_imr_lock);
> +	spin_lock_irqsave(&sb1250_imr_lock, flags);
>  
>  	/* Swizzle each CPU's IMR (but leave the IP selection alone)
> */ old_cpu = sb1250_irq_owner[irq];
> @@ -144,8 +142,7 @@ static void sb1250_set_affinity(unsigned int irq,
> const struct cpumask *mask) ____raw_writeq(cur_ints,
> IOADDR(A_IMR_MAPPER(cpu) + R_IMR_INTERRUPT_MASK));
>  	}
> -	spin_unlock(&sb1250_imr_lock);
> -	spin_unlock_irqrestore(&desc->lock, flags);
> +	spin_unlock_irqrestore(&sb1250_imr_lock, flags);
>  }
>  #endif
>  
> 
