diff mbox

PCI dmar: Cleanup error reporting

Message ID 1271765742-8276-1-git-send-email-trenn@suse.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Thomas Renninger April 20, 2010, 12:15 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 33ead97..8c3cde4 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -358,13 +358,8 @@  dmar_parse_one_rhsa(struct acpi_dmar_header *header)
 			return 0;
 		}
 	}
-	WARN(1, "Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n"
-	     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-	     drhd->reg_base_addr,
-	     dmi_get_system_info(DMI_BIOS_VENDOR),
-	     dmi_get_system_info(DMI_BIOS_VERSION),
-	     dmi_get_system_info(DMI_PRODUCT_VERSION));
-
+	printk(KERN_ERR FW_BUG PREFIX "RHSA refers to non-existent DMAR unit at"
+	       " %llx\n", drhd->reg_base_addr);
 	return 0;
 }
 #endif
@@ -465,7 +460,7 @@  parse_dmar_table(void)
 			(((unsigned long)dmar) + dmar_tbl->length)) {
 		/* Avoid looping forever on bad ACPI tables */
 		if (entry_header->length == 0) {
-			printk(KERN_WARNING PREFIX
+			printk(KERN_WARNING FW_BUG PREFIX
 				"Invalid 0-length structure\n");
 			ret = -EINVAL;
 			break;
@@ -614,8 +609,6 @@  int __init dmar_table_init(void)
 	return 0;
 }
 
-static int bios_warned;
-
 int __init check_zero_address(void)
 {
 	struct acpi_table_dmar *dmar;
@@ -629,7 +622,7 @@  int __init check_zero_address(void)
 			(((unsigned long)dmar) + dmar_tbl->length)) {
 		/* Avoid looping forever on bad ACPI tables */
 		if (entry_header->length == 0) {
-			printk(KERN_WARNING PREFIX
+			printk(KERN_WARNING FW_BUG PREFIX
 				"Invalid 0-length structure\n");
 			return 0;
 		}
@@ -640,13 +633,8 @@  int __init check_zero_address(void)
 
 			drhd = (void *)entry_header;
 			if (!drhd->address) {
-				/* Promote an attitude of violence to a BIOS engineer today */
-				WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n"
-				     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-				     dmi_get_system_info(DMI_BIOS_VENDOR),
-				     dmi_get_system_info(DMI_BIOS_VERSION),
-				     dmi_get_system_info(DMI_PRODUCT_VERSION));
-				bios_warned = 1;
+				printk(KERN_ERR FW_BUG PREFIX
+				       "reported at address zero!\n");
 				goto failed;
 			}
 
@@ -659,14 +647,9 @@  int __init check_zero_address(void)
 			ecap = dmar_readq(addr + DMAR_ECAP_REG);
 			early_iounmap(addr, VTD_PAGE_SIZE);
 			if (cap == (uint64_t)-1 && ecap == (uint64_t)-1) {
-				/* Promote an attitude of violence to a BIOS engineer today */
-				WARN(1, "Your BIOS is broken; DMAR reported at address %llx returns all ones!\n"
-				     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-				      drhd->address,
-				      dmi_get_system_info(DMI_BIOS_VENDOR),
-				      dmi_get_system_info(DMI_BIOS_VERSION),
-				      dmi_get_system_info(DMI_PRODUCT_VERSION));
-				bios_warned = 1;
+				printk (KERN_ERR FW_BUG PREFIX "reported at "
+					"address %llx returns all ones!\n",
+					drhd->address);
 				goto failed;
 			}
 		}
@@ -731,14 +714,7 @@  int alloc_iommu(struct dmar_drhd_unit *drhd)
 	int msagaw = 0;
 
 	if (!drhd->reg_base_addr) {
-		if (!bios_warned) {
-			WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n"
-			     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-			     dmi_get_system_info(DMI_BIOS_VENDOR),
-			     dmi_get_system_info(DMI_BIOS_VERSION),
-			     dmi_get_system_info(DMI_PRODUCT_VERSION));
-			bios_warned = 1;
-		}
+		printk(KERN_ERR FW_BUG PREFIX "reported at address zero!\n");
 		return -EINVAL;
 	}
 
@@ -758,16 +734,9 @@  int alloc_iommu(struct dmar_drhd_unit *drhd)
 	iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG);
 
 	if (iommu->cap == (uint64_t)-1 && iommu->ecap == (uint64_t)-1) {
-		if (!bios_warned) {
-			/* Promote an attitude of violence to a BIOS engineer today */
-			WARN(1, "Your BIOS is broken; DMAR reported at address %llx returns all ones!\n"
-			     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-			     drhd->reg_base_addr,
-			     dmi_get_system_info(DMI_BIOS_VENDOR),
-			     dmi_get_system_info(DMI_BIOS_VERSION),
-			     dmi_get_system_info(DMI_PRODUCT_VERSION));
-			bios_warned = 1;
-		}
+		/* Promote an attitude of violence to a BIOS engineer today */
+		printk(KERN_ERR FW_BUG PREFIX "reported at address %llx returns"
+		       " all ones!\n", drhd->reg_base_addr);
 		goto err_unmap;
 	}
 
@@ -1298,9 +1267,9 @@  static int dmar_fault_do_one(struct intel_iommu *iommu, int type,
 			fault_reason, reason);
 	else
 		printk(KERN_ERR
-		       "DMAR:[%s] Request device [%02x:%02x.%d] "
+		       PREFIX "[%s] Request device [%02x:%02x.%d] "
 		       "fault addr %llx \n"
-		       "DMAR:[fault reason %02d] %s\n",
+		       PREFIX "[fault reason %02d] %s\n",
 		       (type ? "DMA Read" : "DMA Write"),
 		       (source_id >> 8), PCI_SLOT(source_id & 0xFF),
 		       PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason);