From: Daniel Hellstrom <daniel@gaisler.com>
To: sparclinux@vger.kernel.org
Subject: Re: Status update on sparc32 genirq support
Date: Mon, 14 Mar 2011 11:25:42 +0000 [thread overview]
Message-ID: <4D7DFB36.5040200@gaisler.com> (raw)
In-Reply-To: <20110307.230120.226776255.davem@davemloft.net>
Sam Ravnborg wrote:
>Hi Daniel - thanks for looking at this patch.
>
>I was actually planning to send it to David tonight.
>But after your comments I will wait.
>
>
Thanks, please hold it a couple of days until I can test this a bit more.
Below is a patch that adds irq_unlink (havn't tested it yet), I figure
we must have that in order to implement irq_shutdown?
I used the patch on irq_alloc() below to get LEON booting, this will
make VIRQs map 1:1 to real IRQs in most cases. This is needed in order
to get APBUART driver working, however as said in previous email I will
try fixing APBUART driver instead so you should probably ignore that hunk.
Daniel
---
arch/sparc/kernel/irq.h | 1 +
arch/sparc/kernel/irq_32.c | 28 +++++++++++++++++++++++-----
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h
index a43fc46..ecff50f 100644
--- a/arch/sparc/kernel/irq.h
+++ b/arch/sparc/kernel/irq.h
@@ -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 (djhr@tadpole.co.uk)
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c
index 9ce6b97..f698f07 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -105,12 +105,12 @@ EXPORT_SYMBOL(arch_local_irq_restore);
* Sun4d complicates things even further. IRQ numbers are arbitrary
* 32-bit values in that case. Since this is similar to sparc64,
* we adopt a virtual IRQ numbering scheme as is done there.
- * Virutal interrupt numbers are allocated by build_irq(). So NR_IRQS
+ * Virtual interrupt numbers are allocated by build_irq(). So NR_IRQS
* just becomes a limit of how many interrupt sources we can handle in
* a single system. Even fully loaded SS2000 machines top off at
* about 32 interrupt sources or so, therefore a NR_IRQS value of 64
* is more than enough.
- *
+ *
* We keep a map of per-PIL enable interrupts. These get wired
* up via the irq_chip->startup() method which gets invoked by
* the generic IRQ layer during request_irq().
@@ -135,9 +135,13 @@ unsigned int irq_alloc(unsigned int real_irq,
unsigned int pil)
return i;
}
- for (i = 1; i < NR_IRQS; i++) {
- if (!irq_table[i].irq)
- break;
+ if (real_irq < NR_IRQS && irq_table[real_irq].irq = 0) {
+ i = real_irq;
+ } else {
+ for (i = 1; i < NR_IRQS; i++) {
+ if (!irq_table[i].irq)
+ break;
+ }
}
if (i >= NR_IRQS) {
@@ -170,6 +174,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;
--
1.6.3.3
next prev parent reply other threads:[~2011-03-14 11:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-08 7:01 Status update on sparc32 genirq support David Miller
2011-03-08 7:08 ` Sam Ravnborg
2011-03-08 7:19 ` David Miller
2011-03-08 7:37 ` Marcel van Nies
2011-03-08 7:45 ` Marcel van Nies
2011-03-08 11:17 ` Marcel van Nies
2011-03-08 20:22 ` Marcel van Nies
2011-03-08 21:09 ` Sam Ravnborg
2011-03-08 21:13 ` Marcel van Nies
2011-03-08 21:19 ` David Miller
2011-03-08 21:20 ` Marcel van Nies
2011-03-08 21:27 ` Marcel van Nies
2011-03-08 21:30 ` Marcel van Nies
2011-03-08 21:30 ` David Miller
2011-03-08 21:51 ` Marcel van Nies
2011-03-08 22:00 ` David Miller
2011-03-09 5:25 ` Bob Breuer
2011-03-09 6:16 ` Bob Breuer
2011-03-09 6:37 ` Bob Breuer
2011-03-09 20:17 ` David Miller
2011-03-11 21:26 ` Marcel van Nies
2011-03-11 22:40 ` Sam Ravnborg
2011-03-12 18:03 ` daniel
2011-03-13 21:13 ` Sam Ravnborg
2011-03-14 11:17 ` Daniel Hellstrom
2011-03-14 11:25 ` Daniel Hellstrom [this message]
2011-03-14 17:03 ` Thomas Gleixner
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=4D7DFB36.5040200@gaisler.com \
--to=daniel@gaisler.com \
--cc=sparclinux@vger.kernel.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.