From patchwork Tue Apr 20 12:15:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 93657 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3KCFo0o016856 for ; Tue, 20 Apr 2010 12:15:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754347Ab0DTMPq (ORCPT ); Tue, 20 Apr 2010 08:15:46 -0400 Received: from cantor.suse.de ([195.135.220.2]:45496 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753574Ab0DTMPp (ORCPT ); Tue, 20 Apr 2010 08:15:45 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 85CE393717; Tue, 20 Apr 2010 14:15:44 +0200 (CEST) From: Thomas Renninger To: jbarnes@virtuousgeek.org Cc: Thomas Renninger , linux-pci@vger.kernel.org Subject: [PATCH] PCI dmar: Cleanup error reporting Date: Tue, 20 Apr 2010 14:15:42 +0200 Message-Id: <1271765742-8276-1-git-send-email-trenn@suse.de> X-Mailer: git-send-email 1.6.3 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 20 Apr 2010 12:15:51 +0000 (UTC) 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);