mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: linux-kernel@vger.kernel.org
Cc: Joerg Roedel <joerg.roedel@amd.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, iommu@lists.linux-foundation.org
Subject: [PATCH 05/21] amd_iommu.c: use pr_<level> and add pr_fmt(fmt)
Date: Sun,  4 Oct 2009 17:53:32 -0700	[thread overview]
Message-ID: <2a3001d41382d567f2693f72b7fda331c2fe1d52.1254701151.git.joe@perches.com> (raw)
In-Reply-To: <cover.1254701151.git.joe@perches.com>
In-Reply-To: <cover.1254701151.git.joe@perches.com>

Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted a few bare printks to pr_cont

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/x86/kernel/amd_iommu.c |   71 ++++++++++++++++++++++--------------------
 1 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 98f230f..0296b42 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -17,6 +17,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#define pr_fmt(fmt) "AMD-Vi: " fmt
+
 #include <linux/pci.h>
 #include <linux/gfp.h>
 #include <linux/bitops.h>
@@ -147,7 +149,7 @@ static void dump_dte_entry(u16 devid)
 	int i;
 
 	for (i = 0; i < 8; ++i)
-		pr_err("AMD-Vi: DTE[%d]: %08x\n", i,
+		pr_err("DTE[%d]: %08x\n", i,
 			amd_iommu_dev_table[devid].data[i]);
 }
 
@@ -157,7 +159,7 @@ static void dump_command(unsigned long phys_addr)
 	int i;
 
 	for (i = 0; i < 4; ++i)
-		pr_err("AMD-Vi: CMD[%d]: %08x\n", i, cmd->data[i]);
+		pr_err("CMD[%d]: %08x\n", i, cmd->data[i]);
 }
 
 static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
@@ -169,57 +171,58 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
 	int flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK;
 	u64 address = (u64)(((u64)event[3]) << 32) | event[2];
 
-	printk(KERN_ERR "AMD-Vi: Event logged [");
+	pr_err("Event logged [");
 
 	switch (type) {
 	case EVENT_TYPE_ILL_DEV:
-		printk("ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x "
-		       "address=0x%016llx flags=0x%04x]\n",
-		       PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
-		       address, flags);
+		pr_cont("ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x "
+			"address=0x%016llx flags=0x%04x]\n",
+			PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
+			address, flags);
 		dump_dte_entry(devid);
 		break;
 	case EVENT_TYPE_IO_FAULT:
-		printk("IO_PAGE_FAULT device=%02x:%02x.%x "
-		       "domain=0x%04x address=0x%016llx flags=0x%04x]\n",
-		       PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
-		       domid, address, flags);
+		pr_cont("IO_PAGE_FAULT device=%02x:%02x.%x "
+			"domain=0x%04x address=0x%016llx flags=0x%04x]\n",
+			PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
+			domid, address, flags);
 		break;
 	case EVENT_TYPE_DEV_TAB_ERR:
-		printk("DEV_TAB_HARDWARE_ERROR device=%02x:%02x.%x "
-		       "address=0x%016llx flags=0x%04x]\n",
-		       PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
-		       address, flags);
+		pr_cont("DEV_TAB_HARDWARE_ERROR device=%02x:%02x.%x "
+			"address=0x%016llx flags=0x%04x]\n",
+			PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
+			address, flags);
 		break;
 	case EVENT_TYPE_PAGE_TAB_ERR:
-		printk("PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x "
-		       "domain=0x%04x address=0x%016llx flags=0x%04x]\n",
-		       PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
-		       domid, address, flags);
+		pr_cont("PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x "
+			"domain=0x%04x address=0x%016llx flags=0x%04x]\n",
+			PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
+			domid, address, flags);
 		break;
 	case EVENT_TYPE_ILL_CMD:
-		printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
+		pr_cont("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
 		reset_iommu_command_buffer(iommu);
 		dump_command(address);
 		break;
 	case EVENT_TYPE_CMD_HARD_ERR:
-		printk("COMMAND_HARDWARE_ERROR address=0x%016llx "
-		       "flags=0x%04x]\n", address, flags);
+		pr_cont("COMMAND_HARDWARE_ERROR address=0x%016llx "
+			"flags=0x%04x]\n", address, flags);
 		break;
 	case EVENT_TYPE_IOTLB_INV_TO:
-		printk("IOTLB_INV_TIMEOUT device=%02x:%02x.%x "
-		       "address=0x%016llx]\n",
-		       PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
-		       address);
+		pr_cont("IOTLB_INV_TIMEOUT device=%02x:%02x.%x "
+			"address=0x%016llx]\n",
+			PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
+			address);
 		break;
 	case EVENT_TYPE_INV_DEV_REQ:
-		printk("INVALID_DEVICE_REQUEST device=%02x:%02x.%x "
-		       "address=0x%016llx flags=0x%04x]\n",
-		       PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
-		       address, flags);
+		pr_cont("INVALID_DEVICE_REQUEST device=%02x:%02x.%x "
+			"address=0x%016llx flags=0x%04x]\n",
+			PCI_BUS(devid), PCI_SLOT(devid), PCI_FUNC(devid),
+			address, flags);
 		break;
 	default:
-		printk(KERN_ERR "UNKNOWN type=0x%02x]\n", type);
+		pr_cont("\n");
+		pr_err("UNKNOWN type=0x%02x]\n", type);
 	}
 }
 
@@ -558,10 +561,10 @@ static void flush_devices_by_domain(struct protection_domain *domain)
 
 static void reset_iommu_command_buffer(struct amd_iommu *iommu)
 {
-	pr_err("AMD-Vi: Resetting IOMMU command buffer\n");
+	pr_err("Resetting IOMMU command buffer\n");
 
 	if (iommu->reset_in_progress)
-		panic("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n");
+		panic(pr_fmt("ILLEGAL_COMMAND_ERROR while resetting command buffer\n"));
 
 	iommu->reset_in_progress = true;
 
@@ -2418,7 +2421,7 @@ int __init amd_iommu_init_passthrough(void)
 		__attach_device(iommu, pt_domain, devid2);
 	}
 
-	pr_info("AMD-Vi: Initialized for Passthrough Mode\n");
+	pr_info("Initialized for Passthrough Mode\n");
 
 	return 0;
 }
-- 
1.6.3.1.10.g659a0.dirty


  parent reply	other threads:[~2009-10-05  0:55 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05  1:18 [PATCH 00/21] pr_dbg, pr_fmt Joe Perches
2009-10-05  0:53 ` [PATCH 01/21] include/linux/ dynamic_debug.h kernel.h: Remove KBUILD_MODNAME from dynamic_pr_debug, add pr_dbg Joe Perches
2009-10-05  0:53 ` [PATCH 02/21] ftrace.c: Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Joe Perches
2009-10-05 13:10   ` Steven Rostedt
2009-10-05 17:21     ` Joe Perches
2009-10-05 17:32       ` Steven Rostedt
2009-10-12  6:10   ` [tip:tracing/core] " tip-bot for Joe Perches
2009-10-05  0:53 ` [PATCH 03/21] mtrr: use pr_<level> and pr_fmt Joe Perches
2009-10-05  0:53 ` [PATCH 04/21] microcode: use pr_<level> and add pr_fmt Joe Perches
2009-10-05  0:53 ` Joe Perches [this message]
2009-10-12 15:00   ` [PATCH 05/21] amd_iommu.c: use pr_<level> and add pr_fmt(fmt) Joerg Roedel
2009-10-12 17:00     ` Joe Perches
2009-10-05  0:53 ` [PATCH 06/21] es7000_32.c: " Joe Perches
2009-10-05  0:53 ` [PATCH 07/21] arch/x86/kernel/apic/: " Joe Perches
2009-10-05  0:53 ` [PATCH 08/21] mcheck/: " Joe Perches
2009-10-05  0:53 ` [PATCH 09/21] arch/x86/kernel/setup_percpu.c: " Joe Perches
2009-10-05  0:53 ` [PATCH 10/21] arch/x86/kernel/cpu/: " Joe Perches
2009-10-05  0:53 ` [PATCH 11/21] i8254.c: Add pr_fmt(fmt) Joe Perches
2009-10-05  0:53 ` [PATCH 12/21] kmmio.c: Add and use pr_fmt(fmt) Joe Perches
2009-10-05  0:53 ` [PATCH 13/21] testmmiotrace.c: " Joe Perches
2009-10-12  6:10   ` [tip:tracing/core] " tip-bot for Joe Perches
2009-10-05  0:53 ` [PATCH 14/21] crypto/: use pr_<level> and add pr_fmt(fmt) Joe Perches
2009-10-05  0:53 ` [PATCH 15/21] kernel/power/: " Joe Perches
2009-10-05 19:43   ` Rafael J. Wysocki
2009-10-05 20:31     ` Joe Perches
2009-10-05 22:37       ` Rafael J. Wysocki
2009-10-09  3:53         ` Joe Perches
2009-10-10 21:28           ` Rafael J. Wysocki
2009-10-11  1:49             ` Joe Perches
2009-10-11  8:59             ` Pavel Machek
2009-10-05  0:53 ` [PATCH 16/21] kernel/kexec.c: " Joe Perches
2009-10-05 12:01   ` Eric W. Biederman
2009-10-05 17:57     ` Joe Perches
2009-10-05  0:53 ` [PATCH 17/21] crypto/async_tx/raid6test.c: " Joe Perches
2009-10-05  0:53 ` [PATCH 18/21] arch/x86/mm/mmio-mod.c: use pr_fmt Joe Perches
2009-10-05  0:53 ` [PATCH 19/21] drivers/net/bonding/: : " Joe Perches
2009-10-05  7:12   ` David Miller
2009-10-05  0:53 ` [PATCH 20/21] drivers/net/tlan: use pr_<level> and add pr_fmt(fmt) Joe Perches
2009-10-05  7:12   ` David Miller
2009-10-05  0:53 ` [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg( Joe Perches
2009-10-05  7:12   ` David Miller
2009-10-05  7:16     ` Joe Perches
2009-10-05  7:20       ` David Miller
2009-10-05 21:15       ` Rafael J. Wysocki
2009-10-05 21:28         ` Joe Perches

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=2a3001d41382d567f2693f72b7fda331c2fe1d52.1254701151.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=hpa@zytor.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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

all inboxes | Powered by JetHome®