public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Print PCI device in power management warning.
@ 2011-12-23 18:16 Dave Jones
  2011-12-23 20:26 ` Konrad Rzeszutek Wilk
  2011-12-23 20:44 ` Alan Cox
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Jones @ 2011-12-23 18:16 UTC (permalink / raw)
  To: Linux Kernel; +Cc: linux-pm

When the WARN_ON in pci_has_legacy_pm_support() triggers, we get
users filing backtraces, but it's not obvious which driver is
triggering the trace. This adds a printk before the BUG.
This still isn't perfect (automated tools like abrt will still miss it)
but we can at least ask the user to look through their dmesg when
we get these traces reported.

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 12d1e81..b638244 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -604,7 +604,12 @@ static bool pci_has_legacy_pm_support(struct pci_dev *pci_dev)
 	 * supported as well.  Drivers are supposed to support either the
 	 * former, or the latter, but not both at the same time.
 	 */
-	WARN_ON(ret && drv->driver.pm);
+	if (ret && drv->driver.pm) {
+		printk(KERN_WARNING "pci: %s has both legacy and new PM support.\n",
+			drv->name);
+		BUG();
+	}
+
 
 	return ret;
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-23 21:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 18:16 Print PCI device in power management warning Dave Jones
2011-12-23 20:26 ` Konrad Rzeszutek Wilk
2011-12-23 20:46   ` Dave Jones
2011-12-23 22:04     ` Randy Dunlap
2011-12-23 20:44 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox