Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139373
b: refs/heads/master
c: fafad5b
h: refs/heads/master
i:
  139371: 55147a0
v: v3
  • Loading branch information
Michael Ellerman authored and Jesse Barnes committed Mar 20, 2009
1 parent 04e4f97 commit b85d152
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5546d6f56807115a035d140f7364ce5807dbcc87
refs/heads/master: fafad5bf06c3a3bb8b24b28b6f065367e7411872
23 changes: 22 additions & 1 deletion trunk/Documentation/PCI/MSI-HOWTO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ request_irq() for each 'vector' that it decides to use.
If this function returns a negative number, it indicates an error and
the driver should not attempt to allocate any more MSI-X interrupts for
this device. If it returns a positive number, it indicates the maximum
number of interrupt vectors that could have been allocated.
number of interrupt vectors that could have been allocated. See example
below.

This function, in contrast with pci_enable_msi(), does not adjust
dev->irq. The device will not generate interrupts for this interrupt
Expand All @@ -187,6 +188,26 @@ free them again later.
Device drivers should normally call this function once per device
during the initialization phase.

It is ideal if drivers can cope with a variable number of MSI-X interrupts,
there are many reasons why the platform may not be able to provide the
exact number a driver asks for.

A request loop to achieve that might look like:

static int foo_driver_enable_msix(struct foo_adapter *adapter, int nvec)
{
while (nvec >= FOO_DRIVER_MINIMUM_NVEC) {
rc = pci_enable_msix(adapter->pdev,
adapter->msix_entries, nvec);
if (rc > 0)
nvec = rc;
else
return rc;
}

return -ENOSPC;
}

4.3.2 pci_disable_msix

void pci_disable_msix(struct pci_dev *dev)
Expand Down

0 comments on commit b85d152

Please sign in to comment.