Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Mon, 11 May 2009
 17:39:05 -0700
Received: from psmtp.com ([64.18.0.122]) by mail.onstor.com with Microsoft
 SMTPSVC(6.0.3790.3959);	 Mon, 11 May 2009 17:39:05 -0700
Received: from source ([193.175.24.41]) (using TLSv1) by
 exprod5mx236.postini.com ([64.18.4.13]) with SMTP;	Mon, 11 May 2009 20:39:05
 EDT
Received: from uucp (helo=solo.franken.de)	by elvis.franken.de with
 local-bsmtp (Exim 3.36 #1)	id 1M3g1M-0003FA-00	for andy.sharp@onstor.com;
 Tue, 12 May 2009 02:39:00 +0200
Received: by solo.franken.de (Postfix, from userid 1000)	id 59EB4DE2C6; Tue,
 12 May 2009 02:38:40 +0200 (CEST)
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Andy Sharp <andy.sharp@onstor.com>
Date: Mon, 11 May 2009 17:38:40 -0700
Subject: Re: linux-mips on big_sur (broadcom 1480)
Thread-Topic: linux-mips on big_sur (broadcom 1480)
Thread-Index: AcnSmg424fM/1TSwROCidkr1vqgwDw==
Message-ID: <20090512003840.GA14157@alpha.franken.de>
References: <1239227598.14558.39.camel@chaos.ne.broadcom.com>
 <20090504215422.GB16886@alpha.franken.de>
 <20090511172444.40e0b307@ripper.onstor.net>
In-Reply-To: <20090511172444.40e0b307@ripper.onstor.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originalarrivaltime: 12 May 2009 00:39:05.0268 (UTC)
 FILETIME=[0DA7FF40:01C9D29A]
x-ems-stamp: HqtpLSyWXNe7dt4R8tE0nA==
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
user-agent: Mutt/1.5.18 (2008-05-17)
x-pstn-neptune: 0/0/0.00/0
x-pstn-levels: (S:57.99867/99.90000 CV: 6.7865 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

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, ye=
t.

> 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.


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, cons=
t struct cpumask *mask)
 {
 	int i =3D 0, old_cpu, cpu, int_on, k;
 	u64 cur_ints;
-	struct irq_desc *desc =3D irq_desc + irq;
 	unsigned long flags;
 	unsigned int irq_dirty;
=20
@@ -127,8 +126,7 @@ static void bcm1480_set_affinity(unsigned int irq, cons=
t struct cpumask *mask)
 	cpu =3D cpu_logical_map(i);
=20
 	/* 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);
=20
 	/* Swizzle each CPU's IMR (but leave the IP selection alone) */
 	old_cpu =3D bcm1480_irq_owner[irq];
@@ -153,8 +151,7 @@ static void bcm1480_set_affinity(unsigned int irq, cons=
t struct cpumask *mask)
 			____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_I=
MR_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
=20
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 =3D 0, old_cpu, cpu, int_on;
 	u64 cur_ints;
-	struct irq_desc *desc =3D irq_desc + irq;
 	unsigned long flags;
=20
 	i =3D cpumask_first(mask);
@@ -121,8 +120,7 @@ static void sb1250_set_affinity(unsigned int irq, const=
 struct cpumask *mask)
 	cpu =3D cpu_logical_map(i);
=20
 	/* 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);
=20
 	/* Swizzle each CPU's IMR (but leave the IP selection alone) */
 	old_cpu =3D 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
=20

--=20
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]
