public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ACPICA: Fix truncation message calculation
@ 2009-01-30 22:44 Myron Stowe
  2009-01-30 22:44 ` [PATCH 1/2] ACPICA: Fix table entry truncation calculation Myron Stowe
  2009-01-30 22:44 ` [PATCH 2/2] ACPICA: 80 column adherence (no functional change) Myron Stowe
  0 siblings, 2 replies; 3+ messages in thread
From: Myron Stowe @ 2009-01-30 22:44 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, linux-kernel, myron.stowe

Len:

The following two item patch series fixes a calculation in
./drivers/acpi/tables/tbutils.c::acpi_tb_parse_root_table() that
determines how many ACPI table entries will be truncated when the
number of RSDT/XSDT entries is greater than the statically allocated
'initial_tables[]' array.

As currently implemented, the calculation will always yield a value
of 0.  The following output shows the issue (Note the line with
"...: Truncating ..." which incorrectly indicates 0):
  ACPI: RSDP 32A82014, 0024 (r2 HP    )
  ACPI: XSDT 32A82580, 0494 (r1 HP     XXXXXX          0       1000013)
  ACPI Error (tbinstal-0207): Resize of Root Table Array is not allowed [20070126]
  ACPI Warning (tbutils-0519): Truncating 0 table entries! [20070126]
  ACPI: FACP 32A6C000, 00F4 (r3 HP     XXXXXX          0   HP        0)
  ACPI: DSDT 32A52000, 8E83 (r2 HP     XXXXXX          8 INTL 20061109)
  ...

With the patch applied, the output correctly shows the number of
(missing) truncated entries:
  ACPI: RSDP 32A82014, 0024 (r2 HP    )
  ACPI: XSDT 32A82580, 0494 (r1 HP     XXXXXX          0       1000013)
  ACPI Error (tbinstal-0207): Resize of Root Table Array is not allowed [20070126]
  ACPI Warning (tbutils-0519): Truncating 5 table entries! [20070126]
  ACPI: FACP 32A6C000, 00F4 (r3 HP     XXXXXX          0   HP        0)
  ACPI: DSDT 32A52000, 8E83 (r2 HP     XXXXXX          8 INTL 20061109)
  ...


[PATCH 1/2] fixes the truncation message related calculation.

[PATCH 2/2] is non-functional white space fixes - 80 column adherence -
for the same file. 


The underlying code affected is common to both x86 and ia64.  I have
tested the patch on an ia64 platform.

All comments welcome.

Myron
---

Myron Stowe (2):
      ACPICA: 80 column adherence (no functional change)
      ACPICA: Fix table entry truncation calculation


 drivers/acpi/acpica/tbutils.c |   43 +++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 15 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ACPICA: Fix table entry truncation calculation
  2009-01-30 22:44 [PATCH 0/2] ACPICA: Fix truncation message calculation Myron Stowe
@ 2009-01-30 22:44 ` Myron Stowe
  2009-01-30 22:44 ` [PATCH 2/2] ACPICA: 80 column adherence (no functional change) Myron Stowe
  1 sibling, 0 replies; 3+ messages in thread
From: Myron Stowe @ 2009-01-30 22:44 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, linux-kernel, myron.stowe, Myron Stowe

During early boot, ACPI RSDT/XSDT table entries are gathered into the
'initial_tables[]' array.  This array is currently statically defined (see
./drivers/acpi/tables.c).  When there are more table entries than can be
held in the 'initial_tables[]' array, the message "Truncating N table
entries!" is output.  As currently implemented, this message will always
erroneously calculate N as 0.

This patch fixes the calculation that determines how many table entries
will be missing (truncated).


This modification may be used under either the GPL or the BSD-style
license used for Intel ACPI CA code.

Signed-off-by: Myron Stowe <myron.stowe@hp.com>
---

 drivers/acpi/acpica/tbutils.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 9684cc8..22ce489 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -538,10 +538,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
 			if (ACPI_FAILURE(status)) {
 				ACPI_WARNING((AE_INFO,
 					      "Truncating %u table entries!",
-					      (unsigned)
-					      (acpi_gbl_root_table_list.size -
-					       acpi_gbl_root_table_list.
-					       count)));
+					      (unsigned) (table_count -
+					       (acpi_gbl_root_table_list.
+					       count - 2))));
 				break;
 			}
 		}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ACPICA: 80 column adherence (no functional change)
  2009-01-30 22:44 [PATCH 0/2] ACPICA: Fix truncation message calculation Myron Stowe
  2009-01-30 22:44 ` [PATCH 1/2] ACPICA: Fix table entry truncation calculation Myron Stowe
@ 2009-01-30 22:44 ` Myron Stowe
  1 sibling, 0 replies; 3+ messages in thread
From: Myron Stowe @ 2009-01-30 22:44 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, linux-kernel, myron.stowe, Myron Stowe

This patch modifies a file derived from ACPI CA and as such formatting
may come directly from the CA code or indirectly from some type of parsing
of the original CA code.  As such, non-functional formatting changes may be
counter productive.  If this is the case then feel free to ignore this
component of the patch series.


This modification may be used under either the GPL or the BSD-style
license used for Intel ACPI CA code.

Signed-off-by: Myron Stowe <myron.stowe@hp.com>
---

 drivers/acpi/acpica/tbutils.c |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 22ce489..e5c24b8 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -179,7 +179,10 @@ acpi_tb_print_table_header(acpi_physical_address address,
 
 	if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) {
 
-		/* FACS only has signature and length fields of common table header */
+		/*
+		 * FACS only has signature and length fields of common table
+		 * header
+		 */
 
 		ACPI_INFO((AE_INFO, "%4.4s %08lX, %04X",
 			   header->signature, (unsigned long)address,
@@ -379,14 +382,18 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
 	} else {
 		/*
 		 * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return
-		 * 64-bit platform, XSDT: Move (unaligned) 64-bit to local, return 64-bit
+		 * 64-bit platform, XSDT: Move (unaligned) 64-bit to local,
+		 * return 64-bit
 		 */
 		ACPI_MOVE_64_TO_64(&address64, table_entry);
 
 #if ACPI_MACHINE_WIDTH == 32
 		if (address64 > ACPI_UINT32_MAX) {
 
-			/* Will truncate 64-bit address to 32 bits, issue warning */
+			/*
+			 * Will truncate 64-bit address to 32 bits, issue
+			 * warning
+			 */
 
 			ACPI_WARNING((AE_INFO,
 				      "64-bit Physical Address in XSDT is too large (%8.8X%8.8X), truncating",
@@ -448,9 +455,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
 	if (rsdp->revision > 1 && rsdp->xsdt_physical_address
 			&& !acpi_rsdt_forced) {
 		/*
-		 * Root table is an XSDT (64-bit physical addresses). We must use the
-		 * XSDT if the revision is > 1 and the XSDT pointer is present, as per
-		 * the ACPI specification.
+		 * Root table is an XSDT (64-bit physical addresses). We must
+		 * use the XSDT if the revision is > 1 and the XSDT pointer
+		 * is present, as per * the ACPI specification.
 		 */
 		address = (acpi_physical_address) rsdp->xsdt_physical_address;
 		table_entry_size = sizeof(u64);
@@ -487,7 +494,7 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
 
 	acpi_tb_print_table_header(address, table);
 
-	/* Get the length of the full table, verify length and map entire table */
+	/* Get the length of the full table, verify len, and map entire table */
 
 	length = table->length;
 	acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
@@ -518,8 +525,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
 		    sizeof(struct acpi_table_header)) / table_entry_size);
 
 	/*
-	 * First two entries in the table array are reserved for the DSDT and FACS,
-	 * which are not actually present in the RSDT/XSDT - they come from the FADT
+	 * First two entries in the table array are reserved for the DSDT and
+	 * FACS, * which are not actually present in the RSDT/XSDT - they come
+	 * from the FADT
 	 */
 	table_entry =
 	    ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header);
@@ -532,7 +540,10 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
 		if (acpi_gbl_root_table_list.count >=
 		    acpi_gbl_root_table_list.size) {
 
-			/* There is no more room in the root table array, attempt resize */
+			/*
+			 * There is no more room in the root table array,
+			 * attempt resize
+			 */
 
 			status = acpi_tb_resize_root_table_list();
 			if (ACPI_FAILURE(status)) {
@@ -545,7 +556,10 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
 			}
 		}
 
-		/* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
+		/*
+		 * Get the table physical address (32-bit for RSDT,
+		 * 64-bit for XSDT)
+		 */
 
 		acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count].
 		    address =


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-30 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30 22:44 [PATCH 0/2] ACPICA: Fix truncation message calculation Myron Stowe
2009-01-30 22:44 ` [PATCH 1/2] ACPICA: Fix table entry truncation calculation Myron Stowe
2009-01-30 22:44 ` [PATCH 2/2] ACPICA: 80 column adherence (no functional change) Myron Stowe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox