diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-01-17 04:26:20 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-04 01:08:49 -0500 |
commit | 9a8b0af9b1dacf1d865d4b8bff7360e5b318481a (patch) | |
tree | c9bd078e3860228d1271b89f59af306f229a85e2 /Documentation/PCI | |
parent | 39af663b5fd25c9dd427e12e106763b6b4f9572c (diff) |
PCI/MSI: Add pci_enable_msi() documentation back
We deprecated pci_enable_msi() in 302a2523c277 ("PCI/MSI: Add
pci_enable_msi_range() and pci_enable_msix_range()").
But we changed our minds after noticing that:
- pci_enable_msi() doesn't have confusing return values like
pci_enable_msi_block() and pci_enable_msix() did, and
- pci_enable_msi() has a hundred or so callers that we don't want to
change.
This adds back the pci_enable_msi() documentation.
[bhelgaas: changelog]
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'Documentation/PCI')
-rw-r--r-- | Documentation/PCI/MSI-HOWTO.txt | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt index a8d01005f480..3c3080e9afef 100644 --- a/Documentation/PCI/MSI-HOWTO.txt +++ b/Documentation/PCI/MSI-HOWTO.txt | |||
@@ -82,7 +82,19 @@ Most of the hard work is done for the driver in the PCI layer. It simply | |||
82 | has to request that the PCI layer set up the MSI capability for this | 82 | has to request that the PCI layer set up the MSI capability for this |
83 | device. | 83 | device. |
84 | 84 | ||
85 | 4.2.1 pci_enable_msi_range | 85 | 4.2.1 pci_enable_msi |
86 | |||
87 | int pci_enable_msi(struct pci_dev *dev) | ||
88 | |||
89 | A successful call allocates ONE interrupt to the device, regardless | ||
90 | of how many MSIs the device supports. The device is switched from | ||
91 | pin-based interrupt mode to MSI mode. The dev->irq number is changed | ||
92 | to a new number which represents the message signaled interrupt; | ||
93 | consequently, this function should be called before the driver calls | ||
94 | request_irq(), because an MSI is delivered via a vector that is | ||
95 | different from the vector of a pin-based interrupt. | ||
96 | |||
97 | 4.2.2 pci_enable_msi_range | ||
86 | 98 | ||
87 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec) | 99 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec) |
88 | 100 | ||
@@ -158,7 +170,12 @@ static int foo_driver_enable_single_msi(struct pci_dev *pdev) | |||
158 | return pci_enable_msi_range(pdev, 1, 1); | 170 | return pci_enable_msi_range(pdev, 1, 1); |
159 | } | 171 | } |
160 | 172 | ||
161 | 4.2.2 pci_disable_msi | 173 | Note, unlike pci_enable_msi() function, which could be also used to |
174 | enable the single MSI mode, pci_enable_msi_range() returns either a | ||
175 | negative errno or 1 (not negative errno or 0 - as pci_enable_msi() | ||
176 | does). | ||
177 | |||
178 | 4.2.3 pci_disable_msi | ||
162 | 179 | ||
163 | void pci_disable_msi(struct pci_dev *dev) | 180 | void pci_disable_msi(struct pci_dev *dev) |
164 | 181 | ||
@@ -172,7 +189,7 @@ on any interrupt for which it previously called request_irq(). | |||
172 | Failure to do so results in a BUG_ON(), leaving the device with | 189 | Failure to do so results in a BUG_ON(), leaving the device with |
173 | MSI enabled and thus leaking its vector. | 190 | MSI enabled and thus leaking its vector. |
174 | 191 | ||
175 | 4.2.3 pci_msi_vec_count | 192 | 4.2.4 pci_msi_vec_count |
176 | 193 | ||
177 | int pci_msi_vec_count(struct pci_dev *dev) | 194 | int pci_msi_vec_count(struct pci_dev *dev) |
178 | 195 | ||