public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, linux-pm@vger.kernel.org
Subject: Re: Print PCI device in power management warning.
Date: Fri, 23 Dec 2011 15:46:09 -0500	[thread overview]
Message-ID: <20111223204608.GA24014@redhat.com> (raw)
In-Reply-To: <20111223202635.GA20991@andromeda.dapyr.net>

On Fri, Dec 23, 2011 at 04:26:35PM -0400, Konrad Rzeszutek Wilk wrote:
 
 > don't you just want:
 > 
 > 	WARN(ret && drv->driver.pm, "pci: %s Has both legacy and new PM
 > support!\n", drv_name(drv));
 > 
 > which will do what it previously does and also add the message you
 > wanted to add?

close. Not sure what drv_name() is, but I don't seem to have it in my tree.
This works though..

--- 

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.  Printing the driver name in addition to the trace
should make these easier to debug.

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

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 12d1e81..8af9ff2 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -604,7 +604,7 @@ 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);
+	WARN(ret && drv->driver.pm, "pci: %s Has both legacy and new PM support!\n", drv->name);
 
 	return ret;
 }

  reply	other threads:[~2011-12-23 20:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-12-23 22:04     ` Randy Dunlap
2011-12-23 20:44 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111223204608.GA24014@redhat.com \
    --to=davej@redhat.com \
    --cc=konrad@darnok.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox