Commit 83889798 authored by Roland Dreier's avatar Roland Dreier Committed by Greg Kroah-Hartman

[PATCH] PCI: Clean up printks in msi.c

Add "PCI:" prefixes and fix up the formatting and grammar of printks
in drivers/pci/msi.c.  The main motivation was to fix the shouting
"MSI INIT SUCCESS" message printed when an MSI-using driver is first
started, but while we're at it we might as well tidy up all the messages.
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent fa35508b
...@@ -374,19 +374,18 @@ static int msi_init(void) ...@@ -374,19 +374,18 @@ static int msi_init(void)
if ((status = msi_cache_init()) < 0) { if ((status = msi_cache_init()) < 0) {
pci_msi_enable = 0; pci_msi_enable = 0;
printk(KERN_INFO "WARNING: MSI INIT FAILURE\n"); printk(KERN_WARNING "PCI: MSI cache init failed\n");
return status; return status;
} }
last_alloc_vector = assign_irq_vector(AUTO_ASSIGN); last_alloc_vector = assign_irq_vector(AUTO_ASSIGN);
if (last_alloc_vector < 0) { if (last_alloc_vector < 0) {
pci_msi_enable = 0; pci_msi_enable = 0;
printk(KERN_INFO "WARNING: ALL VECTORS ARE BUSY\n"); printk(KERN_WARNING "PCI: No interrupt vectors available for MSI\n");
status = -EBUSY; status = -EBUSY;
return status; return status;
} }
vector_irq[last_alloc_vector] = 0; vector_irq[last_alloc_vector] = 0;
nr_released_vectors++; nr_released_vectors++;
printk(KERN_INFO "MSI INIT SUCCESS\n");
return status; return status;
} }
...@@ -736,7 +735,9 @@ int pci_enable_msi(struct pci_dev* dev) ...@@ -736,7 +735,9 @@ int pci_enable_msi(struct pci_dev* dev)
/* Check whether driver already requested for MSI-X vectors */ /* Check whether driver already requested for MSI-X vectors */
if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 && if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 &&
!msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) { !msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
printk(KERN_INFO "Can't enable MSI. Device already had MSI-X vectors assigned\n"); printk(KERN_INFO "PCI: %s: Can't enable MSI. "
"Device already has MSI-X vectors assigned\n",
pci_name(dev));
dev->irq = temp; dev->irq = temp;
return -EINVAL; return -EINVAL;
} }
...@@ -774,9 +775,9 @@ void pci_disable_msi(struct pci_dev* dev) ...@@ -774,9 +775,9 @@ void pci_disable_msi(struct pci_dev* dev)
} }
if (entry->msi_attrib.state) { if (entry->msi_attrib.state) {
spin_unlock_irqrestore(&msi_lock, flags); spin_unlock_irqrestore(&msi_lock, flags);
printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n", printk(KERN_WARNING "PCI: %s: pci_disable_msi() called without "
dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn), "free_irq() on MSI vector %d\n",
dev->irq); pci_name(dev), dev->irq);
BUG_ON(entry->msi_attrib.state > 0); BUG_ON(entry->msi_attrib.state > 0);
} else { } else {
vector_irq[dev->irq] = 0; /* free it */ vector_irq[dev->irq] = 0; /* free it */
...@@ -982,7 +983,9 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec) ...@@ -982,7 +983,9 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
/* Check whether driver already requested for MSI vector */ /* Check whether driver already requested for MSI vector */
if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0 && if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0 &&
!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) { !msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
printk(KERN_INFO "Can't enable MSI-X. Device already had MSI vector assigned\n"); printk(KERN_INFO "PCI: %s: Can't enable MSI-X. "
"Device already has an MSI vector assigned\n",
pci_name(dev));
dev->irq = temp; dev->irq = temp;
return -EINVAL; return -EINVAL;
} }
...@@ -1050,9 +1053,9 @@ void pci_disable_msix(struct pci_dev* dev) ...@@ -1050,9 +1053,9 @@ void pci_disable_msix(struct pci_dev* dev)
spin_unlock_irqrestore(&msi_lock, flags); spin_unlock_irqrestore(&msi_lock, flags);
if (warning) { if (warning) {
dev->irq = temp; dev->irq = temp;
printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n", printk(KERN_WARNING "PCI: %s: pci_disable_msix() called without "
dev->bus->number, PCI_SLOT(dev->devfn), "free_irq() on all MSI-X vectors\n",
PCI_FUNC(dev->devfn)); pci_name(dev));
BUG_ON(warning > 0); BUG_ON(warning > 0);
} else { } else {
dev->irq = temp; dev->irq = temp;
...@@ -1088,9 +1091,9 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev) ...@@ -1088,9 +1091,9 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
state = msi_desc[dev->irq]->msi_attrib.state; state = msi_desc[dev->irq]->msi_attrib.state;
spin_unlock_irqrestore(&msi_lock, flags); spin_unlock_irqrestore(&msi_lock, flags);
if (state) { if (state) {
printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n", printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
dev->bus->number, PCI_SLOT(dev->devfn), "called without free_irq() on MSI vector %d\n",
PCI_FUNC(dev->devfn), dev->irq); pci_name(dev), dev->irq);
BUG_ON(state > 0); BUG_ON(state > 0);
} else /* Release MSI vector assigned to this device */ } else /* Release MSI vector assigned to this device */
msi_free_vector(dev, dev->irq, 0); msi_free_vector(dev, dev->irq, 0);
...@@ -1132,9 +1135,9 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev) ...@@ -1132,9 +1135,9 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
iounmap(base); iounmap(base);
release_mem_region(phys_addr, PCI_MSIX_ENTRY_SIZE * release_mem_region(phys_addr, PCI_MSIX_ENTRY_SIZE *
multi_msix_capable(control)); multi_msix_capable(control));
printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n", printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
dev->bus->number, PCI_SLOT(dev->devfn), "called without free_irq() on all MSI-X vectors\n",
PCI_FUNC(dev->devfn)); pci_name(dev));
BUG_ON(warning > 0); BUG_ON(warning > 0);
} }
dev->irq = temp; /* Restore IOAPIC IRQ */ dev->irq = temp; /* Restore IOAPIC IRQ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment