diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-04-18 05:39:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-05-02 22:02:38 -0400 |
commit | 7fe3730de729b758e9f69b862b9255d998671b5f (patch) | |
tree | 2fc0cf3a003aaf6e8c257a32b748941e3eec93b2 /kernel/irq | |
parent | f282b97021ddc95c6092b9016f667c0963858fb1 (diff) |
MSI: arch must connect the irq and the msi_desc
set_irq_msi() currently connects an irq_desc to an msi_desc. The archs call
it at some point in their setup routine, and then the generic code sets up the
reverse mapping from the msi_desc back to the irq.
set_irq_msi() should do both connections, making it the one and only call
required to connect an irq with it's MSI desc and vice versa.
The arch code MUST call set_irq_msi(), and it must do so only once it's sure
it's not going to fail the irq allocation.
Given that there's no need for the arch to return the irq anymore, the return
value from the arch setup routine just becomes 0 for success and anything else
for failure.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/chip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 0133f4f9e9f0..615ce97c6cfd 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/msi.h> | ||
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
16 | #include <linux/kernel_stat.h> | 17 | #include <linux/kernel_stat.h> |
@@ -185,6 +186,8 @@ int set_irq_msi(unsigned int irq, struct msi_desc *entry) | |||
185 | desc = irq_desc + irq; | 186 | desc = irq_desc + irq; |
186 | spin_lock_irqsave(&desc->lock, flags); | 187 | spin_lock_irqsave(&desc->lock, flags); |
187 | desc->msi_desc = entry; | 188 | desc->msi_desc = entry; |
189 | if (entry) | ||
190 | entry->irq = irq; | ||
188 | spin_unlock_irqrestore(&desc->lock, flags); | 191 | spin_unlock_irqrestore(&desc->lock, flags); |
189 | return 0; | 192 | return 0; |
190 | } | 193 | } |