mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Bob Moore <robert.moore@intel.com>,
	Lin Ming <ming.m.lin@intel.com>, Len Brown <len.brown@intel.com>
Subject: [PATCH 39/52] ACPICA: Table manager: deploy new firmware error/warning interfaces
Date: Tue, 24 Jul 2012 23:41:35 -0400	[thread overview]
Message-ID: <3b3ea7759ce484fffce387cf20a2dd39d1be3858.1343187617.git.len.brown@intel.com> (raw)
In-Reply-To: <1343187708-19532-1-git-send-email-lenb@kernel.org>
In-Reply-To: <6af1c4fc5227af65092ebc848989693562bfa3e8.1343187617.git.len.brown@intel.com>

From: Bob Moore <robert.moore@intel.com>

Emit firmware error/warning messages where appropriate for table
and FADT errors.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/tbfadt.c   | 102 +++++++++++++++++++++--------------------
 drivers/acpi/acpica/tbinstal.c |  15 +++---
 drivers/acpi/acpica/tbutils.c  |  34 ++++++++------
 drivers/acpi/acpica/tbxfroot.c |   2 +-
 4 files changed, 80 insertions(+), 73 deletions(-)

diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index d919f40..b3e3fd03 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -303,11 +303,11 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
 	 * a warning.
 	 */
 	if (length > sizeof(struct acpi_table_fadt)) {
-		ACPI_WARNING((AE_INFO,
-			      "FADT (revision %u) is longer than ACPI 5.0 version, "
-			      "truncating length %u to %u",
-			      table->revision, length,
-			      (u32)sizeof(struct acpi_table_fadt)));
+		ACPI_BIOS_WARNING((AE_INFO,
+				   "FADT (revision %u) is longer than ACPI 5.0 version, "
+				   "truncating length %u to %u",
+				   table->revision, length,
+				   (u32)sizeof(struct acpi_table_fadt)));
 	}
 
 	/* Clear the entire local FADT */
@@ -452,11 +452,13 @@ static void acpi_tb_convert_fadt(void)
 		 * they must match.
 		 */
 		if (address64->address && address32 &&
-		    (address64->address != (u64) address32)) {
-			ACPI_ERROR((AE_INFO,
-				    "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32",
-				    fadt_info_table[i].name, address32,
-				    ACPI_FORMAT_UINT64(address64->address)));
+		    (address64->address != (u64)address32)) {
+			ACPI_BIOS_ERROR((AE_INFO,
+					 "32/64X address mismatch in FADT/%s: "
+					 "0x%8.8X/0x%8.8X%8.8X, using 32",
+					 fadt_info_table[i].name, address32,
+					 ACPI_FORMAT_UINT64(address64->
+							    address)));
 		}
 
 		/* Always use 32-bit address if it is valid (non-null) */
@@ -511,25 +513,25 @@ static void acpi_tb_validate_fadt(void)
 	 * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
 	 */
 	if (acpi_gbl_FADT.facs &&
-	    (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {
-		ACPI_WARNING((AE_INFO,
-			      "32/64X FACS address mismatch in FADT - "
-			      "0x%8.8X/0x%8.8X%8.8X, using 32",
-			      acpi_gbl_FADT.facs,
-			      ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs)));
-
-		acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
+	    (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) {
+		ACPI_BIOS_WARNING((AE_INFO,
+				   "32/64X FACS address mismatch in FADT - "
+				   "0x%8.8X/0x%8.8X%8.8X, using 32",
+				   acpi_gbl_FADT.facs,
+				   ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs)));
+
+		acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs;
 	}
 
 	if (acpi_gbl_FADT.dsdt &&
-	    (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {
-		ACPI_WARNING((AE_INFO,
-			      "32/64X DSDT address mismatch in FADT - "
-			      "0x%8.8X/0x%8.8X%8.8X, using 32",
-			      acpi_gbl_FADT.dsdt,
-			      ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt)));
-
-		acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
+	    (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) {
+		ACPI_BIOS_WARNING((AE_INFO,
+				   "32/64X DSDT address mismatch in FADT - "
+				   "0x%8.8X/0x%8.8X%8.8X, using 32",
+				   acpi_gbl_FADT.dsdt,
+				   ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt)));
+
+		acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt;
 	}
 
 	/* If Hardware Reduced flag is set, we are all done */
@@ -559,10 +561,10 @@ static void acpi_tb_validate_fadt(void)
 		 */
 		if (address64->address &&
 		    (address64->bit_width != ACPI_MUL_8(length))) {
-			ACPI_WARNING((AE_INFO,
-				      "32/64X length mismatch in %s: %u/%u",
-				      name, ACPI_MUL_8(length),
-				      address64->bit_width));
+			ACPI_BIOS_WARNING((AE_INFO,
+					   "32/64X length mismatch in FADT/%s: %u/%u",
+					   name, ACPI_MUL_8(length),
+					   address64->bit_width));
 		}
 
 		if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
@@ -571,13 +573,13 @@ static void acpi_tb_validate_fadt(void)
 			 * Both the address and length must be non-zero.
 			 */
 			if (!address64->address || !length) {
-				ACPI_ERROR((AE_INFO,
-					    "Required field %s has zero address and/or length:"
-					    " 0x%8.8X%8.8X/0x%X",
-					    name,
-					    ACPI_FORMAT_UINT64(address64->
-							       address),
-					    length));
+				ACPI_BIOS_ERROR((AE_INFO,
+						 "Required FADT field %s has zero address and/or length: "
+						 "0x%8.8X%8.8X/0x%X",
+						 name,
+						 ACPI_FORMAT_UINT64(address64->
+								    address),
+						 length));
 			}
 		} else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {
 			/*
@@ -587,13 +589,13 @@ static void acpi_tb_validate_fadt(void)
 			 */
 			if ((address64->address && !length) ||
 			    (!address64->address && length)) {
-				ACPI_WARNING((AE_INFO,
-					      "Optional field %s has zero address or length: "
-					      "0x%8.8X%8.8X/0x%X",
-					      name,
-					      ACPI_FORMAT_UINT64(address64->
-								 address),
-					      length));
+				ACPI_BIOS_WARNING((AE_INFO,
+						   "Optional FADT field %s has zero address or length: "
+						   "0x%8.8X%8.8X/0x%X",
+						   name,
+						   ACPI_FORMAT_UINT64
+						   (address64->address),
+						   length));
 			}
 		}
 	}
@@ -638,12 +640,12 @@ static void acpi_tb_setup_fadt_registers(void)
 			    (fadt_info_table[i].default_length > 0) &&
 			    (fadt_info_table[i].default_length !=
 			     target64->bit_width)) {
-				ACPI_WARNING((AE_INFO,
-					      "Invalid length for %s: %u, using default %u",
-					      fadt_info_table[i].name,
-					      target64->bit_width,
-					      fadt_info_table[i].
-					      default_length));
+				ACPI_BIOS_WARNING((AE_INFO,
+						   "Invalid length for FADT/%s: %u, using default %u",
+						   fadt_info_table[i].name,
+						   target64->bit_width,
+						   fadt_info_table[i].
+						   default_length));
 
 				/* Incorrect size, set width to the default */
 
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index c03500b..a265d4a 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -138,13 +138,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
 	if ((table_desc->pointer->signature[0] != 0x00) &&
 	    (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
 	    && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) {
-		ACPI_ERROR((AE_INFO,
-			    "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx",
-			    acpi_ut_valid_acpi_name(*(u32 *)table_desc->
-						    pointer->
-						    signature) ? table_desc->
-			    pointer->signature : "????",
-			    *(u32 *)table_desc->pointer->signature));
+		ACPI_BIOS_ERROR((AE_INFO,
+				 "Table has invalid signature [%4.4s] (0x%8.8X), "
+				 "must be SSDT or OEMx",
+				 acpi_ut_valid_acpi_name(*(u32 *)table_desc->
+							 pointer->
+							 signature) ?
+				 table_desc->pointer->signature : "????",
+				 *(u32 *)table_desc->pointer->signature));
 
 		return_ACPI_STATUS(AE_BAD_SIGNATURE);
 	}
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 0a706ca..6818b31 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -317,10 +317,11 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
 	/* Checksum ok? (should be zero) */
 
 	if (checksum) {
-		ACPI_WARNING((AE_INFO,
-			      "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X",
-			      table->signature, table->checksum,
-			      (u8) (table->checksum - checksum)));
+		ACPI_BIOS_WARNING((AE_INFO,
+				   "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
+				   "should be 0x%2.2X",
+				   table->signature, table->checksum,
+				   (u8)(table->checksum - checksum)));
 
 #if (ACPI_CHECKSUM_ABORT)
 
@@ -377,8 +378,9 @@ void acpi_tb_check_dsdt_header(void)
 
 	if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length ||
 	    acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) {
-		ACPI_ERROR((AE_INFO,
-			    "The DSDT has been corrupted or replaced - old, new headers below"));
+		ACPI_BIOS_ERROR((AE_INFO,
+				 "The DSDT has been corrupted or replaced - "
+				 "old, new headers below"));
 		acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
 		acpi_tb_print_table_header(0, acpi_gbl_DSDT);
 
@@ -480,9 +482,10 @@ acpi_tb_install_table(acpi_physical_address address,
 	/* If a particular signature is expected (DSDT/FACS), it must match */
 
 	if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) {
-		ACPI_ERROR((AE_INFO,
-			    "Invalid signature 0x%X for ACPI table, expected [%s]",
-			    *ACPI_CAST_PTR(u32, table->signature), signature));
+		ACPI_BIOS_ERROR((AE_INFO,
+				 "Invalid signature 0x%X for ACPI table, expected [%s]",
+				 *ACPI_CAST_PTR(u32, table->signature),
+				 signature));
 		goto unmap_and_exit;
 	}
 
@@ -589,10 +592,10 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
 
 			/* Will truncate 64-bit address to 32 bits, issue warning */
 
-			ACPI_WARNING((AE_INFO,
-				      "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X),"
-				      " truncating",
-				      ACPI_FORMAT_UINT64(address64)));
+			ACPI_BIOS_WARNING((AE_INFO,
+					   "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X),"
+					   " truncating",
+					   ACPI_FORMAT_UINT64(address64)));
 		}
 #endif
 		return ((acpi_physical_address) (address64));
@@ -694,8 +697,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
 	acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
 
 	if (length < sizeof(struct acpi_table_header)) {
-		ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT",
-			    length));
+		ACPI_BIOS_ERROR((AE_INFO,
+				 "Invalid table length 0x%X in RSDT/XSDT",
+				 length));
 		return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
 	}
 
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 4258f64..5f6f744 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -216,7 +216,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address)
 
 	/* A valid RSDP was not found */
 
-	ACPI_ERROR((AE_INFO, "A valid RSDP was not found"));
+	ACPI_BIOS_ERROR((AE_INFO, "A valid RSDP was not found"));
 	return_ACPI_STATUS(AE_NOT_FOUND);
 }
 
-- 
1.7.12.rc0


  parent reply	other threads:[~2012-07-25  3:47 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25  3:40 ACPI & Power Management Patches for Linux-3.6-merge - part 1 Len Brown
2012-07-25  3:40 ` [PATCH 01/52] ACPICA: AML Parser: Fix two possible memory leaks in error path Len Brown
2012-07-25  3:40   ` [PATCH 02/52] ACPICA: Object dump routines: Use common function for string output Len Brown
2012-07-25  3:40   ` [PATCH 03/52] ACPICA: Lint fixes for acpi_write, no functional changes Len Brown
2012-07-25  3:41   ` [PATCH 04/52] ACPICA: Add support for multiple notify handlers Len Brown
2012-07-25  3:41   ` [PATCH 05/52] ACPICA: Update to version 20120420 Len Brown
2012-07-25  3:41   ` [PATCH 06/52] ACPICA: Disassembler: Add support for Operation Region externals Len Brown
2012-07-25  3:41   ` [PATCH 07/52] ACPICA: ACPI 5/iASL: Add support for PCC keyword Len Brown
2012-07-25  3:41   ` [PATCH 08/52] ACPICA: iASL: Improved pathname support Len Brown
2012-07-25  3:41   ` [PATCH 09/52] ACPICA: Remove argument of acpi_os_wait_events_complete Len Brown
2012-07-25  3:41   ` [PATCH 10/52] ACPICA: Add FADT error message for GAS BitWidth overflow Len Brown
2012-07-25  3:41   ` [PATCH 11/52] ACPICA: Update to version 20120518 Len Brown
2012-07-25  3:41   ` [PATCH 12/52] cpuidle: remove unused hrtimer_peek_ahead_timers() call Len Brown
2012-07-25  3:41   ` [PATCH 13/52] cpuidle: add checks to avoid NULL pointer dereference Len Brown
2012-07-25  3:41   ` [PATCH 14/52] ACPI Battery: Added capacity Len Brown
2012-07-25  3:41   ` [PATCH 15/52] cpuidle: refactor out cpuidle_enter_state Len Brown
2012-07-25  3:41   ` [PATCH 16/52] cpuidle: fix error handling in __cpuidle_register_device Len Brown
2012-07-25  3:41   ` [PATCH 17/52] cpuidle: add support for states that affect multiple cpus Len Brown
2012-07-25  3:41   ` [PATCH 18/52] cpuidle: coupled: add parallel barrier function Len Brown
2012-07-25  3:41   ` [PATCH 19/52] drivers/thermal/spear_thermal.c: add Device Tree probing capability Len Brown
2012-07-25  3:41   ` [PATCH 20/52] ACPI: Add an interface to evaluate _OST Len Brown
2012-07-25  3:41   ` [PATCH 21/52] ACPI: Add _OST support for sysfs eject Len Brown
2012-07-25  3:41   ` [PATCH 22/52] ACPI: Add _OST support for ACPI CPU hotplug Len Brown
2012-07-25  3:41   ` [PATCH 23/52] ACPI: Add _OST support for ACPI memory hotplug Len Brown
2012-07-25  3:41   ` [PATCH 24/52] ACPI: Add _OST support for ACPI container hotplug Len Brown
2012-07-25  3:41   ` [PATCH 25/52] ACPI: Set hotplug _OST support bit to _OSC Len Brown
2012-07-25  3:41   ` [PATCH 26/52] ACPI, PM, Specify lowest allowed state for device sleep state Len Brown
2012-07-25  3:41   ` [PATCH 27/52] intel_idle: initial IVB support Len Brown
2012-07-25  3:41   ` [PATCH 28/52] ACPI: remove acpi_pad MAINTAINERS entry Len Brown
2012-07-25  3:41   ` [PATCH 29/52] ACPI: acpi_pad: rename "power_saving" thread to "acpi_pad" thread Len Brown
2012-07-25  3:41   ` [PATCH 31/52] ACPICA: Disassembler: Emit descriptions for ACPI predefined names Len Brown
2012-07-25  3:41   ` [PATCH 32/52] ACPICA: Utilities: conditionally compile backslash removal function Len Brown
2012-07-25  3:41   ` [PATCH 33/52] ACPICA: Update comments; no functional change Len Brown
2012-07-25  3:41   ` [PATCH 34/52] ACPICA: Add support for implicit notify on multiple devices Len Brown
2012-07-25  3:41   ` [PATCH 35/52] ACPICA: Update to version 20120620 Len Brown
2012-07-25  3:41   ` [PATCH 36/52] ACPI: acpi_pad: tune round_robin_time Len Brown
2012-07-25  3:41   ` [PATCH 37/52] ACPICA: Split exception code utilities to a new file, utexcep.c Len Brown
2012-07-25  3:41   ` [PATCH 38/52] ACPICA: Add new interfaces for BIOS(firmware) errors and warnings Len Brown
2012-07-25  3:41   ` Len Brown [this message]
2012-07-25  3:41   ` [PATCH 40/52] ACPICA: Fix some comment fields Len Brown
2012-07-25  3:41   ` [PATCH 41/52] ACPICA: Add PCC address space to space ID decode function Len Brown
2012-07-25  3:41   ` [PATCH 42/52] ACPICA: Split file: tbxface.c -> tbxfload.c Len Brown
2012-07-25  3:41   ` [PATCH 43/52] ACPICA: Add new ACPI table load/unload external interfaces Len Brown
2012-07-25  3:41   ` [PATCH 44/52] ACPICA: Update header files copyrights to 2012 Len Brown
2012-07-25  3:41   ` [PATCH 45/52] ACPICA: AcpiSrc: Fix some translation issues for Linux conversion Len Brown
2012-07-25  3:41   ` [PATCH 46/52] ACPICA: Update to version 20120711 Len Brown
2012-07-25  3:41   ` [PATCH 47/52] tools/power: turbostat v2 - re-write for efficiency Len Brown
2012-07-25  3:41   ` [PATCH 48/52] tools/power: turbostat: fix large c1% issue Len Brown
2012-07-25 13:03     ` Konrad Rzeszutek Wilk
2012-07-25  3:41   ` [PATCH 49/52] ACPI/AC: prevent OOPS on some boxes due to missing check power_supply_register() return value check Len Brown
2012-07-25  3:41   ` [PATCH 50/52] Thermal: Make Thermal trip points writeable Len Brown
2012-07-25 11:13     ` Rafael J. Wysocki
2012-07-25 11:15       ` [linux-pm] " R, Durgadoss
2012-07-25  3:41   ` [PATCH 51/52] Thermal: Add Hysteresis attributes Len Brown
2012-07-25  3:41   ` [PATCH 52/52] Thermal: Documentation update Len Brown
2012-07-25  6:47 ` [linux-pm] ACPI & Power Management Patches for Linux-3.6-merge - part 1 Amit Kachhap

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=3b3ea7759ce484fffce387cf20a2dd39d1be3858.1343187617.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=ming.m.lin@intel.com \
    --cc=robert.moore@intel.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

all inboxes | Powered by JetHome®