Skip to contentSkip to conversation

pci_has_legacy_pm_support add driver and device to WARN

PATH Applied David Fries 3 participants 3 messages Nov 20, 2011 – Dec 5, 2011 PCI

lore
Share & tools
lore
#0 lore raw

From: David Fries <[email protected]>

Include the driver name and device in warning when a pci driver supports both legacy pm and new framework as just the stack trace gives no way to identify the driver.

Cc Rafael J. Wysocki <[email protected]>
Cc Jesse Barnes <[email protected]>
---
 drivers/pci/pci-driver.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/pci/pci-driver.c +2 -1
index 12d1e81..3623d65 100644
@@ -604,7 +604,8 @@ 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, "driver %s device %04x:%04x\n",
+		drv->name, pci_dev->vendor, pci_dev->device);
 
 	return ret;
 }
Signature · 1 line
1.7.7.1
#1 lore raw
Quoted 7 lines · David Fries

From: David Fries <[email protected]>

Include the driver name and device in warning when a pci driver supports both legacy pm and new framework as just the stack trace gives no way to identify the driver.

Quoted 21 lines
---
 drivers/pci/pci-driver.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/pci/pci-driver.c +2 -1
index 12d1e81..3623d65 100644
@@ -604,7 +604,8 @@ 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, "driver %s device %04x:%04x\n",
+		drv->name, pci_dev->vendor, pci_dev->device);
 
 	return ret;
 }
Applied
#2 lore raw
In reply to David Fries
Quoted 19 lines · On Sun, 20 Nov 2011 15:29:46 -0600 David Fries <[email protected]> wrote:

From: David Fries <[email protected]>

Include the driver name and device in warning when a pci driver supports both legacy pm and new framework as just the stack trace gives no way to identify the driver.

Cc Rafael J. Wysocki <[email protected]>
Cc Jesse Barnes <[email protected]>
---
 drivers/pci/pci-driver.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/pci/pci-driver.c +0 -0
index 12d1e81..3623d65 100644

drivers/pci/pci-driver.c static bool pci_has_legacy_pm_support(struct pci_dev *pci_dev) · line 611

Quoted 9 lines
drivers/pci/pci-driver.c +2 -1
@@ -604,7 +604,8 @@ 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, "driver %s device %04x:%04x\n",
+		drv->name, pci_dev->vendor, pci_dev->device);
 
 	return ret;
 }

Applied to linux-next, thanks.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center