Skip to contentSkip to conversation

sparc32,leon: added irq_shutdown handler for genirq implementation

PATCH New Daniel Hellstrom 1 participant 1 message Mar 16, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sparc32,leon: added irq_shutdown handler for genirq implementation

---
 arch/sparc/kernel/irq.h         |    1 +
 arch/sparc/kernel/irq_32.c      |   14 ++++++++++++++
 arch/sparc/kernel/leon_kernel.c |    7 +++++++
 3 files changed, 22 insertions(+), 0 deletions(-)
arch/sparc/kernel/irq.h +1 -0
index a43fc46..ecff50f 100644
@@ -54,6 +54,7 @@ extern struct sparc_irq_config sparc_irq_config;
 
 unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
 void irq_link(unsigned int irq);
+void irq_unlink(unsigned int irq);
 void handler_irq(unsigned int pil, struct pt_regs *regs);
 
 /* Dave Redman ([email protected])
arch/sparc/kernel/irq_32.c +14 -0
index 46a573a..1be0ae3 100644
@@ -175,6 +175,20 @@ void irq_link(unsigned int irq)
 	irq_map[pil] = p;
 }
 
+void irq_unlink(unsigned int irq)
+{
+	struct irq_bucket *p, **pnext;
+
+	BUG_ON(irq >= NR_IRQS);
+
+	p = &irq_table[irq];
+	BUG_ON(p->pil > SUN4D_MAX_IRQ);
+	pnext = &irq_map[p->pil];
+	while (*pnext != p)
+		pnext = &(*pnext)->next;
+	*pnext = p->next;
+}
+
 int show_interrupts(struct seq_file *p, void *v)
 {
 	int i = *(loff_t *) v, j;
arch/sparc/kernel/leon_kernel.c +7 -0
index 0c1ae2b..4ddf367 100644
@@ -113,9 +113,16 @@ static unsigned int leon_startup_irq(struct irq_data *data)
 	return 0;
 }
 
+static void leon_shutdown_irq(struct irq_data *data)
+{
+	irq_unlink(data->irq);
+	leon_mask_irq(data);
+}
+
 static struct irq_chip leon_irq = {
 	.name		= "leon",
 	.irq_startup	= leon_startup_irq,
+	.irq_shutdown	= leon_shutdown_irq,
 	.irq_mask	= leon_mask_irq,
 	.irq_unmask	= leon_unmask_irq,
 };
Signature · 1 line
1.5.4