diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2012-11-29 07:05:05 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-11-30 11:47:21 -0500 |
commit | 9a4da8a5b109906a64bed5aaeb83bf4edb1f5888 (patch) | |
tree | 2788d7c8fe3e90333555435c7539d9f31d2c520e /arch/s390/include/asm/pci.h | |
parent | e56e4e87e370a0f121450d52337969aa1be21ff7 (diff) |
s390/pci: PCI adapter interrupts for MSI/MSI-X
Support PCI adapter interrupts using the Single-IRQ-mode. Single-IRQ-mode
disables an adapter IRQ automatically after delivering it until the SIC
instruction enables it again. This is used to reduce the number of IRQs
for streaming workloads.
Up to 64 MSI handlers can be registered per PCI function.
A hash table is used to map interrupt numbers to MSI descriptors.
The interrupt vector is scanned using the flogr instruction.
Only MSI/MSI-X interrupts are supported, no legacy INTs.
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/pci.h')
-rw-r--r-- | arch/s390/include/asm/pci.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index 6f98a54950ea..2a6084fa4b1a 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h | |||
@@ -20,6 +20,10 @@ void pci_iounmap(struct pci_dev *, void __iomem *); | |||
20 | int pci_domain_nr(struct pci_bus *); | 20 | int pci_domain_nr(struct pci_bus *); |
21 | int pci_proc_domain(struct pci_bus *); | 21 | int pci_proc_domain(struct pci_bus *); |
22 | 22 | ||
23 | /* MSI arch hooks */ | ||
24 | #define arch_setup_msi_irqs arch_setup_msi_irqs | ||
25 | #define arch_teardown_msi_irqs arch_teardown_msi_irqs | ||
26 | |||
23 | #define ZPCI_BUS_NR 0 /* default bus number */ | 27 | #define ZPCI_BUS_NR 0 /* default bus number */ |
24 | #define ZPCI_DEVFN 0 /* default device number */ | 28 | #define ZPCI_DEVFN 0 /* default device number */ |
25 | 29 | ||
@@ -29,6 +33,15 @@ int pci_proc_domain(struct pci_bus *); | |||
29 | #define ZPCI_FC_BLOCKED 0x20 | 33 | #define ZPCI_FC_BLOCKED 0x20 |
30 | #define ZPCI_FC_DMA_ENABLED 0x10 | 34 | #define ZPCI_FC_DMA_ENABLED 0x10 |
31 | 35 | ||
36 | struct msi_map { | ||
37 | unsigned long irq; | ||
38 | struct msi_desc *msi; | ||
39 | struct hlist_node msi_chain; | ||
40 | }; | ||
41 | |||
42 | #define ZPCI_NR_MSI_VECS 64 | ||
43 | #define ZPCI_MSI_MASK (ZPCI_NR_MSI_VECS - 1) | ||
44 | |||
32 | enum zpci_state { | 45 | enum zpci_state { |
33 | ZPCI_FN_STATE_RESERVED, | 46 | ZPCI_FN_STATE_RESERVED, |
34 | ZPCI_FN_STATE_STANDBY, | 47 | ZPCI_FN_STATE_STANDBY, |
@@ -56,6 +69,12 @@ struct zpci_dev { | |||
56 | u8 pfgid; /* function group ID */ | 69 | u8 pfgid; /* function group ID */ |
57 | u16 domain; | 70 | u16 domain; |
58 | 71 | ||
72 | /* IRQ stuff */ | ||
73 | u64 msi_addr; /* MSI address */ | ||
74 | struct zdev_irq_map *irq_map; | ||
75 | struct msi_map *msi_map[ZPCI_NR_MSI_VECS]; | ||
76 | unsigned int aisb; /* number of the summary bit */ | ||
77 | |||
59 | struct zpci_bar_struct bars[PCI_BAR_COUNT]; | 78 | struct zpci_bar_struct bars[PCI_BAR_COUNT]; |
60 | 79 | ||
61 | enum pci_bus_speed max_bus_speed; | 80 | enum pci_bus_speed max_bus_speed; |
@@ -83,6 +102,14 @@ int clp_add_pci_device(u32, u32, int); | |||
83 | int clp_enable_fh(struct zpci_dev *, u8); | 102 | int clp_enable_fh(struct zpci_dev *, u8); |
84 | int clp_disable_fh(struct zpci_dev *); | 103 | int clp_disable_fh(struct zpci_dev *); |
85 | 104 | ||
105 | /* MSI */ | ||
106 | struct msi_desc *__irq_get_msi_desc(unsigned int); | ||
107 | int zpci_msi_set_mask_bits(struct msi_desc *, u32, u32); | ||
108 | int zpci_setup_msi_irq(struct zpci_dev *, struct msi_desc *, unsigned int, int); | ||
109 | void zpci_teardown_msi_irq(struct zpci_dev *, struct msi_desc *); | ||
110 | int zpci_msihash_init(void); | ||
111 | void zpci_msihash_exit(void); | ||
112 | |||
86 | /* Helpers */ | 113 | /* Helpers */ |
87 | struct zpci_dev *get_zdev(struct pci_dev *); | 114 | struct zpci_dev *get_zdev(struct pci_dev *); |
88 | struct zpci_dev *get_zdev_by_fid(u32); | 115 | struct zpci_dev *get_zdev_by_fid(u32); |