aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/PCI/MSI-HOWTO.txt
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2009-03-17 08:54:10 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-03-20 13:48:14 -0400
commit1c8d7b0a562da06d3ebe83f01b1ed553205d1ae4 (patch)
tree79c84432f5aed5a08b3bef262a10d933daae6a9b /Documentation/PCI/MSI-HOWTO.txt
parentf2440d9acbe866b917b16cc0f927366341ce9215 (diff)
PCI MSI: Add support for multiple MSI
Add the new API pci_enable_msi_block() to allow drivers to request multiple MSI and reimplement pci_enable_msi in terms of pci_enable_msi_block. Ensure that the architecture back ends don't have to know about multiple MSI. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'Documentation/PCI/MSI-HOWTO.txt')
-rw-r--r--Documentation/PCI/MSI-HOWTO.txt45
1 files changed, 39 insertions, 6 deletions
diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt
index 1c02431f1d1a..9494f6dc38eb 100644
--- a/Documentation/PCI/MSI-HOWTO.txt
+++ b/Documentation/PCI/MSI-HOWTO.txt
@@ -94,15 +94,48 @@ This function should be called before the driver calls request_irq()
94since enabling MSIs disables the pin-based IRQ and the driver will not 94since enabling MSIs disables the pin-based IRQ and the driver will not
95receive interrupts on the old interrupt. 95receive interrupts on the old interrupt.
96 96
974.2.2 pci_disable_msi 974.2.2 pci_enable_msi_block
98
99int pci_enable_msi_block(struct pci_dev *dev, int count)
100
101This variation on the above call allows a device driver to request multiple
102MSIs. The MSI specification only allows interrupts to be allocated in
103powers of two, up to a maximum of 2^5 (32).
104
105If this function returns 0, it has succeeded in allocating at least as many
106interrupts as the driver requested (it may have allocated more in order
107to satisfy the power-of-two requirement). In this case, the function
108enables MSI on this device and updates dev->irq to be the lowest of
109the new interrupts assigned to it. The other interrupts assigned to
110the device are in the range dev->irq to dev->irq + count - 1.
111
112If this function returns a negative number, it indicates an error and
113the driver should not attempt to request any more MSI interrupts for
114this device. If this function returns a positive number, it will be
115less than 'count' and indicate the number of interrupts that could have
116been allocated. In neither case will the irq value have been
117updated, nor will the device have been switched into MSI mode.
118
119The device driver must decide what action to take if
120pci_enable_msi_block() returns a value less than the number asked for.
121Some devices can make use of fewer interrupts than the maximum they
122request; in this case the driver should call pci_enable_msi_block()
123again. Note that it is not guaranteed to succeed, even when the
124'count' has been reduced to the value returned from a previous call to
125pci_enable_msi_block(). This is because there are multiple constraints
126on the number of vectors that can be allocated; pci_enable_msi_block()
127will return as soon as it finds any constraint that doesn't allow the
128call to succeed.
129
1304.2.3 pci_disable_msi
98 131
99void pci_disable_msi(struct pci_dev *dev) 132void pci_disable_msi(struct pci_dev *dev)
100 133
101This function should be used to undo the effect of pci_enable_msi(). 134This function should be used to undo the effect of pci_enable_msi() or
102Calling it restores dev->irq to the pin-based interrupt number and frees 135pci_enable_msi_block(). Calling it restores dev->irq to the pin-based
103the previously allocated message signaled interrupt(s). The interrupt 136interrupt number and frees the previously allocated message signaled
104may subsequently be assigned to another device, so drivers should not 137interrupt(s). The interrupt may subsequently be assigned to another
105cache the value of dev->irq. 138device, so drivers should not cache the value of dev->irq.
106 139
107A device driver must always call free_irq() on the interrupt(s) 140A device driver must always call free_irq() on the interrupt(s)
108for which it has called request_irq() before calling this function. 141for which it has called request_irq() before calling this function.