Skip to content

Commit 7918b2d

Browse files
Alexander Gordeevbjorn-helgaas
authored andcommitted
PCI/MSI: Add pci_enable_msi() documentation back
We deprecated pci_enable_msi() in 302a252 ("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>
1 parent 75ce2d5 commit 7918b2d

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Documentation/PCI/MSI-HOWTO.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,19 @@ Most of the hard work is done for the driver in the PCI layer. It simply
8282
has to request that the PCI layer set up the MSI capability for this
8383
device.
8484

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
8698

8799
int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec)
88100

@@ -158,7 +170,12 @@ static int foo_driver_enable_single_msi(struct pci_dev *pdev)
158170
return pci_enable_msi_range(pdev, 1, 1);
159171
}
160172

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
162179

163180
void pci_disable_msi(struct pci_dev *dev)
164181

@@ -172,7 +189,7 @@ on any interrupt for which it previously called request_irq().
172189
Failure to do so results in a BUG_ON(), leaving the device with
173190
MSI enabled and thus leaking its vector.
174191

175-
4.2.3 pci_msi_vec_count
192+
4.2.4 pci_msi_vec_count
176193

177194
int pci_msi_vec_count(struct pci_dev *dev)
178195

0 commit comments

Comments
 (0)