* [PATCH 00/21] ACPICA: 20131218 Release
@ 2014-01-08 5:43 Lv Zheng
2014-01-08 5:43 ` [PATCH 01/21] ACPICA: Debug output: Fix a couple of small output issues Lv Zheng
` (21 more replies)
0 siblings, 22 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
The 20131218 ACPICA kernel resident system updates are linuxized based on
the pm/linux-next branch.
The patch set has passed the following build/boot tests.
Build tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. i386 + allyes + CONFIG_ACPI=y
3. i386 + default + COFNIG_ACPI=n
4. i386 + allyes + CONFIG_ACPI=n
5. x86_64 + default + COFNIG_ACPI=y
6. x86_64 + allyes + CONFIG_ACPI=y
7. x86_64 + default + COFNIG_ACPI=n
8. x86_64 + allyes + CONFIG_ACPI=n
Boot tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. x86_64 + default + COFNIG_ACPI=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64
All drivers/acpi configurations
All platform drivers
All ACPI drivers
4 DRM drivers that implement ACPI opregion
All buses with ACPI bindings
All cpufreq configurations
All xen configurations
All ACPI tabln drivers
4. allyes: kernel configuration generated by allyesconfig.
Betty Dall (1):
ACPICA: Add helper macros to extract bus/segment numbers from HEST
table.
Bob Moore (14):
ACPICA: Debug output: Fix a couple of small output issues.
ACPICA: Disassembler: Improve pathname support for emitted External()
statements.
ACPICA: Add option to favor 32-bit FADT addresses.
ACPICA: Tables: Add full support for the DBG2 table.
ACPICA: Tables: Add full support for the PCCT table, update table
definition.
ACPICA: Improve exception handling for GPE block installation.
ACPICA: Update several debug statements - no functional change.
ACPICA: Enhance ACPI warning for memory/IO address conflicts.
ACPICA: Parser: Updates/fixes for debug output.
ACPICA: Conditionally define a local variable that is used for debug
only.
ACPICA: Add an error message if the Debugger fails initialization.
ACPICA: Update ACPI example code to make it an actual working
program.
ACPICA: Interpreter: Add additional debug info for an error case.
ACPICA: Update version to 20131218.
Lv Zheng (6):
ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
ACPICA: Linux Header: Remove unused OSL prototypes.
ACPICA: Back port and refine validation of the XSDT root table.
ACPICA: Cleanup the option of forcing the use of the RSDT.
ACPICA: AcpiSrc: Cleanup spaces after special macro invocations.
ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file
global.
arch/ia64/kernel/acpi.c | 1 -
arch/x86/kernel/acpi/boot.c | 3 +-
drivers/acpi/acpica/acdebug.h | 1 -
drivers/acpi/acpica/acevents.h | 9 +-
drivers/acpi/acpica/acglobal.h | 30 ++++
drivers/acpi/acpica/aclocal.h | 9 +-
drivers/acpi/acpica/dsfield.c | 2 +-
drivers/acpi/acpica/dsutils.c | 19 ++-
drivers/acpi/acpica/dswload.c | 4 +-
drivers/acpi/acpica/evgpeblk.c | 8 +-
drivers/acpi/acpica/evgpeutil.c | 24 +--
drivers/acpi/acpica/exresnte.c | 3 +-
drivers/acpi/acpica/nsxfeval.c | 23 +--
drivers/acpi/acpica/psopinfo.c | 51 +++++-
drivers/acpi/acpica/tbfadt.c | 335 +++++++++++++++++++++------------------
drivers/acpi/acpica/tbutils.c | 214 ++++++++++++++-----------
drivers/acpi/acpica/utaddress.c | 19 ++-
drivers/acpi/acpica/utalloc.c | 10 +-
drivers/acpi/acpica/utcache.c | 12 +-
drivers/acpi/acpica/utdebug.c | 4 +-
drivers/acpi/acpica/utglobal.c | 4 -
drivers/acpi/acpica/utxfinit.c | 12 +-
include/acpi/acpixf.h | 39 ++---
include/acpi/actbl.h | 3 +
include/acpi/actbl1.h | 10 +-
include/acpi/actbl2.h | 5 +
include/acpi/actbl3.h | 15 +-
include/acpi/actypes.h | 12 +-
include/acpi/platform/acenv.h | 20 ++-
include/acpi/platform/aclinux.h | 4 -
30 files changed, 538 insertions(+), 367 deletions(-)
--
1.7.10
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 01/21] ACPICA: Debug output: Fix a couple of small output issues.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 02/21] ACPICA: Disassembler: Improve pathname support for emitted External() statements Lv Zheng
` (20 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Linux kernel behaviour is not affected by this patch as Linux doesn't
use ACPICA object cache mechanism currently.
1) Fix utcache to use the proper return macros in order to maintain
the function nesting level.
2) Enable the function nesting level for all ACPI applications instead
of just acpiexec.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/utcache.c | 12 ++++++------
drivers/acpi/acpica/utdebug.c | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
index 366bfec..cacd2fd 100644
--- a/drivers/acpi/acpica/utcache.c
+++ b/drivers/acpi/acpica/utcache.c
@@ -248,12 +248,12 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
ACPI_FUNCTION_NAME(os_acquire_object);
if (!cache) {
- return (NULL);
+ return_PTR(NULL);
}
status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);
if (ACPI_FAILURE(status)) {
- return (NULL);
+ return_PTR(NULL);
}
ACPI_MEM_TRACKING(cache->requests++);
@@ -276,7 +276,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
if (ACPI_FAILURE(status)) {
- return (NULL);
+ return_PTR(NULL);
}
/* Clear (zero) the previously used Object */
@@ -299,15 +299,15 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
if (ACPI_FAILURE(status)) {
- return (NULL);
+ return_PTR(NULL);
}
object = ACPI_ALLOCATE_ZEROED(cache->object_size);
if (!object) {
- return (NULL);
+ return_PTR(NULL);
}
}
- return (object);
+ return_PTR(object);
}
#endif /* ACPI_USE_LOCAL_CACHE */
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 03ae8af..d971c86 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -194,9 +194,9 @@ acpi_debug_print(u32 requested_debug_level,
*/
acpi_os_printf("%9s-%04ld ", module_name, line_number);
-#ifdef ACPI_EXEC_APP
+#ifdef ACPI_APPLICATION
/*
- * For acpi_exec only, emit the thread ID and nesting level.
+ * For acpi_exec/iASL only, emit the thread ID and nesting level.
* Note: nesting level is really only useful during a single-thread
* execution. Otherwise, multiple threads will keep resetting the
* level.
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 02/21] ACPICA: Disassembler: Improve pathname support for emitted External() statements.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
2014-01-08 5:43 ` [PATCH 01/21] ACPICA: Debug output: Fix a couple of small output issues Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 03/21] ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change Lv Zheng
` (19 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Linux kernel behaviour is not affected as the structure changes and the
new invocations are only used by compiler and disassembler which are
not shipped in the kernel currently.
This change adds full pathname support for external names that have been
resolved internally by the inclusion of additional ACPI tables (via the
iASL -e option). Without this change, the disassembler can emit multiple
externals for the same object, or it become confused when the Scope()
operator is used on an external object.
Reported-by: Michael Tsirkin <mst@redhat.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/aclocal.h | 9 +++++----
drivers/acpi/acpica/dsfield.c | 2 +-
drivers/acpi/acpica/dswload.c | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 53ed1a8..d95ca54 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -1038,15 +1038,16 @@ struct acpi_external_list {
struct acpi_external_list *next;
u32 value;
u16 length;
+ u16 flags;
u8 type;
- u8 flags;
- u8 resolved;
- u8 emitted;
};
/* Values for Flags field above */
-#define ACPI_IPATH_ALLOCATED 0x01
+#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
+#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
+#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
+#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
struct acpi_external_file {
char *path;
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 2d4c073..e7a57c5 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -105,7 +105,7 @@ acpi_ds_create_external_region(acpi_status lookup_status,
* operation_region not found. Generate an External for it, and
* insert the name into the namespace.
*/
- acpi_dm_add_to_external_list(op, path, ACPI_TYPE_REGION, 0);
+ acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0);
status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
walk_state, node);
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 95e681a..2dbe109 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -181,8 +181,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
* Target of Scope() not found. Generate an External for it, and
* insert the name into the namespace.
*/
- acpi_dm_add_to_external_list(op, path, ACPI_TYPE_DEVICE,
- 0);
+ acpi_dm_add_op_to_external_list(op, path,
+ ACPI_TYPE_DEVICE, 0, 0);
status =
acpi_ns_lookup(walk_state->scope_info, path,
object_type, ACPI_IMODE_LOAD_PASS1,
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 03/21] ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
2014-01-08 5:43 ` [PATCH 01/21] ACPICA: Debug output: Fix a couple of small output issues Lv Zheng
2014-01-08 5:43 ` [PATCH 02/21] ACPICA: Disassembler: Improve pathname support for emitted External() statements Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 04/21] ACPICA: Linux Header: Remove unused OSL prototypes Lv Zheng
` (18 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This macro is no longer used by ACPICA and it is not public.
Also update comments related to the use of ACPI_ALLOCATE_BUFFER and
the use of acpi_os_free (kfree is equivalent and prefered in the
kernel) to free the buffer.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
drivers/acpi/acpica/nsxfeval.c | 23 +++++++++++++----------
drivers/acpi/acpica/utalloc.c | 10 +++++++---
include/acpi/actypes.h | 12 ++----------
3 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index e973e31..1f0c28b 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -84,7 +84,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
acpi_object_type return_type)
{
acpi_status status;
- u8 must_free = FALSE;
+ u8 free_buffer_on_error = FALSE;
ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed);
@@ -95,14 +95,13 @@ acpi_evaluate_object_typed(acpi_handle handle,
}
if (return_buffer->length == ACPI_ALLOCATE_BUFFER) {
- must_free = TRUE;
+ free_buffer_on_error = TRUE;
}
/* Evaluate the object */
- status =
- acpi_evaluate_object(handle, pathname, external_params,
- return_buffer);
+ status = acpi_evaluate_object(handle, pathname,
+ external_params, return_buffer);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -135,11 +134,15 @@ acpi_evaluate_object_typed(acpi_handle handle,
pointer)->type),
acpi_ut_get_type_name(return_type)));
- if (must_free) {
-
- /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
-
- ACPI_FREE_BUFFER(*return_buffer);
+ if (free_buffer_on_error) {
+ /*
+ * Free a buffer created via ACPI_ALLOCATE_BUFFER.
+ * Note: We use acpi_os_free here because acpi_os_allocate was used
+ * to allocate the buffer. This purposefully bypasses the
+ * (optionally enabled) allocation tracking mechanism since we
+ * only want to track internal allocations.
+ */
+ acpi_os_free(return_buffer->pointer);
return_buffer->pointer = NULL;
}
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c
index 814267f..1851762 100644
--- a/drivers/acpi/acpica/utalloc.c
+++ b/drivers/acpi/acpica/utalloc.c
@@ -302,9 +302,13 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
return (AE_BUFFER_OVERFLOW);
case ACPI_ALLOCATE_BUFFER:
-
- /* Allocate a new buffer */
-
+ /*
+ * Allocate a new buffer. We directectly call acpi_os_allocate here to
+ * purposefully bypass the (optionally enabled) internal allocation
+ * tracking mechanism since we only want to track internal
+ * allocations. Note: The caller should use acpi_os_free to free this
+ * buffer created via ACPI_ALLOCATE_BUFFER.
+ */
buffer->pointer = acpi_os_allocate(required_length);
break;
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 809b1a0..68a3ada 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -928,8 +928,8 @@ struct acpi_object_list {
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
-#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1)
-#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2)
+#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) /* Let ACPICA allocate buffer */
+#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) /* For internal use only (enables tracking) */
struct acpi_buffer {
acpi_size length; /* Length in bytes of the buffer */
@@ -937,14 +937,6 @@ struct acpi_buffer {
};
/*
- * Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_BUFFER.
- * Note: We use acpi_os_free here because acpi_os_allocate was used to allocate
- * the buffer. This purposefully bypasses the internal allocation tracking
- * mechanism (if it is enabled).
- */
-#define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer)
-
-/*
* name_type for acpi_get_name
*/
#define ACPI_FULL_PATHNAME 0
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 04/21] ACPICA: Linux Header: Remove unused OSL prototypes.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (2 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 03/21] ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 05/21] ACPICA: Back port and refine validation of the XSDT root table Lv Zheng
` (17 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This patch removes 2 useless OSL prototypes as they are not used by Linux now.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
include/acpi/platform/aclinux.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 28f4f4d..008aa28 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -239,10 +239,6 @@ void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
*/
void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size);
-void acpi_os_gpe_count(u32 gpe_number);
-
-void acpi_os_fixed_event_count(u32 fixed_event_number);
-
#endif /* __KERNEL__ */
#endif /* __ACLINUX_H__ */
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 05/21] ACPICA: Back port and refine validation of the XSDT root table.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (3 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 04/21] ACPICA: Linux Header: Remove unused OSL prototypes Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 06/21] ACPICA: Cleanup the option of forcing the use of the RSDT Lv Zheng
` (16 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This feature is already in the Linux kernel. When it is back ported to
ACPICA, code is refined to follow ACPICA coding style and this patch
is the generation of the integration.
Some platforms contain an XSDT that is ill-formed or otherwise invalid
(such as containing some or all entries that are NULL pointers).
This change adds a new function to validate the XSDT before actually
using it. If the XSDT is found to be invalid, ACPICA will now fall
back to using the RSDT instead.
Original-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
drivers/acpi/acpica/tbutils.c | 210 +++++++++++++++++++++++------------------
include/acpi/actbl.h | 3 +
2 files changed, 123 insertions(+), 90 deletions(-)
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 3d6bb83..ee60670 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -49,69 +49,11 @@
ACPI_MODULE_NAME("tbutils")
/* Local prototypes */
+static acpi_status acpi_tb_validate_xsdt(acpi_physical_address address);
+
static acpi_physical_address
acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size);
-/*******************************************************************************
- *
- * FUNCTION: acpi_tb_check_xsdt
- *
- * PARAMETERS: address - Pointer to the XSDT
- *
- * RETURN: status
- * AE_OK - XSDT is okay
- * AE_NO_MEMORY - can't map XSDT
- * AE_INVALID_TABLE_LENGTH - invalid table length
- * AE_NULL_ENTRY - XSDT has NULL entry
- *
- * DESCRIPTION: validate XSDT
-******************************************************************************/
-
-static acpi_status
-acpi_tb_check_xsdt(acpi_physical_address address)
-{
- struct acpi_table_header *table;
- u32 length;
- u64 xsdt_entry_address;
- u8 *table_entry;
- u32 table_count;
- int i;
-
- table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
- if (!table)
- return AE_NO_MEMORY;
-
- length = table->length;
- acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
- if (length < sizeof(struct acpi_table_header))
- return AE_INVALID_TABLE_LENGTH;
-
- table = acpi_os_map_memory(address, length);
- if (!table)
- return AE_NO_MEMORY;
-
- /* Calculate the number of tables described in XSDT */
- table_count =
- (u32) ((table->length -
- sizeof(struct acpi_table_header)) / sizeof(u64));
- table_entry =
- ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header);
- for (i = 0; i < table_count; i++) {
- ACPI_MOVE_64_TO_64(&xsdt_entry_address, table_entry);
- if (!xsdt_entry_address) {
- /* XSDT has NULL entry */
- break;
- }
- table_entry += sizeof(u64);
- }
- acpi_os_unmap_memory(table, length);
-
- if (i < table_count)
- return AE_NULL_ENTRY;
- else
- return AE_OK;
-}
-
#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
@@ -383,7 +325,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
* Get the table physical address (32-bit for RSDT, 64-bit for XSDT):
* Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT
*/
- if (table_entry_size == sizeof(u32)) {
+ if (table_entry_size == ACPI_RSDT_ENTRY_SIZE) {
/*
* 32-bit platform, RSDT: Return 32-bit table entry
* 64-bit platform, RSDT: Expand 32-bit to 64-bit and return
@@ -415,6 +357,87 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
/*******************************************************************************
*
+ * FUNCTION: acpi_tb_validate_xsdt
+ *
+ * PARAMETERS: address - Physical address of the XSDT (from RSDP)
+ *
+ * RETURN: Status. AE_OK if the table appears to be valid.
+ *
+ * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
+ * not contain any NULL entries. A problem that is seen in the
+ * field is that the XSDT exists, but is actually useless because
+ * of one or more (or all) NULL entries.
+ *
+ ******************************************************************************/
+
+static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address)
+{
+ struct acpi_table_header *table;
+ u8 *next_entry;
+ acpi_physical_address address;
+ u32 length;
+ u32 entry_count;
+ acpi_status status;
+ u32 i;
+
+ /* Get the XSDT length */
+
+ table =
+ acpi_os_map_memory(xsdt_address, sizeof(struct acpi_table_header));
+ if (!table) {
+ return (AE_NO_MEMORY);
+ }
+
+ length = table->length;
+ acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
+
+ /*
+ * Minimum XSDT length is the size of the standard ACPI header
+ * plus one physical address entry
+ */
+ if (length < (sizeof(struct acpi_table_header) + ACPI_XSDT_ENTRY_SIZE)) {
+ return (AE_INVALID_TABLE_LENGTH);
+ }
+
+ /* Map the entire XSDT */
+
+ table = acpi_os_map_memory(xsdt_address, length);
+ if (!table) {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Get the number of entries and pointer to first entry */
+
+ status = AE_OK;
+ next_entry = ACPI_ADD_PTR(u8, table, sizeof(struct acpi_table_header));
+ entry_count = (u32)((table->length - sizeof(struct acpi_table_header)) /
+ ACPI_XSDT_ENTRY_SIZE);
+
+ /* Validate each entry (physical address) within the XSDT */
+
+ for (i = 0; i < entry_count; i++) {
+ address =
+ acpi_tb_get_root_table_entry(next_entry,
+ ACPI_XSDT_ENTRY_SIZE);
+ if (!address) {
+
+ /* Detected a NULL entry, XSDT is invalid */
+
+ status = AE_NULL_ENTRY;
+ break;
+ }
+
+ next_entry += ACPI_XSDT_ENTRY_SIZE;
+ }
+
+ /* Unmap table */
+
+ acpi_os_unmap_memory(table, length);
+ return (status);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_tb_parse_root_table
*
* PARAMETERS: rsdp - Pointer to the RSDP
@@ -438,16 +461,14 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
u32 table_count;
struct acpi_table_header *table;
acpi_physical_address address;
- acpi_physical_address uninitialized_var(rsdt_address);
u32 length;
u8 *table_entry;
acpi_status status;
ACPI_FUNCTION_TRACE(tb_parse_root_table);
- /*
- * Map the entire RSDP and extract the address of the RSDT or XSDT
- */
+ /* Map the entire RSDP and extract the address of the RSDT or XSDT */
+
rsdp = acpi_os_map_memory(rsdp_address, sizeof(struct acpi_table_rsdp));
if (!rsdp) {
return_ACPI_STATUS(AE_NO_MEMORY);
@@ -459,22 +480,20 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
/* Differentiate between RSDT and XSDT root tables */
- if (rsdp->revision > 1 && rsdp->xsdt_physical_address
+ 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.
+ * RSDP contains 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);
- rsdt_address = (acpi_physical_address)
- rsdp->rsdt_physical_address;
+ table_entry_size = ACPI_XSDT_ENTRY_SIZE;
} else {
/* Root table is an RSDT (32-bit physical addresses) */
address = (acpi_physical_address) rsdp->rsdt_physical_address;
- table_entry_size = sizeof(u32);
+ table_entry_size = ACPI_RSDT_ENTRY_SIZE;
}
/*
@@ -483,15 +502,25 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
*/
acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
- if (table_entry_size == sizeof(u64)) {
- if (acpi_tb_check_xsdt(address) == AE_NULL_ENTRY) {
- /* XSDT has NULL entry, RSDT is used */
- address = rsdt_address;
- table_entry_size = sizeof(u32);
- ACPI_WARNING((AE_INFO, "BIOS XSDT has NULL entry, "
- "using RSDT"));
+ /*
+ * If it is present, validate the XSDT for access/size and ensure
+ * that all table entries are at least non-NULL
+ */
+ if (table_entry_size == ACPI_XSDT_ENTRY_SIZE) {
+ status = acpi_tb_validate_xsdt(address);
+ if (ACPI_FAILURE(status)) {
+ ACPI_BIOS_WARNING((AE_INFO,
+ "XSDT is invalid (%s), using RSDT",
+ acpi_format_exception(status)));
+
+ /* Fall back to the RSDT */
+
+ address =
+ (acpi_physical_address) rsdp->rsdt_physical_address;
+ table_entry_size = ACPI_RSDT_ENTRY_SIZE;
}
}
+
/* Map the RSDT/XSDT table header to get the full table length */
table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
@@ -501,12 +530,14 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
acpi_tb_print_table_header(address, table);
- /* Get the length of the full table, verify length and map entire table */
-
+ /*
+ * Validate length of the table, and map entire table.
+ * Minimum length table must contain at least one entry.
+ */
length = table->length;
acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
- if (length < sizeof(struct acpi_table_header)) {
+ if (length < (sizeof(struct acpi_table_header) + table_entry_size)) {
ACPI_BIOS_ERROR((AE_INFO,
"Invalid table length 0x%X in RSDT/XSDT",
length));
@@ -526,22 +557,21 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
return_ACPI_STATUS(status);
}
- /* Calculate the number of tables described in the root table */
+ /* Get the number of entries and pointer to first entry */
table_count = (u32)((table->length - sizeof(struct acpi_table_header)) /
table_entry_size);
+ table_entry = ACPI_ADD_PTR(u8, table, sizeof(struct acpi_table_header));
+
/*
* 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);
acpi_gbl_root_table_list.current_table_count = 2;
- /*
- * Initialize the root table array from the RSDT/XSDT
- */
+ /* Initialize the root table array from the RSDT/XSDT */
+
for (i = 0; i < table_count; i++) {
if (acpi_gbl_root_table_list.current_table_count >=
acpi_gbl_root_table_list.max_table_count) {
@@ -584,7 +614,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
acpi_tb_install_table(acpi_gbl_root_table_list.tables[i].
address, NULL, i);
- /* Special case for FADT - get the DSDT and FACS */
+ /* Special case for FADT - validate it then get the DSDT and FACS */
if (ACPI_COMPARE_NAME
(&acpi_gbl_root_table_list.tables[i].signature,
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 9497088..325aeae 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -182,6 +182,9 @@ struct acpi_table_xsdt {
u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
};
+#define ACPI_RSDT_ENTRY_SIZE (sizeof (u32))
+#define ACPI_XSDT_ENTRY_SIZE (sizeof (u64))
+
/*******************************************************************************
*
* FACS - Firmware ACPI Control Structure (FACS)
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 06/21] ACPICA: Cleanup the option of forcing the use of the RSDT.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (4 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 05/21] ACPICA: Back port and refine validation of the XSDT root table Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 07/21] ACPICA: Add option to favor 32-bit FADT addresses Lv Zheng
` (15 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This option is already in the Linux kernel. When it is back ported to
ACPICA, code is re-written to follow ACPICA coding style. This patch
is the generation of the integration.
This change adds a runtime option that will force ACPICA to use the
RSDT instead of the XSDT. Although the ACPI spec requires that an XSDT
be used instead of the RSDT, the XSDT has been found to be corrupt or
ill-formed on some machines.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
arch/ia64/kernel/acpi.c | 1 -
arch/x86/kernel/acpi/boot.c | 3 +--
drivers/acpi/acpica/acglobal.h | 8 ++++++++
drivers/acpi/acpica/tbutils.c | 10 +++++-----
include/acpi/acpixf.h | 16 ++++++++--------
5 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 59d52e3..28dc6ba 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -61,7 +61,6 @@
#define PREFIX "ACPI: "
-u32 acpi_rsdt_forced;
unsigned int acpi_cpei_override;
unsigned int acpi_cpei_phys_cpuid;
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 6c0b43b..0b0b91b 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -46,7 +46,6 @@
#include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
static int __initdata acpi_force = 0;
-u32 acpi_rsdt_forced;
int acpi_disabled;
EXPORT_SYMBOL(acpi_disabled);
@@ -1564,7 +1563,7 @@ static int __init parse_acpi(char *arg)
}
/* acpi=rsdt use RSDT instead of XSDT */
else if (strcmp(arg, "rsdt") == 0) {
- acpi_rsdt_forced = 1;
+ acpi_gbl_do_not_use_xsdt = TRUE;
}
/* "acpi=noirq" disables ACPI interrupt routing */
else if (strcmp(arg, "noirq") == 0) {
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index e9f1fc7..cffb457 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -119,6 +119,14 @@ bool ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE);
/*
+ * Optionally ignore an XSDT if present and use the RSDT instead.
+ * Although the ACPI specification requires that an XSDT be used instead
+ * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
+ * some machines. Default behavior is to use the XSDT if present.
+ */
+u8 ACPI_INIT_GLOBAL(acpi_gbl_do_not_use_xsdt, FALSE);
+
+/*
* Optionally truncate I/O addresses to 16 bits. Provides compatibility
* with other ACPI implementations. NOTE: During ACPICA initialization,
* this value is set to TRUE if any Windows OSI strings have been
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index ee60670..6412d3c 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -478,10 +478,10 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
ACPI_CAST_PTR(struct acpi_table_header,
rsdp));
- /* Differentiate between RSDT and XSDT root tables */
+ /* Use XSDT if present and not overridden. Otherwise, use RSDT */
- if ((rsdp->revision > 1) && rsdp->xsdt_physical_address
- && !acpi_rsdt_forced) {
+ if ((rsdp->revision > 1) &&
+ rsdp->xsdt_physical_address && !acpi_gbl_do_not_use_xsdt) {
/*
* RSDP contains an XSDT (64-bit physical addresses). We must use
* the XSDT if the revision is > 1 and the XSDT pointer is present,
@@ -503,8 +503,8 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
/*
- * If it is present, validate the XSDT for access/size and ensure
- * that all table entries are at least non-NULL
+ * If it is present and used, validate the XSDT for access/size
+ * and ensure that all table entries are at least non-NULL
*/
if (table_entry_size == ACPI_XSDT_ENTRY_SIZE) {
status = acpi_tb_validate_xsdt(address);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 4278aba9..30b01f8 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -54,7 +54,6 @@
#include <acpi/acbuffer.h>
extern u8 acpi_gbl_permanent_mmap;
-extern u32 acpi_rsdt_forced;
/*
* Globals that are publically available
@@ -72,17 +71,18 @@ extern u32 acpi_dbg_layer;
/* ACPICA runtime options */
-extern u8 acpi_gbl_enable_interpreter_slack;
extern u8 acpi_gbl_all_methods_serialized;
-extern u8 acpi_gbl_create_osi_method;
-extern u8 acpi_gbl_use_default_register_widths;
-extern acpi_name acpi_gbl_trace_method_name;
-extern u32 acpi_gbl_trace_flags;
-extern bool acpi_gbl_enable_aml_debug_object;
extern u8 acpi_gbl_copy_dsdt_locally;
-extern u8 acpi_gbl_truncate_io_addresses;
+extern u8 acpi_gbl_create_osi_method;
extern u8 acpi_gbl_disable_auto_repair;
extern u8 acpi_gbl_disable_ssdt_table_load;
+extern u8 acpi_gbl_do_not_use_xsdt;
+extern bool acpi_gbl_enable_aml_debug_object;
+extern u8 acpi_gbl_enable_interpreter_slack;
+extern u32 acpi_gbl_trace_flags;
+extern acpi_name acpi_gbl_trace_method_name;
+extern u8 acpi_gbl_truncate_io_addresses;
+extern u8 acpi_gbl_use_default_register_widths;
/*
* Hardware-reduced prototypes. All interfaces that use these macros will
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 07/21] ACPICA: Add option to favor 32-bit FADT addresses.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (5 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 06/21] ACPICA: Cleanup the option of forcing the use of the RSDT Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 08/21] ACPICA: Tables: Add full support for the DBG2 table Lv Zheng
` (14 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
This change adds an option to favor 32-bit FADT addresses when there
is a conflict between the 32-bit and 64-bit versions of the same
address. The default behavior is to use the 64-bit version in accordance
with the ACPI specification. This can now be overridden via the
AcpiGbl_Use32BitFadtAddresses flag. Lv Zheng.
Also, the "Convert FADT" and "Verify FADT" functions have been merged to
simplify the code, make it easier to understand, and make it easier to
maintain. Bob Moore.
Buglink: https://bugs.acpica.org/show_bug.cgi?id=885
Buglink: https://bugs.acpica.org/show_bug.cgi?id=993
Original-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acglobal.h | 10 ++
drivers/acpi/acpica/tbfadt.c | 335 ++++++++++++++++++++++------------------
include/acpi/acpixf.h | 1 +
3 files changed, 194 insertions(+), 152 deletions(-)
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index cffb457..2686998 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -127,6 +127,16 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE);
u8 ACPI_INIT_GLOBAL(acpi_gbl_do_not_use_xsdt, FALSE);
/*
+ * Optionally use 32-bit FADT addresses if and when there is a conflict
+ * (address mismatch) between the 32-bit and 64-bit versions of the
+ * address. Although ACPICA adheres to the ACPI specification which
+ * requires the use of the corresponding 64-bit address if it is non-zero,
+ * some machines have been found to have a corrupted non-zero 64-bit
+ * address. Default is FALSE, do not favor the 32-bit addresses.
+ */
+u8 ACPI_INIT_GLOBAL(acpi_gbl_use32_bit_fadt_addresses, FALSE);
+
+/*
* Optionally truncate I/O addresses to 16 bits. Provides compatibility
* with other ACPI implementations. NOTE: During ACPICA initialization,
* this value is set to TRUE if any Windows OSI strings have been
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 9d99f21..8f89263 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -56,10 +56,11 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
static void acpi_tb_convert_fadt(void);
-static void acpi_tb_validate_fadt(void);
-
static void acpi_tb_setup_fadt_registers(void);
+static u64
+acpi_tb_select_address(char *register_name, u32 address32, u64 address64);
+
/* Table for conversion of FADT to common internal format and FADT validation */
typedef struct acpi_fadt_info {
@@ -175,6 +176,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
* space_id - ACPI Space ID for this register
* byte_width - Width of this register
* address - Address of the register
+ * register_name - ASCII name of the ACPI register
*
* RETURN: None
*
@@ -220,6 +222,68 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
/*******************************************************************************
*
+ * FUNCTION: acpi_tb_select_address
+ *
+ * PARAMETERS: register_name - ASCII name of the ACPI register
+ * address32 - 32-bit address of the register
+ * address64 - 64-bit address of the register
+ *
+ * RETURN: The resolved 64-bit address
+ *
+ * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within
+ * the FADT. Used for the FACS and DSDT addresses.
+ *
+ * NOTES:
+ *
+ * Check for FACS and DSDT address mismatches. An address mismatch between
+ * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
+ * DSDT/X_DSDT) could be a corrupted address field or it might indicate
+ * the presence of two FACS or two DSDT tables.
+ *
+ * November 2013:
+ * By default, as per the ACPICA specification, a valid 64-bit address is
+ * used regardless of the value of the 32-bit address. However, this
+ * behavior can be overridden via the acpi_gbl_use32_bit_fadt_addresses flag.
+ *
+ ******************************************************************************/
+
+static u64
+acpi_tb_select_address(char *register_name, u32 address32, u64 address64)
+{
+
+ if (!address64) {
+
+ /* 64-bit address is zero, use 32-bit address */
+
+ return ((u64)address32);
+ }
+
+ if (address32 && (address64 != (u64)address32)) {
+
+ /* Address mismatch between 32-bit and 64-bit versions */
+
+ ACPI_BIOS_WARNING((AE_INFO,
+ "32/64X %s address mismatch in FADT: "
+ "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
+ register_name, address32,
+ ACPI_FORMAT_UINT64(address64),
+ acpi_gbl_use32_bit_fadt_addresses ? 32 :
+ 64));
+
+ /* 32-bit address override */
+
+ if (acpi_gbl_use32_bit_fadt_addresses) {
+ return ((u64)address32);
+ }
+ }
+
+ /* Default is to use the 64-bit address */
+
+ return (address64);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_tb_parse_fadt
*
* PARAMETERS: table_index - Index for the FADT
@@ -331,10 +395,6 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
acpi_tb_convert_fadt();
- /* Validate FADT values now, before we make any changes */
-
- acpi_tb_validate_fadt();
-
/* Initialize the global ACPI register structures */
acpi_tb_setup_fadt_registers();
@@ -344,66 +404,55 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
*
* FUNCTION: acpi_tb_convert_fadt
*
- * PARAMETERS: None, uses acpi_gbl_FADT
+ * PARAMETERS: none - acpi_gbl_FADT is used.
*
* RETURN: None
*
* DESCRIPTION: Converts all versions of the FADT to a common internal format.
- * Expand 32-bit addresses to 64-bit as necessary.
+ * Expand 32-bit addresses to 64-bit as necessary. Also validate
+ * important fields within the FADT.
*
- * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt),
- * and must contain a copy of the actual FADT.
+ * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must
+ * contain a copy of the actual BIOS-provided FADT.
*
* Notes on 64-bit register addresses:
*
* After this FADT conversion, later ACPICA code will only use the 64-bit "X"
* fields of the FADT for all ACPI register addresses.
*
- * The 64-bit "X" fields are optional extensions to the original 32-bit FADT
+ * The 64-bit X fields are optional extensions to the original 32-bit FADT
* V1.0 fields. Even if they are present in the FADT, they are optional and
* are unused if the BIOS sets them to zero. Therefore, we must copy/expand
- * 32-bit V1.0 fields if the corresponding X field is zero.
+ * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is
+ * originally zero.
*
- * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the
- * corresponding "X" fields in the internal FADT.
+ * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address
+ * fields are expanded to the corresponding 64-bit X fields in the internal
+ * common FADT.
*
* For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded
- * to the corresponding 64-bit X fields. For compatibility with other ACPI
- * implementations, we ignore the 64-bit field if the 32-bit field is valid,
- * regardless of whether the host OS is 32-bit or 64-bit.
+ * to the corresponding 64-bit X fields, if the 64-bit field is originally
+ * zero. Adhering to the ACPI specification, we completely ignore the 32-bit
+ * field if the 64-bit field is valid, regardless of whether the host OS is
+ * 32-bit or 64-bit.
+ *
+ * Possible additional checks:
+ * (acpi_gbl_FADT.pm1_event_length >= 4)
+ * (acpi_gbl_FADT.pm1_control_length >= 2)
+ * (acpi_gbl_FADT.pm_timer_length >= 4)
+ * Gpe block lengths must be multiple of 2
*
******************************************************************************/
static void acpi_tb_convert_fadt(void)
{
+ char *name;
struct acpi_generic_address *address64;
u32 address32;
+ u8 length;
u32 i;
/*
- * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
- * Later code will always use the X 64-bit field. Also, check for an
- * address mismatch between the 32-bit and 64-bit address fields
- * (FIRMWARE_CTRL/X_FIRMWARE_CTRL, DSDT/X_DSDT) which would indicate
- * the presence of two FACS or two DSDT tables.
- */
- if (!acpi_gbl_FADT.Xfacs) {
- acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
- } else if (acpi_gbl_FADT.facs &&
- (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {
- ACPI_WARNING((AE_INFO,
- "32/64 FACS address mismatch in FADT - two FACS tables!"));
- }
-
- if (!acpi_gbl_FADT.Xdsdt) {
- acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
- } else if (acpi_gbl_FADT.dsdt &&
- (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {
- ACPI_WARNING((AE_INFO,
- "32/64 DSDT address mismatch in FADT - two DSDT tables!"));
- }
-
- /*
* For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields.
@@ -421,119 +470,24 @@ static void acpi_tb_convert_fadt(void)
acpi_gbl_FADT.boot_flags = 0;
}
- /* Update the local FADT table header length */
-
- acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
-
/*
- * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
- * generic address structures as necessary. Later code will always use
- * the 64-bit address structures.
- *
- * March 2009:
- * We now always use the 32-bit address if it is valid (non-null). This
- * is not in accordance with the ACPI specification which states that
- * the 64-bit address supersedes the 32-bit version, but we do this for
- * compatibility with other ACPI implementations. Most notably, in the
- * case where both the 32 and 64 versions are non-null, we use the 32-bit
- * version. This is the only address that is guaranteed to have been
- * tested by the BIOS manufacturer.
+ * Now we can update the local FADT length to the length of the
+ * current FADT version as defined by the ACPI specification.
+ * Thus, we will have a common FADT internally.
*/
- for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
- address32 = *ACPI_ADD_PTR(u32,
- &acpi_gbl_FADT,
- fadt_info_table[i].address32);
-
- address64 = ACPI_ADD_PTR(struct acpi_generic_address,
- &acpi_gbl_FADT,
- fadt_info_table[i].address64);
-
- /*
- * If both 32- and 64-bit addresses are valid (non-zero),
- * they must match.
- */
- if (address64->address && address32 &&
- (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) */
-
- if (address32) {
- /*
- * Copy the 32-bit address to the 64-bit GAS structure. The
- * Space ID is always I/O for 32-bit legacy address fields
- */
- acpi_tb_init_generic_address(address64,
- ACPI_ADR_SPACE_SYSTEM_IO,
- *ACPI_ADD_PTR(u8,
- &acpi_gbl_FADT,
- fadt_info_table
- [i].length),
- (u64) address32,
- fadt_info_table[i].name);
- }
- }
-}
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_tb_validate_fadt
- *
- * PARAMETERS: table - Pointer to the FADT to be validated
- *
- * RETURN: None
- *
- * DESCRIPTION: Validate various important fields within the FADT. If a problem
- * is found, issue a message, but no status is returned.
- * Used by both the table manager and the disassembler.
- *
- * Possible additional checks:
- * (acpi_gbl_FADT.pm1_event_length >= 4)
- * (acpi_gbl_FADT.pm1_control_length >= 2)
- * (acpi_gbl_FADT.pm_timer_length >= 4)
- * Gpe block lengths must be multiple of 2
- *
- ******************************************************************************/
-
-static void acpi_tb_validate_fadt(void)
-{
- char *name;
- struct acpi_generic_address *address64;
- u8 length;
- u32 i;
+ acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
/*
- * Check for FACS and DSDT address mismatches. An address mismatch between
- * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
- * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
+ * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
+ * Later ACPICA code will always use the X 64-bit field.
*/
- if (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_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.Xfacs = acpi_tb_select_address("FACS",
+ acpi_gbl_FADT.facs,
+ acpi_gbl_FADT.Xfacs);
- acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt;
- }
+ acpi_gbl_FADT.Xdsdt = acpi_tb_select_address("DSDT",
+ acpi_gbl_FADT.dsdt,
+ acpi_gbl_FADT.Xdsdt);
/* If Hardware Reduced flag is set, we are all done */
@@ -545,18 +499,95 @@ static void acpi_tb_validate_fadt(void)
for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
/*
- * Generate pointer to the 64-bit address, get the register
- * length (width) and the register name
+ * Get the 32-bit and 64-bit addresses, as well as the register
+ * length and register name.
*/
+ address32 = *ACPI_ADD_PTR(u32,
+ &acpi_gbl_FADT,
+ fadt_info_table[i].address32);
+
address64 = ACPI_ADD_PTR(struct acpi_generic_address,
&acpi_gbl_FADT,
fadt_info_table[i].address64);
- length =
- *ACPI_ADD_PTR(u8, &acpi_gbl_FADT,
- fadt_info_table[i].length);
+
+ length = *ACPI_ADD_PTR(u8,
+ &acpi_gbl_FADT,
+ fadt_info_table[i].length);
+
name = fadt_info_table[i].name;
/*
+ * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
+ * generic address structures as necessary. Later code will always use
+ * the 64-bit address structures.
+ *
+ * November 2013:
+ * Now always use the 64-bit address if it is valid (non-zero), in
+ * accordance with the ACPI specification which states that a 64-bit
+ * address supersedes the 32-bit version. This behavior can be
+ * overridden by the acpi_gbl_use32_bit_fadt_addresses flag.
+ *
+ * During 64-bit address construction and verification,
+ * these cases are handled:
+ *
+ * Address32 zero, Address64 [don't care] - Use Address64
+ *
+ * Address32 non-zero, Address64 zero - Copy/use Address32
+ * Address32 non-zero == Address64 non-zero - Use Address64
+ * Address32 non-zero != Address64 non-zero - Warning, use Address64
+ *
+ * Override: if acpi_gbl_use32_bit_fadt_addresses is TRUE, and:
+ * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32
+ *
+ * Note: space_id is always I/O for 32-bit legacy address fields
+ */
+ if (address32) {
+ if (!address64->address) {
+
+ /* 64-bit address is zero, use 32-bit address */
+
+ acpi_tb_init_generic_address(address64,
+ ACPI_ADR_SPACE_SYSTEM_IO,
+ *ACPI_ADD_PTR(u8,
+ &acpi_gbl_FADT,
+ fadt_info_table
+ [i].
+ length),
+ (u64)address32,
+ name);
+ } else if (address64->address != (u64)address32) {
+
+ /* Address mismatch */
+
+ ACPI_BIOS_WARNING((AE_INFO,
+ "32/64X address mismatch in FADT/%s: "
+ "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
+ name, address32,
+ ACPI_FORMAT_UINT64
+ (address64->address),
+ acpi_gbl_use32_bit_fadt_addresses
+ ? 32 : 64));
+
+ if (acpi_gbl_use32_bit_fadt_addresses) {
+
+ /* 32-bit address override */
+
+ acpi_tb_init_generic_address(address64,
+ ACPI_ADR_SPACE_SYSTEM_IO,
+ *ACPI_ADD_PTR
+ (u8,
+ &acpi_gbl_FADT,
+ fadt_info_table
+ [i].
+ length),
+ (u64)
+ address32,
+ name);
+ }
+ }
+ }
+
+ /*
* For each extended field, check for length mismatch between the
* legacy length field and the corresponding 64-bit X length field.
* Note: If the legacy length field is > 0xFF bits, ignore this
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 30b01f8..01ba80b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -82,6 +82,7 @@ extern u8 acpi_gbl_enable_interpreter_slack;
extern u32 acpi_gbl_trace_flags;
extern acpi_name acpi_gbl_trace_method_name;
extern u8 acpi_gbl_truncate_io_addresses;
+extern u8 acpi_gbl_use32_bit_fadt_addresses;
extern u8 acpi_gbl_use_default_register_widths;
/*
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 08/21] ACPICA: Tables: Add full support for the DBG2 table.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (6 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 07/21] ACPICA: Add option to favor 32-bit FADT addresses Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:43 ` [PATCH 09/21] ACPICA: Tables: Add full support for the PCCT table, update table definition Lv Zheng
` (13 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Updates the DBG2 (Debug Port 2) table definition in the actbl2.h header.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/actbl2.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 40f7ed1..094a906 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -327,6 +327,11 @@ struct acpi_table_dbg2 {
u32 info_count;
};
+struct acpi_dbg2_header {
+ u32 info_offset;
+ u32 info_count;
+};
+
/* Debug Device Information Subtable */
struct acpi_dbg2_device {
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 09/21] ACPICA: Tables: Add full support for the PCCT table, update table definition.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (7 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 08/21] ACPICA: Tables: Add full support for the DBG2 table Lv Zheng
@ 2014-01-08 5:43 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 10/21] ACPICA: Add helper macros to extract bus/segment numbers from HEST table Lv Zheng
` (12 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Updates the PCCT table definition in the actbl3.h header.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/actbl3.h | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index e2c0931..01c2a90 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -374,16 +374,22 @@ struct acpi_mpst_shared {
struct acpi_table_pcct {
struct acpi_table_header header; /* Common ACPI table header */
u32 flags;
- u32 latency;
- u32 reserved;
+ u64 reserved;
};
/* Values for Flags field above */
#define ACPI_PCCT_DOORBELL 1
+/* Values for subtable type in struct acpi_subtable_header */
+
+enum acpi_pcct_type {
+ ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
+ ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */
+};
+
/*
- * PCCT subtables
+ * PCCT Subtables, correspond to Type in struct acpi_subtable_header
*/
/* 0: Generic Communications Subspace */
@@ -396,6 +402,9 @@ struct acpi_pcct_subspace {
struct acpi_generic_address doorbell_register;
u64 preserve_mask;
u64 write_mask;
+ u32 latency;
+ u32 max_access_rate;
+ u16 min_turnaround_time;
};
/*
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 10/21] ACPICA: Add helper macros to extract bus/segment numbers from HEST table.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (8 preceding siblings ...)
2014-01-08 5:43 ` [PATCH 09/21] ACPICA: Tables: Add full support for the PCCT table, update table definition Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 11/21] ACPICA: Improve exception handling for GPE block installation Lv Zheng
` (11 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown
Cc: Lv Zheng, Lv Zheng, linux-acpi, Betty Dall
From: Betty Dall <betty.dall@hp.com>
This change adds two macros to extract the encoded bus and segment
numbers from the HEST Bus field.
Signed-off-by: Betty Dall <betty.dall@hp.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/actbl1.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 556c83ee..4ec8c19 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -457,7 +457,7 @@ struct acpi_hest_aer_common {
u8 enabled;
u32 records_to_preallocate;
u32 max_sections_per_record;
- u32 bus;
+ u32 bus; /* Bus and Segment numbers */
u16 device;
u16 function;
u16 device_control;
@@ -473,6 +473,14 @@ struct acpi_hest_aer_common {
#define ACPI_HEST_FIRMWARE_FIRST (1)
#define ACPI_HEST_GLOBAL (1<<1)
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ * Bus number is encoded in bits 7:0
+ * Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
+
/* Hardware Error Notification */
struct acpi_hest_notify {
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 11/21] ACPICA: Improve exception handling for GPE block installation.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (9 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 10/21] ACPICA: Add helper macros to extract bus/segment numbers from HEST table Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 12/21] ACPICA: Update several debug statements - no functional change Lv Zheng
` (10 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
1) Return an actual status value from acpi_ev_get_gpe_xrupt_block.
2) Don't clobber the status when exiting acpi_ev_install_gpe_block.
Buglink: https://bugs.acpica.org/show_bug.cgi?id=1019
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acevents.h | 4 +++-
drivers/acpi/acpica/evgpeblk.c | 8 ++++----
drivers/acpi/acpica/evgpeutil.c | 24 +++++++++++++++---------
3 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index 41abe55..0738305 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -149,7 +149,9 @@ acpi_status
acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block, void *context);
-struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number);
+acpi_status
+acpi_ev_get_gpe_xrupt_block(u32 interrupt_number,
+ struct acpi_gpe_xrupt_info **gpe_xrupt_block);
acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt);
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index a9e76bc..a31e549 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -87,9 +87,9 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
return_ACPI_STATUS(status);
}
- gpe_xrupt_block = acpi_ev_get_gpe_xrupt_block(interrupt_number);
- if (!gpe_xrupt_block) {
- status = AE_NO_MEMORY;
+ status =
+ acpi_ev_get_gpe_xrupt_block(interrupt_number, &gpe_xrupt_block);
+ if (ACPI_FAILURE(status)) {
goto unlock_and_exit;
}
@@ -112,7 +112,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
unlock_and_exit:
- status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+ (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
return_ACPI_STATUS(status);
}
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index d3f5e1e..4d764e8 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -197,8 +197,9 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
* FUNCTION: acpi_ev_get_gpe_xrupt_block
*
* PARAMETERS: interrupt_number - Interrupt for a GPE block
+ * gpe_xrupt_block - Where the block is returned
*
- * RETURN: A GPE interrupt block
+ * RETURN: Status
*
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
* block per unique interrupt level used for GPEs. Should be
@@ -207,7 +208,9 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
*
******************************************************************************/
-struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
+acpi_status
+acpi_ev_get_gpe_xrupt_block(u32 interrupt_number,
+ struct acpi_gpe_xrupt_info ** gpe_xrupt_block)
{
struct acpi_gpe_xrupt_info *next_gpe_xrupt;
struct acpi_gpe_xrupt_info *gpe_xrupt;
@@ -221,7 +224,8 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
while (next_gpe_xrupt) {
if (next_gpe_xrupt->interrupt_number == interrupt_number) {
- return_PTR(next_gpe_xrupt);
+ *gpe_xrupt_block = next_gpe_xrupt;
+ return_ACPI_STATUS(AE_OK);
}
next_gpe_xrupt = next_gpe_xrupt->next;
@@ -231,7 +235,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
if (!gpe_xrupt) {
- return_PTR(NULL);
+ return_ACPI_STATUS(AE_NO_MEMORY);
}
gpe_xrupt->interrupt_number = interrupt_number;
@@ -250,6 +254,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
} else {
acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
}
+
acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
/* Install new interrupt handler if not SCI_INT */
@@ -259,14 +264,15 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
acpi_ev_gpe_xrupt_handler,
gpe_xrupt);
if (ACPI_FAILURE(status)) {
- ACPI_ERROR((AE_INFO,
- "Could not install GPE interrupt handler at level 0x%X",
- interrupt_number));
- return_PTR(NULL);
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Could not install GPE interrupt handler at level 0x%X",
+ interrupt_number));
+ return_ACPI_STATUS(status);
}
}
- return_PTR(gpe_xrupt);
+ *gpe_xrupt_block = gpe_xrupt;
+ return_ACPI_STATUS(AE_OK);
}
/*******************************************************************************
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 12/21] ACPICA: Update several debug statements - no functional change.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (10 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 11/21] ACPICA: Improve exception handling for GPE block installation Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 13/21] ACPICA: Enhance ACPI warning for memory/IO address conflicts Lv Zheng
` (9 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Update the format and information emitted from several
debug output statements.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/dsutils.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index ade44e4..d7f53fb 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -727,27 +727,26 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
index++;
}
- index--;
+ ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
+ "NumOperands %d, ArgCount %d, Index %d\n",
+ walk_state->num_operands, arg_count, index));
- /* It is the appropriate order to get objects from the Result stack */
+ /* Create the interpreter arguments, in reverse order */
+ index--;
for (i = 0; i < arg_count; i++) {
arg = arguments[index];
-
- /* Force the filling of the operand stack in inverse order */
-
- walk_state->operand_index = (u8) index;
+ walk_state->operand_index = (u8)index;
status = acpi_ds_create_operand(walk_state, arg, index);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
- index--;
-
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
- "Arg #%u (%p) done, Arg1=%p\n", index, arg,
- first_arg));
+ "Created Arg #%u (%p) %u args total\n",
+ index, arg, arg_count));
+ index--;
}
return_ACPI_STATUS(status);
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 13/21] ACPICA: Enhance ACPI warning for memory/IO address conflicts.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (11 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 12/21] ACPICA: Update several debug statements - no functional change Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 14/21] ACPICA: Parser: Updates/fixes for debug output Lv Zheng
` (8 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
This change improves the warning message when a system address
conflicts with an existing operation region. It now emits the region
address range in addition to the input (system) address range.
Reported-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/utaddress.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
index e0a2e27..2c2b6ae 100644
--- a/drivers/acpi/acpica/utaddress.c
+++ b/drivers/acpi/acpica/utaddress.c
@@ -224,10 +224,11 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
while (range_info) {
/*
- * Check if the requested Address/Length overlaps this address_range.
- * Four cases to consider:
+ * Check if the requested address/length overlaps this
+ * address range. There are four cases to consider:
*
- * 1) Input address/length is contained completely in the address range
+ * 1) Input address/length is contained completely in the
+ * address range
* 2) Input address/length overlaps range at the range start
* 3) Input address/length overlaps range at the range end
* 4) Input address/length completely encompasses the range
@@ -244,11 +245,17 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
region_node);
ACPI_WARNING((AE_INFO,
- "0x%p-0x%p %s conflicts with Region %s %d",
+ "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)",
+ acpi_ut_get_region_name(space_id),
ACPI_CAST_PTR(void, address),
ACPI_CAST_PTR(void, end_address),
- acpi_ut_get_region_name(space_id),
- pathname, overlap_count));
+ ACPI_CAST_PTR(void,
+ range_info->
+ start_address),
+ ACPI_CAST_PTR(void,
+ range_info->
+ end_address),
+ pathname));
ACPI_FREE(pathname);
}
}
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 14/21] ACPICA: Parser: Updates/fixes for debug output.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (12 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 13/21] ACPICA: Enhance ACPI warning for memory/IO address conflicts Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 15/21] ACPICA: Conditionally define a local variable that is used for debug only Lv Zheng
` (7 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Linux kernel behaviour is not affected as the change only applies to
the compiler which is not shipped in the Linux kernel.
Major changes in this patch are made to improve the debug output mode of
the compiler.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/psopinfo.c | 49 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index 9ba5301..d7bba3c 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -71,6 +71,8 @@ static const u8 acpi_gbl_argument_count[] =
const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
{
+ const char *opcode_name = "Unknown AML opcode";
+
ACPI_FUNCTION_NAME(ps_get_opcode_info);
/*
@@ -92,11 +94,54 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
return (&acpi_gbl_aml_op_info
[acpi_gbl_long_op_index[(u8)opcode]]);
}
+#ifdef ACPI_ASL_COMPILER
+#include "asldefine.h"
+
+ switch (opcode) {
+ case AML_RAW_DATA_BYTE:
+ opcode_name = "-Raw Data Byte-";
+ break;
+
+ case AML_RAW_DATA_WORD:
+ opcode_name = "-Raw Data Word-";
+ break;
+
+ case AML_RAW_DATA_DWORD:
+ opcode_name = "-Raw Data Dword-";
+ break;
+
+ case AML_RAW_DATA_QWORD:
+ opcode_name = "-Raw Data Qword-";
+ break;
+
+ case AML_RAW_DATA_BUFFER:
+ opcode_name = "-Raw Data Buffer-";
+ break;
+
+ case AML_RAW_DATA_CHAIN:
+ opcode_name = "-Raw Data Buffer Chain-";
+ break;
+
+ case AML_PACKAGE_LENGTH:
+ opcode_name = "-Package Length-";
+ break;
+
+ case AML_UNASSIGNED_OPCODE:
+ opcode_name = "-Unassigned Opcode-";
+ break;
+
+ case AML_DEFAULT_ARG_OP:
+ opcode_name = "-Default Arg-";
+ break;
+
+ default:
+ break;
+ }
+#endif
/* Unknown AML opcode */
- ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
- "Unknown AML opcode [%4.4X]\n", opcode));
+ ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%4.4X]\n", opcode_name, opcode));
return (&acpi_gbl_aml_op_info[_UNK]);
}
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 15/21] ACPICA: Conditionally define a local variable that is used for debug only.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (13 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 14/21] ACPICA: Parser: Updates/fixes for debug output Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 16/21] ACPICA: Add an error message if the Debugger fails initialization Lv Zheng
` (6 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
This patch improves the relationship between the opcode debugging
information and CONFIG_ACPI_DEBUG enablement.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/psopinfo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index d7bba3c..b0c9787 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -71,7 +71,9 @@ static const u8 acpi_gbl_argument_count[] =
const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
{
+#ifdef ACPI_DEBUG_OUTPUT
const char *opcode_name = "Unknown AML opcode";
+#endif
ACPI_FUNCTION_NAME(ps_get_opcode_info);
@@ -94,7 +96,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
return (&acpi_gbl_aml_op_info
[acpi_gbl_long_op_index[(u8)opcode]]);
}
-#ifdef ACPI_ASL_COMPILER
+#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
#include "asldefine.h"
switch (opcode) {
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 16/21] ACPICA: Add an error message if the Debugger fails initialization.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (14 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 15/21] ACPICA: Conditionally define a local variable that is used for debug only Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 17/21] ACPICA: Update ACPI example code to make it an actual working program Lv Zheng
` (5 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Linux kernel behaviour is not affected as the changes only applies to the
debugger which is currently not shipped in the kernel.
Previously, only status was returned.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/utxfinit.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 75efea0..246ef68 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -122,8 +122,16 @@ acpi_status __init acpi_initialize_subsystem(void)
/* If configured, initialize the AML debugger */
- ACPI_DEBUGGER_EXEC(status = acpi_db_initialize());
- return_ACPI_STATUS(status);
+#ifdef ACPI_DEBUGGER
+ status = acpi_db_initialize();
+ if (ACPI_FAILURE(status)) {
+ ACPI_EXCEPTION((AE_INFO, status,
+ "During Debugger initialization"));
+ return_ACPI_STATUS(status);
+ }
+#endif
+
+ return_ACPI_STATUS(AE_OK);
}
ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_subsystem)
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 17/21] ACPICA: Update ACPI example code to make it an actual working program.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (15 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 16/21] ACPICA: Add an error message if the Debugger fails initialization Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 18/21] ACPICA: Interpreter: Add additional debug info for an error case Lv Zheng
` (4 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Linux kernel behaviour is not affected as the change only applies
to the ACPICA userspace utilities which are not shipped in the
kernel currently.
Previously, the example code (tools/examples) showed the ACPICA
init code, but was not an actual working program. Added ACPI tables
to make it actually function.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/platform/acenv.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 974d3ef..9c90313 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -96,13 +96,14 @@
#endif
/*
- * acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single
+ * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example configuration. All single
* threaded, with no debug output.
*/
-#if (defined ACPI_BIN_APP) || \
- (defined ACPI_DUMP_APP) || \
- (defined ACPI_SRC_APP) || \
- (defined ACPI_XTRACT_APP)
+#if (defined ACPI_BIN_APP) || \
+ (defined ACPI_DUMP_APP) || \
+ (defined ACPI_SRC_APP) || \
+ (defined ACPI_XTRACT_APP) || \
+ (defined ACPI_EXAMPLE_APP)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 18/21] ACPICA: Interpreter: Add additional debug info for an error case.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (16 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 17/21] ACPICA: Update ACPI example code to make it an actual working program Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:44 ` [PATCH 19/21] ACPICA: Linuxize: Cleanup spaces after special macro invocations Lv Zheng
` (3 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Emit the name of the namespace node for the error case when
there is no subobject attached to the node.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/exresnte.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c
index acd34f5..7ca6925 100644
--- a/drivers/acpi/acpica/exresnte.c
+++ b/drivers/acpi/acpica/exresnte.c
@@ -124,7 +124,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
}
if (!source_desc) {
- ACPI_ERROR((AE_INFO, "No object attached to node %p", node));
+ ACPI_ERROR((AE_INFO, "No object attached to node [%4.4s] %p",
+ node->name.ascii, node));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 19/21] ACPICA: Linuxize: Cleanup spaces after special macro invocations.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (17 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 18/21] ACPICA: Interpreter: Add additional debug info for an error case Lv Zheng
@ 2014-01-08 5:44 ` Lv Zheng
2014-01-08 5:45 ` [PATCH 20/21] ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global Lv Zheng
` (2 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This patch reflects the improvment of a cleanup step which is performed in
the release process.
There are still spaces in the linuxized ACPICA files after special macro
invocations. This is because indent treats comments and pre-processor
directives as spaces, thus we need to skip them.
Before applying this patch, cleanup code will search from keyword back to
end of line and wipe spaces between them.
After applying this patch, cleanup code will search to the end of the macro
invocations, skip "empty lines", "comments" and "pre-processor directives",
then wipe the spaces between the new line and the first non-spaces
characters.
Following improvements are thus achieved in the release automation by this
commit which are originally maintained manually:
- acpi_status acpi_ev_remove_global_lock_handler(void);
+acpi_status acpi_ev_remove_global_lock_handler(void);
- acpi_status
+acpi_status
acpi_ev_match_gpe_method(acpi_handle obj_handle,
- acpi_status acpi_subsystem_status(void);
+acpi_status acpi_subsystem_status(void);
- acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
+acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
- acpi_status
+acpi_status
acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout);
- acpi_status
+acpi_status
acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b);
- acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
+acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
Some empty lines are restored by this commit due to the change of the
removal implementation.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
drivers/acpi/acpica/acdebug.h | 1 -
drivers/acpi/acpica/acevents.h | 5 ++---
drivers/acpi/acpica/utglobal.c | 4 ----
include/acpi/acpixf.h | 20 +++-----------------
4 files changed, 5 insertions(+), 25 deletions(-)
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index a9fd0b8..2bf3ca2 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -113,7 +113,6 @@ void acpi_db_display_handlers(void);
ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_db_generate_gpe(char *gpe_arg,
char *block_arg))
-
ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))
/*
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index 0738305..0fb0adf 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -71,9 +71,8 @@ acpi_status acpi_ev_init_global_lock_handler(void);
ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
acpi_ev_acquire_global_lock(u16 timeout))
-
ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
- acpi_status acpi_ev_remove_global_lock_handler(void);
+acpi_status acpi_ev_remove_global_lock_handler(void);
/*
* evgpe - Low-level GPE support
@@ -133,7 +132,7 @@ acpi_status acpi_ev_gpe_initialize(void);
ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_ev_update_gpes(acpi_owner_id table_owner_id))
- acpi_status
+acpi_status
acpi_ev_match_gpe_method(acpi_handle obj_handle,
u32 level, void *context, void **return_value);
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 81f9a95..030cb0d 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -388,11 +388,7 @@ acpi_status acpi_ut_init_globals(void)
/* Public globals */
ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
-
ACPI_EXPORT_SYMBOL(acpi_dbg_level)
-
ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
-
ACPI_EXPORT_SYMBOL(acpi_gpe_count)
-
ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 01ba80b..cfe929b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -131,10 +131,9 @@ acpi_status __init acpi_terminate(void);
* Miscellaneous global interfaces
*/
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
#ifdef ACPI_FUTURE_USAGE
- acpi_status acpi_subsystem_status(void);
+acpi_status acpi_subsystem_status(void);
#endif
#ifdef ACPI_FUTURE_USAGE
@@ -279,16 +278,13 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_install_sci_handler(acpi_sci_handler
address,
void *context))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_remove_sci_handler(acpi_sci_handler
address))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_install_global_event_handler
(acpi_gbl_event_handler handler,
void *context))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_install_fixed_event_handler(u32
acpi_event,
@@ -296,12 +292,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
handler,
void
*context))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_remove_fixed_event_handler(u32 acpi_event,
acpi_event_handler
handler))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_install_gpe_handler(acpi_handle
gpe_device,
@@ -310,15 +304,14 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_gpe_handler
address,
void *context))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_remove_gpe_handler(acpi_handle gpe_device,
u32 gpe_number,
acpi_gpe_handler
address))
acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
- acpi_notify_handler handler,
- void *context);
+ acpi_notify_handler handler,
+ void *context);
acpi_status
acpi_remove_notify_handler(acpi_handle device,
@@ -367,7 +360,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_disable_event(u32 event, u32 flags))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
@@ -405,20 +397,16 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
parent_device,
acpi_handle gpe_device,
u32 gpe_number))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_set_gpe_wake_mask(acpi_handle gpe_device,
u32 gpe_number,
u8 action))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_get_gpe_status(acpi_handle gpe_device,
u32 gpe_number,
acpi_event_status
*event_status))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
@@ -432,7 +420,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
*gpe_block_address,
u32 register_count,
u32 interrupt_number))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_remove_gpe_block(acpi_handle gpe_device))
@@ -533,7 +520,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
#ifdef ACPI_FUTURE_USAGE
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
acpi_get_timer_resolution(u32 *resolution))
-
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 20/21] ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (18 preceding siblings ...)
2014-01-08 5:44 ` [PATCH 19/21] ACPICA: Linuxize: Cleanup spaces after special macro invocations Lv Zheng
@ 2014-01-08 5:45 ` Lv Zheng
2014-01-08 5:45 ` [PATCH 21/21] ACPICA: Update version to 20131218 Lv Zheng
2014-01-08 14:52 ` [PATCH 00/21] ACPICA: 20131218 Release Rafael J. Wysocki
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:45 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
Linux kernel behaviour is not affected as the changes only applies to the
ACPICA userspace utilities which are not shipped in the kernel currently.
This global is acting as an OSL global variable, implemented in the
oswinxf.c and osunixxf.c.
This patch cleans up the definition of this variable so that new utilities
do not need to define it in order to link.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
drivers/acpi/acpica/acglobal.h | 12 ++++++++++++
include/acpi/platform/acenv.h | 9 +++++++++
2 files changed, 21 insertions(+)
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 2686998..24db8e1 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -502,6 +502,18 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
/*****************************************************************************
*
+ * Application globals
+ *
+ ****************************************************************************/
+
+#ifdef ACPI_APPLICATION
+
+ACPI_FILE ACPI_INIT_GLOBAL(acpi_gbl_debug_file, NULL);
+
+#endif /* ACPI_APPLICATION */
+
+/*****************************************************************************
+ *
* Info/help support
*
****************************************************************************/
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 9c90313..b402eb6 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -395,4 +395,13 @@ typedef char *va_list;
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
+#ifndef ACPI_FILE
+#ifdef ACPI_APPLICATION
+#include <stdio.h>
+#define ACPI_FILE FILE *
+#else
+#define ACPI_FILE void *
+#endif /* ACPI_APPLICATION */
+#endif /* ACPI_FILE */
+
#endif /* __ACENV_H__ */
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 21/21] ACPICA: Update version to 20131218.
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (19 preceding siblings ...)
2014-01-08 5:45 ` [PATCH 20/21] ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global Lv Zheng
@ 2014-01-08 5:45 ` Lv Zheng
2014-01-08 14:52 ` [PATCH 00/21] ACPICA: 20131218 Release Rafael J. Wysocki
21 siblings, 0 replies; 23+ messages in thread
From: Lv Zheng @ 2014-01-08 5:45 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
From: Bob Moore <robert.moore@intel.com>
Version 20131218.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
include/acpi/acpixf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index cfe929b..d2f16f1 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20131115
+#define ACPI_CA_VERSION 0x20131218
#include <acpi/acconfig.h>
#include <acpi/actypes.h>
--
1.7.10
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 00/21] ACPICA: 20131218 Release
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
` (20 preceding siblings ...)
2014-01-08 5:45 ` [PATCH 21/21] ACPICA: Update version to 20131218 Lv Zheng
@ 2014-01-08 14:52 ` Rafael J. Wysocki
21 siblings, 0 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2014-01-08 14:52 UTC (permalink / raw)
To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, Lv Zheng, linux-acpi
On Wednesday, January 08, 2014 01:43:06 PM Lv Zheng wrote:
> The 20131218 ACPICA kernel resident system updates are linuxized based on
> the pm/linux-next branch.
>
> The patch set has passed the following build/boot tests.
> Build tests are performed as follows:
> 1. i386 + default + COFNIG_ACPI=y
> 2. i386 + allyes + CONFIG_ACPI=y
> 3. i386 + default + COFNIG_ACPI=n
> 4. i386 + allyes + CONFIG_ACPI=n
> 5. x86_64 + default + COFNIG_ACPI=y
> 6. x86_64 + allyes + CONFIG_ACPI=y
> 7. x86_64 + default + COFNIG_ACPI=n
> 8. x86_64 + allyes + CONFIG_ACPI=n
> Boot tests are performed as follows:
> 1. i386 + default + COFNIG_ACPI=y
> 2. x86_64 + default + COFNIG_ACPI=y
> Where:
> 1. i386: machine named as "Dell Inspiron Mini 1010"
> 2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
> 3. default: kernel configuration with following items enabled:
> All hardware drivers related to the machines of i386/x86_64
> All drivers/acpi configurations
> All platform drivers
> All ACPI drivers
> 4 DRM drivers that implement ACPI opregion
> All buses with ACPI bindings
> All cpufreq configurations
> All xen configurations
> All ACPI tabln drivers
> 4. allyes: kernel configuration generated by allyesconfig.
>
> Betty Dall (1):
> ACPICA: Add helper macros to extract bus/segment numbers from HEST
> table.
>
> Bob Moore (14):
> ACPICA: Debug output: Fix a couple of small output issues.
> ACPICA: Disassembler: Improve pathname support for emitted External()
> statements.
> ACPICA: Add option to favor 32-bit FADT addresses.
> ACPICA: Tables: Add full support for the DBG2 table.
> ACPICA: Tables: Add full support for the PCCT table, update table
> definition.
> ACPICA: Improve exception handling for GPE block installation.
> ACPICA: Update several debug statements - no functional change.
> ACPICA: Enhance ACPI warning for memory/IO address conflicts.
> ACPICA: Parser: Updates/fixes for debug output.
> ACPICA: Conditionally define a local variable that is used for debug
> only.
> ACPICA: Add an error message if the Debugger fails initialization.
> ACPICA: Update ACPI example code to make it an actual working
> program.
> ACPICA: Interpreter: Add additional debug info for an error case.
> ACPICA: Update version to 20131218.
>
> Lv Zheng (6):
> ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
> ACPICA: Linux Header: Remove unused OSL prototypes.
> ACPICA: Back port and refine validation of the XSDT root table.
> ACPICA: Cleanup the option of forcing the use of the RSDT.
> ACPICA: AcpiSrc: Cleanup spaces after special macro invocations.
> ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file
> global.
>
> arch/ia64/kernel/acpi.c | 1 -
> arch/x86/kernel/acpi/boot.c | 3 +-
> drivers/acpi/acpica/acdebug.h | 1 -
> drivers/acpi/acpica/acevents.h | 9 +-
> drivers/acpi/acpica/acglobal.h | 30 ++++
> drivers/acpi/acpica/aclocal.h | 9 +-
> drivers/acpi/acpica/dsfield.c | 2 +-
> drivers/acpi/acpica/dsutils.c | 19 ++-
> drivers/acpi/acpica/dswload.c | 4 +-
> drivers/acpi/acpica/evgpeblk.c | 8 +-
> drivers/acpi/acpica/evgpeutil.c | 24 +--
> drivers/acpi/acpica/exresnte.c | 3 +-
> drivers/acpi/acpica/nsxfeval.c | 23 +--
> drivers/acpi/acpica/psopinfo.c | 51 +++++-
> drivers/acpi/acpica/tbfadt.c | 335 +++++++++++++++++++++------------------
> drivers/acpi/acpica/tbutils.c | 214 ++++++++++++++-----------
> drivers/acpi/acpica/utaddress.c | 19 ++-
> drivers/acpi/acpica/utalloc.c | 10 +-
> drivers/acpi/acpica/utcache.c | 12 +-
> drivers/acpi/acpica/utdebug.c | 4 +-
> drivers/acpi/acpica/utglobal.c | 4 -
> drivers/acpi/acpica/utxfinit.c | 12 +-
> include/acpi/acpixf.h | 39 ++---
> include/acpi/actbl.h | 3 +
> include/acpi/actbl1.h | 10 +-
> include/acpi/actbl2.h | 5 +
> include/acpi/actbl3.h | 15 +-
> include/acpi/actypes.h | 12 +-
> include/acpi/platform/acenv.h | 20 ++-
> include/acpi/platform/aclinux.h | 4 -
> 30 files changed, 538 insertions(+), 367 deletions(-)
Queued up for 3.14, thanks Lv!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2014-01-08 14:38 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 5:43 [PATCH 00/21] ACPICA: 20131218 Release Lv Zheng
2014-01-08 5:43 ` [PATCH 01/21] ACPICA: Debug output: Fix a couple of small output issues Lv Zheng
2014-01-08 5:43 ` [PATCH 02/21] ACPICA: Disassembler: Improve pathname support for emitted External() statements Lv Zheng
2014-01-08 5:43 ` [PATCH 03/21] ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change Lv Zheng
2014-01-08 5:43 ` [PATCH 04/21] ACPICA: Linux Header: Remove unused OSL prototypes Lv Zheng
2014-01-08 5:43 ` [PATCH 05/21] ACPICA: Back port and refine validation of the XSDT root table Lv Zheng
2014-01-08 5:43 ` [PATCH 06/21] ACPICA: Cleanup the option of forcing the use of the RSDT Lv Zheng
2014-01-08 5:43 ` [PATCH 07/21] ACPICA: Add option to favor 32-bit FADT addresses Lv Zheng
2014-01-08 5:43 ` [PATCH 08/21] ACPICA: Tables: Add full support for the DBG2 table Lv Zheng
2014-01-08 5:43 ` [PATCH 09/21] ACPICA: Tables: Add full support for the PCCT table, update table definition Lv Zheng
2014-01-08 5:44 ` [PATCH 10/21] ACPICA: Add helper macros to extract bus/segment numbers from HEST table Lv Zheng
2014-01-08 5:44 ` [PATCH 11/21] ACPICA: Improve exception handling for GPE block installation Lv Zheng
2014-01-08 5:44 ` [PATCH 12/21] ACPICA: Update several debug statements - no functional change Lv Zheng
2014-01-08 5:44 ` [PATCH 13/21] ACPICA: Enhance ACPI warning for memory/IO address conflicts Lv Zheng
2014-01-08 5:44 ` [PATCH 14/21] ACPICA: Parser: Updates/fixes for debug output Lv Zheng
2014-01-08 5:44 ` [PATCH 15/21] ACPICA: Conditionally define a local variable that is used for debug only Lv Zheng
2014-01-08 5:44 ` [PATCH 16/21] ACPICA: Add an error message if the Debugger fails initialization Lv Zheng
2014-01-08 5:44 ` [PATCH 17/21] ACPICA: Update ACPI example code to make it an actual working program Lv Zheng
2014-01-08 5:44 ` [PATCH 18/21] ACPICA: Interpreter: Add additional debug info for an error case Lv Zheng
2014-01-08 5:44 ` [PATCH 19/21] ACPICA: Linuxize: Cleanup spaces after special macro invocations Lv Zheng
2014-01-08 5:45 ` [PATCH 20/21] ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global Lv Zheng
2014-01-08 5:45 ` [PATCH 21/21] ACPICA: Update version to 20131218 Lv Zheng
2014-01-08 14:52 ` [PATCH 00/21] ACPICA: 20131218 Release Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).