aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-08-22 16:45:21 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-08-22 16:45:21 -0400
commitda27f4b3ec77a04672345381cbfeeb841d427327 (patch)
treef645626cb7a383898ef405971118aa5655dfba27
parent699c1985587aad3432c5ae19801efb4186db8b7a (diff)
PCI: Add comment about needing pci_msi_off() even when CONFIG_PCI_MSI=n
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>
-rw-r--r--drivers/pci/pci.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 69dcd32e0fe8..42e5f86e2387 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3059,18 +3059,23 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev)
3059EXPORT_SYMBOL_GPL(pci_check_and_unmask_intx); 3059EXPORT_SYMBOL_GPL(pci_check_and_unmask_intx);
3060 3060
3061/** 3061/**
3062 * pci_msi_off - disables any msi or msix capabilities 3062 * pci_msi_off - disables any MSI or MSI-X capabilities
3063 * @dev: the PCI device to operate on 3063 * @dev: the PCI device to operate on
3064 * 3064 *
3065 * If you want to use msi see pci_enable_msi and friends. 3065 * If you want to use MSI, see pci_enable_msi() and friends.
3066 * This is a lower level primitive that allows us to disable 3066 * This is a lower-level primitive that allows us to disable
3067 * msi operation at the device level. 3067 * MSI operation at the device level.
3068 */ 3068 */
3069void pci_msi_off(struct pci_dev *dev) 3069void pci_msi_off(struct pci_dev *dev)
3070{ 3070{
3071 int pos; 3071 int pos;
3072 u16 control; 3072 u16 control;
3073 3073
3074 /*
3075 * This looks like it could go in msi.c, but we need it even when
3076 * CONFIG_PCI_MSI=n. For the same reason, we can't use
3077 * dev->msi_cap or dev->msix_cap here.
3078 */
3074 pos = pci_find_capability(dev, PCI_CAP_ID_MSI); 3079 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3075 if (pos) { 3080 if (pos) {
3076 pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control); 3081 pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);