lkml.org 
[lkml]   [2005]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[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: Roland Dreier <roland@topspin.com>

Index: linux-bk/drivers/pci/msi.c
===================================================================
--- linux-bk.orig/drivers/pci/msi.c 2005-01-10 08:32:50.208912010 -0800
+++ linux-bk/drivers/pci/msi.c 2005-01-10 09:04:04.866314348 -0800
@@ -374,19 +374,19 @@

if ((status = msi_cache_init()) < 0) {
pci_msi_enable = 0;
- printk(KERN_INFO "WARNING: MSI INIT FAILURE\n");
+ printk(KERN_WARNING "PCI: MSI cache init failed\n");
return status;
}
last_alloc_vector = assign_irq_vector(AUTO_ASSIGN);
if (last_alloc_vector < 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;
return status;
}
vector_irq[last_alloc_vector] = 0;
nr_released_vectors++;
- printk(KERN_INFO "MSI INIT SUCCESS\n");
+ printk(KERN_INFO "PCI: MSI subsystem initialized\n");

return status;
}
@@ -736,7 +736,9 @@
/* Check whether driver already requested for MSI-X vectors */
if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 &&
!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;
return -EINVAL;
}
@@ -774,9 +776,9 @@
}
if (entry->msi_attrib.state) {
spin_unlock_irqrestore(&msi_lock, flags);
- printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n",
- dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn),
- dev->irq);
+ printk(KERN_WARNING "PCI: %s: pci_disable_msi() called without "
+ "free_irq() on MSI vector %d\n",
+ pci_name(dev), dev->irq);
BUG_ON(entry->msi_attrib.state > 0);
} else {
vector_irq[dev->irq] = 0; /* free it */
@@ -982,7 +984,9 @@
/* Check whether driver already requested for MSI vector */
if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0 &&
!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;
return -EINVAL;
}
@@ -1050,9 +1054,9 @@
spin_unlock_irqrestore(&msi_lock, flags);
if (warning) {
dev->irq = temp;
- printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n",
- dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn));
+ printk(KERN_WARNING "PCI: %s: pci_disable_msix() called without "
+ "free_irq() on all MSI-X vectors\n",
+ pci_name(dev));
BUG_ON(warning > 0);
} else {
dev->irq = temp;
@@ -1088,9 +1092,9 @@
state = msi_desc[dev->irq]->msi_attrib.state;
spin_unlock_irqrestore(&msi_lock, flags);
if (state) {
- printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n",
- dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), dev->irq);
+ printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
+ "called without free_irq() on MSI vector %d\n",
+ pci_name(dev), dev->irq);
BUG_ON(state > 0);
} else /* Release MSI vector assigned to this device */
msi_free_vector(dev, dev->irq, 0);
@@ -1132,9 +1136,9 @@
iounmap(base);
release_mem_region(phys_addr, PCI_MSIX_ENTRY_SIZE *
multi_msix_capable(control));
- printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n",
- dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn));
+ printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() "
+ "called without free_irq() on all MSI-X vectors\n",
+ pci_name(dev));
BUG_ON(warning > 0);
}
dev->irq = temp; /* Restore IOAPIC IRQ */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.107 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site