All of lore.kernel.org
 help / color / mirror / Atom feed
From: kmpark@infradead.org (Kyungmin Park)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: GIC: Use the irq_to_desc for SPARSE IRQ
Date: Thu, 28 Oct 2010 14:03:54 +0900	[thread overview]
Message-ID: <20101028050354.GA23284@july> (raw)

From: Kyungmin Park <kyungmin.park@samsung.com>

When enable SPARSE_IRQ, there's compiler error at gic.c
Fix it by using the irq_to_desc to get the proper irq desc.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 7dfa9a8..1ca3c0d 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -158,15 +158,19 @@ static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val)
 {
 	void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3);
 	unsigned int shift = (irq % 4) * 8;
-	unsigned int cpu = cpumask_first(mask_val);
+	unsigned int node = cpumask_first(mask_val);
+	struct irq_desc *desc;
 	u32 val;
 
-	spin_lock(&irq_controller_lock);
-	irq_desc[irq].node = cpu;
-	val = readl(reg) & ~(0xff << shift);
-	val |= 1 << (cpu + shift);
-	writel(val, reg);
-	spin_unlock(&irq_controller_lock);
+	desc = irq_to_desc(irq);
+	if (desc) {
+		spin_lock(&irq_controller_lock);
+		desc->node = node;
+		val = readl(reg) & ~(0xff << shift);
+		val |= 1 << (node + shift);
+		writel(val, reg);
+		spin_unlock(&irq_controller_lock);
+	}
 
 	return 0;
 }

WARNING: multiple messages have this Message-ID (diff)
From: Kyungmin Park <kmpark@infradead.org>
To: linux@arm.linux.org.uk, rmk@arm.linux.org.uk,
	linux-arm-kernel@lists.infradead.org,
	rabin.vincent@stericsson.com, linus.walleij@stericsson.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] arm: GIC: Use the irq_to_desc for SPARSE IRQ
Date: Thu, 28 Oct 2010 14:03:54 +0900	[thread overview]
Message-ID: <20101028050354.GA23284@july> (raw)

From: Kyungmin Park <kyungmin.park@samsung.com>

When enable SPARSE_IRQ, there's compiler error at gic.c
Fix it by using the irq_to_desc to get the proper irq desc.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 7dfa9a8..1ca3c0d 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -158,15 +158,19 @@ static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val)
 {
 	void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3);
 	unsigned int shift = (irq % 4) * 8;
-	unsigned int cpu = cpumask_first(mask_val);
+	unsigned int node = cpumask_first(mask_val);
+	struct irq_desc *desc;
 	u32 val;
 
-	spin_lock(&irq_controller_lock);
-	irq_desc[irq].node = cpu;
-	val = readl(reg) & ~(0xff << shift);
-	val |= 1 << (cpu + shift);
-	writel(val, reg);
-	spin_unlock(&irq_controller_lock);
+	desc = irq_to_desc(irq);
+	if (desc) {
+		spin_lock(&irq_controller_lock);
+		desc->node = node;
+		val = readl(reg) & ~(0xff << shift);
+		val |= 1 << (node + shift);
+		writel(val, reg);
+		spin_unlock(&irq_controller_lock);
+	}
 
 	return 0;
 }

             reply	other threads:[~2010-10-28  5:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28  5:03 Kyungmin Park [this message]
2010-10-28  5:03 ` [PATCH] arm: GIC: Use the irq_to_desc for SPARSE IRQ Kyungmin Park

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=20101028050354.GA23284@july \
    --to=kmpark@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.