public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Len Brown <lenb@kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>
Subject: [RFC][PATCH 8.5/9] PCI PM: Add diagnostic statements to PCI device PM initialization
Date: Fri, 20 Jun 2008 18:07:17 +0200	[thread overview]
Message-ID: <200806201807.17785.rjw@sisk.pl> (raw)
In-Reply-To: <200806201759.23863.rjw@sisk.pl>

Also, it seems reasonable to add some diagnostic printk()s to pci_pm_init().

Thanks,
Rafael

---
From: Rafael J. Wysocki <rjw@sisk.pl>

PCI PM: Add diagnostic statements to PCI device PM initialization

Add two diagnostic printk()s to pci_pm_init() allowing us to check
in the kernel log which PCI devices support generation of PME# and
from what states as well as which PCI devices can generate wake-up
events with the help of the platform.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/pci/pci.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Index: linux-next/drivers/pci/pci.c
===================================================================
--- linux-next.orig/drivers/pci/pci.c
+++ linux-next/drivers/pci/pci.c
@@ -1128,14 +1128,24 @@ void pci_pm_init(struct pci_dev *dev)
 		/* Check device's ability to generate PME# */
 		pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc);
 		if (pmc & PCI_PM_CAP_PME_MASK) {
+			printk(KERN_INFO "PCI: Device %s can generate PME# from"
+				"%s%s%s%s%s\n", pci_name(dev),
+				(pmc & PCI_PM_CAP_PME_D0) ? " D0" : "",
+				(pmc & PCI_PM_CAP_PME_D1) ? " D1" : "",
+				(pmc & PCI_PM_CAP_PME_D2) ? " D2" : "",
+				(pmc & PCI_PM_CAP_PME_D3) ? " D3hot" : "",
+				(pmc & PCI_PM_CAP_PME_D3cold) ? " D3cold" : "");
 			can_wakeup = true;
 			/* Disable the PME# generation capability */
 			pci_pme_active(dev, pm, false);
 		}
 	}
 
-	if (platform_pci_can_wakeup(dev))
+	if (platform_pci_can_wakeup(dev)) {
+		printk(KERN_INFO "PCI: Device %s can generate system wake-up "
+			"events through the platform\n", pci_name(dev));
 		can_wakeup = true;
+	}
 
 	device_init_wakeup(&dev->dev, can_wakeup);
 }

  reply	other threads:[~2008-06-20 16:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 23:45 [RFC][PATCH 0/9] PCI PM: Rework PCI device PM Rafael J. Wysocki
2008-06-19 23:46 ` [RFC][PATCH 1/9] ACPI: Introduce acpi_bus_power_manageable function Rafael J. Wysocki
2008-06-24 12:25   ` [linux-pm] " Pavel Machek
2008-06-19 23:47 ` [RFC][PATCH 2/9] PCI: Introduce platform_pci_power_manageable function Rafael J. Wysocki
2008-06-24 12:31   ` [linux-pm] " Pavel Machek
2008-06-19 23:48 ` [RFC][PATCH 3/9] PCI: Rework pci_set_power_state function Rafael J. Wysocki
2008-06-24 12:34   ` [linux-pm] " Pavel Machek
2008-06-19 23:49 ` [RFC][PATCH 4/9] ACPI: Introduce acpi_device_sleep_wake function Rafael J. Wysocki
2008-06-24 12:38   ` [linux-pm] " Pavel Machek
2008-06-19 23:50 ` [RFC][PATCH 5/9] ACPI: Introduce new device wakeup flag 'prepared' Rafael J. Wysocki
2008-06-19 23:51 ` [RFC][PATCH 6/9] PCI ACPI: Introduce acpi_pm_device_sleep_wake function Rafael J. Wysocki
2008-06-25  8:11   ` Zhang Rui
2008-06-25 10:29     ` Zhao Yakui
2008-06-25 18:57       ` Rafael J. Wysocki
2008-06-25 21:31         ` Rafael J. Wysocki
2008-06-26 14:12           ` Alan Stern
2008-06-26 18:21             ` Rafael J. Wysocki
2008-06-26 19:54               ` Alan Stern
2008-06-26 20:31                 ` Rafael J. Wysocki
2008-06-26 20:38                   ` Alan Stern
2008-06-19 23:52 ` [RFC][PATCH 7/9] PCI ACPI: Introduce can_wakeup platform callback Rafael J. Wysocki
2008-06-19 23:52 ` [RFC][PATCH 8/9] PCI PM: Rework device PM initialization Rafael J. Wysocki
2008-06-20 15:59   ` [RFC][PATCH 8/9] PCI PM: Rework device PM initialization (rev. 2) Rafael J. Wysocki
2008-06-20 16:07     ` Rafael J. Wysocki [this message]
2008-06-19 23:57 ` [RFC][PATCH 9/9] PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep Rafael J. Wysocki

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=200806201807.17785.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=jbarnes@virtuousgeek.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    /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