]> Pileus Git - ~andy/linux/commitdiff
PCI: Add comment about needing pci_msi_off() even when CONFIG_PCI_MSI=n
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 22 Aug 2013 20:45:21 +0000 (14:45 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 22 Aug 2013 20:45:21 +0000 (14:45 -0600)
Per f5f2b13129 ("msi: sanely support hardware level msi disabling"), we
want pci_msi_off() to work even if MSI support is not compiled into the
kernel, and there are existing callers that use it when CONFIG_PCI_MSI=n.
This adds a comment to that effect.

No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c

index 69dcd32e0fe8a7037af4ecc7e1a7f4b8fbe7c08b..42e5f86e2387b1984271bedafe437af9a902c495 100644 (file)
@@ -3059,18 +3059,23 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev)
 EXPORT_SYMBOL_GPL(pci_check_and_unmask_intx);
 
 /**
- * pci_msi_off - disables any msi or msix capabilities
+ * pci_msi_off - disables any MSI or MSI-X capabilities
  * @dev: the PCI device to operate on
  *
- * If you want to use msi see pci_enable_msi and friends.
- * This is a lower level primitive that allows us to disable
- * msi operation at the device level.
+ * If you want to use MSI, see pci_enable_msi() and friends.
+ * This is a lower-level primitive that allows us to disable
+ * MSI operation at the device level.
  */
 void pci_msi_off(struct pci_dev *dev)
 {
        int pos;
        u16 control;
 
+       /*
+        * This looks like it could go in msi.c, but we need it even when
+        * CONFIG_PCI_MSI=n.  For the same reason, we can't use
+        * dev->msi_cap or dev->msix_cap here.
+        */
        pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
        if (pos) {
                pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);