diff options
Diffstat (limited to 'Documentation/PCI/MSI-HOWTO.txt')
-rw-r--r-- | Documentation/PCI/MSI-HOWTO.txt | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt index c55df2911136..cd9c9f6a7cd9 100644 --- a/Documentation/PCI/MSI-HOWTO.txt +++ b/Documentation/PCI/MSI-HOWTO.txt | |||
@@ -94,14 +94,11 @@ has a requirements for a minimum number of vectors the driver can pass a | |||
94 | min_vecs argument set to this limit, and the PCI core will return -ENOSPC | 94 | min_vecs argument set to this limit, and the PCI core will return -ENOSPC |
95 | if it can't meet the minimum number of vectors. | 95 | if it can't meet the minimum number of vectors. |
96 | 96 | ||
97 | The flags argument should normally be set to 0, but can be used to pass the | 97 | The flags argument is used to specify which type of interrupt can be used |
98 | PCI_IRQ_NOMSI and PCI_IRQ_NOMSIX flag in case a device claims to support | 98 | by the device and the driver (PCI_IRQ_LEGACY, PCI_IRQ_MSI, PCI_IRQ_MSIX). |
99 | MSI or MSI-X, but the support is broken, or to pass PCI_IRQ_NOLEGACY in | 99 | A convenient short-hand (PCI_IRQ_ALL_TYPES) is also available to ask for |
100 | case the device does not support legacy interrupt lines. | 100 | any possible kind of interrupt. If the PCI_IRQ_AFFINITY flag is set, |
101 | 101 | pci_alloc_irq_vectors() will spread the interrupts around the available CPUs. | |
102 | By default this function will spread the interrupts around the available | ||
103 | CPUs, but this feature can be disabled by passing the PCI_IRQ_NOAFFINITY | ||
104 | flag. | ||
105 | 102 | ||
106 | To get the Linux IRQ numbers passed to request_irq() and free_irq() and the | 103 | To get the Linux IRQ numbers passed to request_irq() and free_irq() and the |
107 | vectors, use the following function: | 104 | vectors, use the following function: |
@@ -131,7 +128,7 @@ larger than the number supported by the device it will automatically be | |||
131 | capped to the supported limit, so there is no need to query the number of | 128 | capped to the supported limit, so there is no need to query the number of |
132 | vectors supported beforehand: | 129 | vectors supported beforehand: |
133 | 130 | ||
134 | nvec = pci_alloc_irq_vectors(pdev, 1, nvec, 0); | 131 | nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_ALL_TYPES) |
135 | if (nvec < 0) | 132 | if (nvec < 0) |
136 | goto out_err; | 133 | goto out_err; |
137 | 134 | ||
@@ -140,7 +137,7 @@ interrupts it can request a particular number of interrupts by passing that | |||
140 | number to pci_alloc_irq_vectors() function as both 'min_vecs' and | 137 | number to pci_alloc_irq_vectors() function as both 'min_vecs' and |
141 | 'max_vecs' parameters: | 138 | 'max_vecs' parameters: |
142 | 139 | ||
143 | ret = pci_alloc_irq_vectors(pdev, nvec, nvec, 0); | 140 | ret = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_ALL_TYPES); |
144 | if (ret < 0) | 141 | if (ret < 0) |
145 | goto out_err; | 142 | goto out_err; |
146 | 143 | ||
@@ -148,15 +145,14 @@ The most notorious example of the request type described above is enabling | |||
148 | the single MSI mode for a device. It could be done by passing two 1s as | 145 | the single MSI mode for a device. It could be done by passing two 1s as |
149 | 'min_vecs' and 'max_vecs': | 146 | 'min_vecs' and 'max_vecs': |
150 | 147 | ||
151 | ret = pci_alloc_irq_vectors(pdev, 1, 1, 0); | 148 | ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); |
152 | if (ret < 0) | 149 | if (ret < 0) |
153 | goto out_err; | 150 | goto out_err; |
154 | 151 | ||
155 | Some devices might not support using legacy line interrupts, in which case | 152 | Some devices might not support using legacy line interrupts, in which case |
156 | the PCI_IRQ_NOLEGACY flag can be used to fail the request if the platform | 153 | the driver can specify that only MSI or MSI-X is acceptable: |
157 | can't provide MSI or MSI-X interrupts: | ||
158 | 154 | ||
159 | nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_NOLEGACY); | 155 | nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX); |
160 | if (nvec < 0) | 156 | if (nvec < 0) |
161 | goto out_err; | 157 | goto out_err; |
162 | 158 | ||