diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-08-31 01:27:28 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-08-31 02:06:51 -0400 |
commit | 5f92c329364c0bf2d3a356da5e8759fbe349f9d1 (patch) | |
tree | 2bf27d77009229a26c371102655c5f81c7e68d1e /include | |
parent | 6e69d6068cc2aa545544189a1ee4d2e1a32ad591 (diff) |
[SPARC64]: Fix several bugs in MSI handling.
1) sun4{u,v}_build_msi() have improper return value handling.
We should always return negative error codes, instead of
using the magic value "0" which could in fact be a valid
MSI number.
2) sun4{u,v}_build_msi() should return -ENOMEM instead of
calling prom_prom() halt with kzalloc() of the interrupt
data fails.
3) We 'remembered' the MSI number using a singleton in the
struct device archdata area, this doesn't work for MSI-X
which can cause multiple MSIs assosciated with one device.
Delete that archdata member, and instead store the MSI
number in the IRQ chip data area.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc64/device.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/irq.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-sparc64/device.h b/include/asm-sparc64/device.h index d5a4559b9555..5111e8717be3 100644 --- a/include/asm-sparc64/device.h +++ b/include/asm-sparc64/device.h | |||
@@ -16,8 +16,6 @@ struct dev_archdata { | |||
16 | 16 | ||
17 | struct device_node *prom_node; | 17 | struct device_node *prom_node; |
18 | struct of_device *op; | 18 | struct of_device *op; |
19 | |||
20 | unsigned int msi_num; | ||
21 | }; | 19 | }; |
22 | 20 | ||
23 | #endif /* _ASM_SPARC64_DEVICE_H */ | 21 | #endif /* _ASM_SPARC64_DEVICE_H */ |
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index c041e10ae7df..c00ad152771b 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h | |||
@@ -53,6 +53,9 @@ extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, | |||
53 | extern void sun4v_destroy_msi(unsigned int virt_irq); | 53 | extern void sun4v_destroy_msi(unsigned int virt_irq); |
54 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); | 54 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); |
55 | 55 | ||
56 | extern void sparc64_set_msi(unsigned int virt_irq, u32 msi); | ||
57 | extern u32 sparc64_get_msi(unsigned int virt_irq); | ||
58 | |||
56 | extern void fixup_irqs(void); | 59 | extern void fixup_irqs(void); |
57 | 60 | ||
58 | static __inline__ void set_softint(unsigned long bits) | 61 | static __inline__ void set_softint(unsigned long bits) |