From: Vincent Palatin <vpalatin@chromium.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
Alan Stern <stern@rowland.harvard.edu>,
Linux PCI <linux-pci@vger.kernel.org>
Cc: Olof Johansson <olofj@chromium.org>,
Sameer Nanda <snanda@chromium.org>,
Ming Lei <tom.leiming@gmail.com>,
linux-kernel@vger.kernel.org,
Vincent Palatin <vpalatin@chromium.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH 2/2] PM / Runtime: make PCI traces quieter
Date: Fri, 16 Sep 2011 15:15:55 -0700 [thread overview]
Message-ID: <1316211355-2888-3-git-send-email-vpalatin@chromium.org> (raw)
In-Reply-To: <1316211355-2888-1-git-send-email-vpalatin@chromium.org>
When the runtime PM is activated on PCI, if a device switches state
frequently (e.g. an EHCI controller with autosuspending USB devices
connected) the PCI configuration traces might be very verbose in the
kernel log. Let's desactivate them in such a situation.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
---
arch/x86/pci/i386.c | 4 +++-
drivers/acpi/pci_irq.c | 15 ++++++++++-----
drivers/pci/pci.c | 11 ++++++-----
drivers/pci/setup-res.c | 8 +++++---
4 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 494f2e7..2bb0e1e 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -31,6 +31,7 @@
#include <linux/ioport.h>
#include <linux/errno.h>
#include <linux/bootmem.h>
+#include <linux/pm_runtime.h>
#include <asm/pat.h>
#include <asm/e820.h>
@@ -269,7 +270,8 @@ void pcibios_set_master(struct pci_dev *dev)
lat = pcibios_max_latency;
else
return;
- dev_printk(KERN_DEBUG, &dev->dev, "setting latency timer to %d\n", lat);
+ dev_printk_norpm(KERN_DEBUG, &dev->dev,
+ "setting latency timer to %d\n", lat);
pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
}
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 7f9eba9..8cc1194 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -34,6 +34,7 @@
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/pm.h>
+#include <linux/pm_runtime.h>
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/slab.h>
@@ -487,10 +488,13 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
else
link_desc[0] = '\0';
- dev_info(&dev->dev, "PCI INT %c%s -> GSI %u (%s, %s) -> IRQ %d\n",
- pin_name(pin), link_desc, gsi,
- (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
- (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
+ dev_printk_norpm(KERN_INFO, &dev->dev, "PCI INT %c%s -> "
+ "GSI %u (%s, %s) -> IRQ %d\n",
+ pin_name(pin), link_desc, gsi,
+ (triggering == ACPI_LEVEL_SENSITIVE) ?
+ "level" : "edge",
+ (polarity == ACPI_ACTIVE_LOW) ?
+ "low" : "high", dev->irq);
return 0;
}
@@ -524,6 +528,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
* (e.g. PCI_UNDEFINED_IRQ).
*/
- dev_info(&dev->dev, "PCI INT %c disabled\n", pin_name(pin));
+ dev_printk_norpm(KERN_INFO, &dev->dev, "PCI INT %c disabled\n",
+ pin_name(pin));
acpi_unregister_gsi(gsi);
}
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 0ce6742..9f6b48c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -964,9 +964,10 @@ void pci_restore_state(struct pci_dev *dev)
for (i = 15; i >= 0; i--) {
pci_read_config_dword(dev, i * 4, &val);
if (val != dev->saved_config_space[i]) {
- dev_printk(KERN_DEBUG, &dev->dev, "restoring config "
- "space at offset %#x (was %#x, writing %#x)\n",
- i, val, (int)dev->saved_config_space[i]);
+ dev_printk_norpm(KERN_DEBUG, &dev->dev,
+ "restoring space at offset %#x "
+ "(was %#x, writing %#x)\n", i, val,
+ (int)dev->saved_config_space[i]);
pci_write_config_dword(dev,i * 4,
dev->saved_config_space[i]);
}
@@ -1531,8 +1532,8 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
}
out:
- dev_printk(KERN_DEBUG, &dev->dev, "PME# %s\n",
- enable ? "enabled" : "disabled");
+ dev_printk_norpm(KERN_DEBUG, &dev->dev, "PME# %s\n",
+ enable ? "enabled" : "disabled");
}
/**
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 51a9095..942399c 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -23,6 +23,7 @@
#include <linux/ioport.h>
#include <linux/cache.h>
#include <linux/slab.h>
+#include <linux/pm_runtime.h>
#include "pci.h"
@@ -84,9 +85,10 @@ void pci_update_resource(struct pci_dev *dev, int resno)
}
}
res->flags &= ~IORESOURCE_UNSET;
- dev_info(&dev->dev, "BAR %d: set to %pR (PCI address [%#llx-%#llx])\n",
- resno, res, (unsigned long long)region.start,
- (unsigned long long)region.end);
+ dev_printk_norpm(KERN_INFO, &dev->dev,
+ "BAR %d: set to %pR (PCI address [%#llx-%#llx])\n",
+ resno, res, (unsigned long long)region.start,
+ (unsigned long long)region.end);
}
int pci_claim_resource(struct pci_dev *dev, int resource)
--
1.7.3.1
next prev parent reply other threads:[~2011-09-16 22:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-16 22:15 [RFC] PM / Runtime: decrease verbosity in kernel log Vincent Palatin
2011-09-16 22:15 ` [PATCH 1/2] PM / Runtime: add conditional trace macro Vincent Palatin
2011-09-16 22:15 ` Vincent Palatin [this message]
2011-09-17 13:23 ` [RFC] PM / Runtime: decrease verbosity in kernel log Alan Stern
2011-09-19 16:20 ` Vincent Palatin
2011-09-19 21:08 ` Rafael J. Wysocki
2011-09-21 17:24 ` Vincent Palatin
2011-09-21 18:05 ` [PATCH] PM / Runtime: make PCI traces quieter Vincent Palatin
2011-09-21 18:29 ` Rafael J. Wysocki
2011-11-28 19:15 ` Vincent Palatin
2011-12-05 19:19 ` Jesse Barnes
2011-12-05 19:51 ` Vincent Palatin
2011-12-05 19:59 ` Jesse Barnes
2011-09-21 18:22 ` [RFC] PM / Runtime: decrease verbosity in kernel log Yinghai Lu
2011-09-21 18:28 ` 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=1316211355-2888-3-git-send-email-vpalatin@chromium.org \
--to=vpalatin@chromium.org \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=olofj@chromium.org \
--cc=rjw@sisk.pl \
--cc=snanda@chromium.org \
--cc=stern@rowland.harvard.edu \
--cc=tom.leiming@gmail.com \
/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