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, 4 May 2009
 14:55:33 -0700
Received: from psmtp.com ([64.18.0.58]) by mail.onstor.com with Microsoft
 SMTPSVC(6.0.3790.3959);	 Mon, 4 May 2009 14:55:32 -0700
Received: from source ([213.58.128.207]) by exprod5mx262.postini.com
 ([64.18.4.10]) with SMTP;	Mon, 04 May 2009 15:55:32 MDT
Received: from localhost.localdomain ([127.0.0.1]:59624 "EHLO
	ftp.linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by ftp.linux-mips.org	with
 ESMTP id S20023514AbZEDVzV (ORCPT	<rfc822;andy.sharp@onstor.com>); Mon, 4 May
 2009 22:55:21 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 04 May 2009 22:55:05
 +0100 (BST)
Received: from elvis.franken.de ([193.175.24.41]:53596 "EHLO elvis.franken.de"
	rhost-flags-OK-OK-OK-OK) by ftp.linux-mips.org with ESMTP	id
 S20023500AbZEDVyd (ORCPT <rfc822;linux-mips@linux-mips.org>);	Mon, 4 May 2009
 22:54:33 +0100
Received: from uucp (helo=solo.franken.de)	by elvis.franken.de with
 local-bsmtp (Exim 3.36 #1)	id 1M167M-0005fm-00; Mon, 04 May 2009 23:54:32
 +0200
Received: by solo.franken.de (Postfix, from userid 1000)	id 461B2E31C1; Mon,
  4 May 2009 23:51:55 +0200 (CEST)
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
CC: "ralf@linux-mips.org" <ralf@linux-mips.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Mon, 4 May 2009 14:51:54 -0700
Subject: [PATCH] SIBYTE: fix locking in set_irq_affinity
Thread-Topic: [PATCH] SIBYTE: fix locking in set_irq_affinity
Thread-Index: AcnNAwxXVQPI5zyEQkqZiHfty9fEBA==
Message-ID: <20090504215155.461B2E31C1@solo.franken.de>
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-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 04 May 2009 21:55:32.0892 (UTC)
 FILETIME=[0C21FDC0:01C9CD03]
x-ems-stamp: ATm+hpZ0FYm5zvuorem6wg==
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-neptune: 0/0/0.00/0
x-pstn-levels: (S:87.81418/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-list: linux-mips
x-archive-position: 22617
x-ecartis-version: Ecartis v1.0.0
x-original-sender: tsbogend@alpha.franken.de
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

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

