Skip to contentSkip to conversation

ACPICA 20170831 Release

PATCH In review Lv Zheng 2 participants 10 messages Sep 15, 2017 – Sep 18, 2017

Subsystems (2)
lore
Share & tools
lore

Lv Zheng

author
#0 lore raw

cover ACPICA 20170831 Release

The 20170831 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "Microsoft Surface Pro 3"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20170728 Release):
390 lines
After applying (20170831 Release):
390 lines

Bob Moore (6):
ACPICA: Header support for the PDTT ACPI table
ACPICA: Restructure/cleanup all string-to-integer conversion functions
ACPICA: String conversions: Cleanup/format comments. No functional
changes
ACPICA: String conversions: Update to add new behaviors
ACPICA: Update acpi_get_timer for 64-bit interface to acpi_hw_read
ACPICA: Update version to 20170831

Lv Zheng (2):
ACPICA: Hardware: Enable 64-bit support of hardware accesses
ACPICA: acpiexec: Add testability of deferred table verification

 drivers/acpi/acpica/Makefile             |   1 +
 drivers/acpi/acpica/achware.h            |   4 +-
 drivers/acpi/acpica/acinterp.h           |   6 +-
 drivers/acpi/acpica/acutils.h            |  33 ++-
 drivers/acpi/acpica/dbconvert.c          |   5 +-
 drivers/acpi/acpica/dswexec.c            |   2 +-
 drivers/acpi/acpica/evgpe.c              |   6 +-
 drivers/acpi/acpica/exconcat.c           |   2 +-
 drivers/acpi/acpica/exconvrt.c           |  30 ++-
 drivers/acpi/acpica/exmisc.c             |   2 +-
 drivers/acpi/acpica/exresop.c            |   2 +-
 drivers/acpi/acpica/hwgpe.c              |   4 +-
 drivers/acpi/acpica/hwregs.c             |  72 ++---
 drivers/acpi/acpica/hwtimer.c            |  10 +-
 drivers/acpi/acpica/hwxface.c            | 118 +--------
 drivers/acpi/acpica/nsconvert.c          |   4 +-
 drivers/acpi/acpica/tbxface.c            |   9 +-
 drivers/acpi/acpica/utstrsuppt.c         | 437 ++++++++++++++++++++++++++++++
 drivers/acpi/acpica/utstrtoul64.c        | 442 ++++++++++++++++---------------
 include/acpi/acexcep.h                   |  16 +-
 include/acpi/acpixf.h                    |   2 +-
 include/acpi/actbl1.h                    |  30 +++
 tools/power/acpi/tools/acpidump/Makefile |   1 +
 tools/power/acpi/tools/acpidump/apdump.c |   3 +-
 tools/power/acpi/tools/acpidump/apmain.c |   4 +-
 25 files changed, 833 insertions(+), 412 deletions(-)
 create mode 100644 drivers/acpi/acpica/utstrsuppt.c
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/8 ACPICA: Hardware: Enable 64-bit support of hardware accesses

ACPICA commit 6b0a604d171334f61a18bc92b44ec0437b11bf98

This patch enable 64-bit support for acpi_hw_read()/acpi_hw_write() and then convert acpi_read()/acpi_write() to invoke them. BZ 1287, fixed by Lv Zheng.

---
 drivers/acpi/acpica/achware.h |   4 +-
 drivers/acpi/acpica/evgpe.c   |   6 +--
 drivers/acpi/acpica/hwgpe.c   |   4 +-
 drivers/acpi/acpica/hwregs.c  |  72 ++++++++++++++------------
 drivers/acpi/acpica/hwxface.c | 118 ++----------------------------------------
 5 files changed, 49 insertions(+), 155 deletions(-)
drivers/acpi/acpica/achware.h +2 -2
index fd4f3ca..cd722d8 100644
@@ -66,9 +66,9 @@ acpi_status
 acpi_hw_validate_register(struct acpi_generic_address *reg,
 			  u8 max_bit_width, u64 *address);
 
-acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg);
+acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg);
 
-acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg);
+acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg);
 
 struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
 
drivers/acpi/acpica/evgpe.c +3 -3
index 2293820..263d8fc 100644
@@ -390,8 +390,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
 	struct acpi_gpe_handler_info *gpe_handler_info;
 	u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
 	u8 enabled_status_byte;
-	u32 status_reg;
-	u32 enable_reg;
+	u64 status_reg;
+	u64 enable_reg;
 	acpi_cpu_flags flags;
 	u32 i;
 	u32 j;
@@ -472,7 +472,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
 					  gpe_register_info->base_gpe_number,
 					  gpe_register_info->base_gpe_number +
 					  (ACPI_GPE_REGISTER_WIDTH - 1),
-					  status_reg, enable_reg,
+					  (u32)status_reg, (u32)enable_reg,
 					  gpe_register_info->enable_for_run,
 					  gpe_register_info->enable_for_wake));
 
drivers/acpi/acpica/hwgpe.c +2 -2
index 5eb11b3..09b6822 100644
@@ -99,7 +99,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
 {
 	struct acpi_gpe_register_info *gpe_register_info;
 	acpi_status status = AE_OK;
-	u32 enable_mask;
+	u64 enable_mask;
 	u32 register_bit;
 
 	ACPI_FUNCTION_ENTRY();
@@ -214,7 +214,7 @@ acpi_status
 acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
 		       acpi_event_status *event_status)
 {
-	u32 in_byte;
+	u64 in_byte;
 	u32 register_bit;
 	struct acpi_gpe_register_info *gpe_register_info;
 	acpi_event_status local_event_status = 0;
drivers/acpi/acpica/hwregs.c +39 -33

238 lines not on this page · raw message

drivers/acpi/acpica/hwxface.c +3 -115

138 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/8 ACPICA: acpiexec: Add testability of deferred table verification

In reply to Lv Zheng

ACPICA commit 04c28c7549e694ea85f40bcc816039e5fbb4169c

This patch adds testability of deferred table verification mechanism. As acpiexec uses dynamically allocated root table list from its very early stage, a change to acpi_reallocate_root_table() is required to allow deferred table verification mechanism to be triggered in such an environment. Note that acpi_gbl_enable_table_validation is still TRUE by default, thus:
1. Developers need to manually set acpi_gbl_enable_table_validation to FALSE for acpiexec to enable this test.
2. For all other OSPMs (Linux, BSDs, etc.), this commit is a no-op.

---
 drivers/acpi/acpica/tbxface.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/acpi/acpica/tbxface.c +6 -3
index 26ad596..5ecb8d2 100644
@@ -173,10 +173,13 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void)
 	ACPI_FUNCTION_TRACE(acpi_reallocate_root_table);
 
 	/*
-	 * Only reallocate the root table if the host provided a static buffer
-	 * for the table array in the call to acpi_initialize_tables.
+	 * If there are tables unverified, it is required to reallocate the
+	 * root table list to clean up invalid table entries. Otherwise only
+	 * reallocate the root table list if the host provided a static buffer
+	 * for the table array in the call to acpi_initialize_tables().
 	 */
-	if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
+	if ((acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) &&
+	    acpi_gbl_enable_table_validation) {
 		return_ACPI_STATUS(AE_SUPPORT);
 	}
 
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/8 ACPICA: Header support for the PDTT ACPI table

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 9951c78746b52da7d23da4531fcfba6bf8c95b6a

This is an ACPI 6.2 table.

---
 include/acpi/actbl1.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
include/acpi/actbl1.h +30 -0
index 6b8714a..7a89e6d 100644
@@ -69,6 +69,7 @@
 #define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
 #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
 #define ACPI_SIG_MSCT           "MSCT"	/* Maximum System Characteristics Table */
+#define ACPI_SIG_PDTT           "PDTT"	/* Processor Debug Trigger Table */
 #define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
 #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
 #define ACPI_SIG_SLIT           "SLIT"	/* System Locality Distance Information Table */
@@ -1282,6 +1283,35 @@ struct acpi_nfit_flush_address {
 
 /*******************************************************************************
  *
+ * PDTT - Processor Debug Trigger Table (ACPI 6.2)
+ *        Version 0
+ *
+ ******************************************************************************/
+
+struct acpi_table_pdtt {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u8 trigger_count;
+	u8 reserved[3];
+	u32 array_offset;
+};
+
+/*
+ * PDTT Communication Channel Identifier Structure.
+ * The number of these structures is defined by trigger_count above,
+ * starting at array_offset.
+ */
+struct acpi_pdtt_channel {
+	u16 sub_channel_id;
+};
+
+/* Mask and Flags for above */
+
+#define ACPI_PDTT_SUBCHANNEL_ID_MASK        0x00FF
+#define ACPI_PDTT_RUNTIME_TRIGGER           (1<<8)
+#define ACPI_PPTT_WAIT_COMPLETION           (1<<9)
+
+/*******************************************************************************
+ *
  * PPTT - Processor Properties Topology Table (ACPI 6.2)
  *        Version 1
  *
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/8 ACPICA: Restructure/cleanup all string-to-integer conversion functions

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 610046d444ad781cc36673bf1f030abe50cbc61f

Improve adherence to ACPI spec for implicit and explicit conversions Adds octal support for constants in ASL code
Adds integer overflow errors for constants during ASL compilation Eliminates most of the existing complex flags parameters Simplify support for implicit/explicit runtime conversions Adds one new file, utilities/utstrsuppt.c

---
 drivers/acpi/acpica/Makefile             |   1 +
 drivers/acpi/acpica/acinterp.h           |   6 +-
 drivers/acpi/acpica/acutils.h            |  31 ++-
 drivers/acpi/acpica/dbconvert.c          |   5 +-
 drivers/acpi/acpica/dswexec.c            |   2 +-
 drivers/acpi/acpica/exconcat.c           |   2 +-
 drivers/acpi/acpica/exconvrt.c           |  30 ++-
 drivers/acpi/acpica/exmisc.c             |   2 +-
 drivers/acpi/acpica/exresop.c            |   2 +-
 drivers/acpi/acpica/nsconvert.c          |   4 +-
 drivers/acpi/acpica/utstrsuppt.c         | 416 ++++++++++++++++++++++++++++++
 drivers/acpi/acpica/utstrtoul64.c        | 420 +++++++++++++++----------------
 include/acpi/acexcep.h                   |  16 +-
 tools/power/acpi/tools/acpidump/Makefile |   1 +
 tools/power/acpi/tools/acpidump/apdump.c |   3 +-
 tools/power/acpi/tools/acpidump/apmain.c |   4 +-
 16 files changed, 689 insertions(+), 256 deletions(-)
 create mode 100644 drivers/acpi/acpica/utstrsuppt.c
drivers/acpi/acpica/Makefile +1 -0
index 1709551..2d09b02 100644
@@ -177,6 +177,7 @@ acpi-y +=		\
 	utresrc.o	\
 	utstate.o	\
 	utstring.o	\
+	utstrsuppt.o	\
 	utstrtoul64.o	\
 	utxface.o	\
 	utxfinit.o	\
drivers/acpi/acpica/acinterp.h +2 -4
index 29a863c..29555c8 100644
@@ -101,7 +101,8 @@ typedef const struct acpi_exdump_info {
  */
 acpi_status
 acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
-			   union acpi_operand_object **result_desc, u32 flags);
+			   union acpi_operand_object **result_desc,
+			   u32 implicit_conversion);
 
 acpi_status
 acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
@@ -424,9 +425,6 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
 			     struct acpi_walk_state *walk_state,
 			     u8 implicit_conversion);
 
-#define ACPI_IMPLICIT_CONVERSION        TRUE
-#define ACPI_NO_IMPLICIT_CONVERSION     FALSE
-
 /*
  * exstoren - resolve/store object
  */
drivers/acpi/acpica/acutils.h +25 -6
index 745134a..7a568c6 100644
@@ -141,6 +141,11 @@ extern const char *acpi_gbl_ptyp_decode[];
 #define ACPI_MSG_SUFFIX \
 	acpi_os_printf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, module_name, line_number)
 
+/* Flags to indicate implicit or explicit string-to-integer conversion */
+
+#define ACPI_IMPLICIT_CONVERSION        TRUE
+#define ACPI_NO_IMPLICIT_CONVERSION     FALSE
+
 /* Types for Resource descriptor entries */
 
 #define ACPI_INVALID_RESOURCE           0
@@ -197,15 +202,29 @@ void acpi_ut_strlwr(char *src_string);
 
 int acpi_ut_stricmp(char *string1, char *string2);
 
-acpi_status acpi_ut_strtoul64(char *string, u32 flags, u64 *ret_integer);
+/*
+ * utstrsuppt - string-to-integer conversion support functions
+ */
+acpi_status acpi_ut_convert_octal_string(char *string, u64 *return_value);
+
+acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr);
+
+acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr);
+
+char acpi_ut_remove_leading_zeros(char **string);
+
+u8 acpi_ut_detect_hex_prefix(char **string);
+
+u8 acpi_ut_detect_octal_prefix(char **string);
 
 /*
- * Values for Flags above
- * Note: LIMIT values correspond to acpi_gbl_integer_byte_width values (4/8)
+ * utstrtoul64 - string-to-integer conversion functions
  */
-#define ACPI_STRTOUL_32BIT          0x04	/* 4 bytes */
-#define ACPI_STRTOUL_64BIT          0x08	/* 8 bytes */
-#define ACPI_STRTOUL_BASE16         0x10	/* Default: Base10/16 */
+acpi_status acpi_ut_strtoul64(char *string, u64 *ret_integer);
+
+u64 acpi_ut_explicit_strtoul64(char *string);
+
+u64 acpi_ut_implicit_strtoul64(char *string);
 
 /*
  * utglobal - Global data structures and procedures
drivers/acpi/acpica/dbconvert.c +1 -4
index 857dbc4..32d546f 100644
@@ -277,10 +277,7 @@ acpi_db_convert_to_object(acpi_object_type type,
 	default:
 
 		object->type = ACPI_TYPE_INTEGER;
-		status = acpi_ut_strtoul64(string,
-					   (acpi_gbl_integer_byte_width |
-					    ACPI_STRTOUL_BASE16),
-					   &object->integer.value);
+		status = acpi_ut_strtoul64(string, &object->integer.value);
 		break;
 	}
 
drivers/acpi/acpica/dswexec.c +1 -1
index 20d7744..22f45d0 100644
@@ -134,7 +134,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
 	 * object. Implicitly convert the argument if necessary.
 	 */
 	status = acpi_ex_convert_to_integer(obj_desc, &local_obj_desc,
-					    ACPI_STRTOUL_BASE16);
+					    ACPI_IMPLICIT_CONVERSION);
 	if (ACPI_FAILURE(status)) {
 		goto cleanup;
 	}
drivers/acpi/acpica/exconcat.c +1 -1
index 76bfb7d..59b8de2 100644
@@ -156,7 +156,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
 
 		status =
 		    acpi_ex_convert_to_integer(local_operand1, &temp_operand1,
-					       ACPI_STRTOUL_BASE16);
+					       ACPI_IMPLICIT_CONVERSION);
 		break;
 
 	case ACPI_TYPE_BUFFER:
drivers/acpi/acpica/exconvrt.c +18 -12
index f71028e..23ebadb 100644
@@ -57,10 +57,10 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);
  *
  * FUNCTION:    acpi_ex_convert_to_integer
  *
- * PARAMETERS:  obj_desc        - Object to be converted. Must be an
- *                                Integer, Buffer, or String
- *              result_desc     - Where the new Integer object is returned
- *              flags           - Used for string conversion
+ * PARAMETERS:  obj_desc            - Object to be converted. Must be an
+ *                                    Integer, Buffer, or String
+ *              result_desc         - Where the new Integer object is returned
+ *              implicit_conversion - Used for string conversion
  *
  * RETURN:      Status
  *
@@ -70,14 +70,14 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);
 
 acpi_status
 acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
-			   union acpi_operand_object **result_desc, u32 flags)
+			   union acpi_operand_object **result_desc,
+			   u32 implicit_conversion)
 {
 	union acpi_operand_object *return_desc;
 	u8 *pointer;
 	u64 result;
 	u32 i;
 	u32 count;
-	acpi_status status;
 
 	ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc);
 
@@ -123,12 +123,18 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
 		 * hexadecimal as per the ACPI specification. The only exception (as
 		 * of ACPI 3.0) is that the to_integer() operator allows both decimal
 		 * and hexadecimal strings (hex prefixed with "0x").
+		 *
+		 * Explicit conversion is used only by to_integer.
+		 * All other string-to-integer conversions are implicit conversions.
 		 */
-		status = acpi_ut_strtoul64(ACPI_CAST_PTR(char, pointer),
-					   (acpi_gbl_integer_byte_width |
-					    flags), &result);
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
+		if (implicit_conversion) {
+			result =
+			    acpi_ut_implicit_strtoul64(ACPI_CAST_PTR
+						       (char, pointer));
+		} else {
+			result =
+			    acpi_ut_explicit_strtoul64(ACPI_CAST_PTR
+						       (char, pointer));
 		}
 		break;
 
@@ -631,7 +637,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
 			 */
 			status =
 			    acpi_ex_convert_to_integer(source_desc, result_desc,
-						       ACPI_STRTOUL_BASE16);
+						       ACPI_IMPLICIT_CONVERSION);
 			break;
 
 		case ACPI_TYPE_STRING:
drivers/acpi/acpica/exmisc.c +1 -1
index 1e7649c..dbad3eb 100644
@@ -330,7 +330,7 @@ acpi_ex_do_logical_op(u16 opcode,
 	case ACPI_TYPE_INTEGER:
 
 		status = acpi_ex_convert_to_integer(operand1, &local_operand1,
-						    ACPI_STRTOUL_BASE16);
+						    ACPI_IMPLICIT_CONVERSION);
 		break;
 
 	case ACPI_TYPE_STRING:
drivers/acpi/acpica/exresop.c +1 -1
index c485242..1c7c996 100644
@@ -415,7 +415,7 @@ acpi_ex_resolve_operands(u16 opcode,
 			 * Known as "Implicit Source Operand Conversion"
 			 */
 			status = acpi_ex_convert_to_integer(obj_desc, stack_ptr,
-							    ACPI_STRTOUL_BASE16);
+							    ACPI_IMPLICIT_CONVERSION);
 			if (ACPI_FAILURE(status)) {
 				if (status == AE_TYPE) {
 					ACPI_ERROR((AE_INFO,
drivers/acpi/acpica/nsconvert.c +2 -2
index e4a7da8..539d775 100644
@@ -78,8 +78,8 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
 
 		/* String-to-Integer conversion */
 
-		status = acpi_ut_strtoul64(original_object->string.pointer,
-					   acpi_gbl_integer_byte_width, &value);
+		status =
+		    acpi_ut_strtoul64(original_object->string.pointer, &value);
 		if (ACPI_FAILURE(status)) {
 			return (status);
 		}
drivers/acpi/acpica/utstrsuppt.c new file +416 -0

416 lines not on this page · raw message

drivers/acpi/acpica/utstrtoul64.c +203 -217

510 lines not on this page · raw message

include/acpi/acexcep.h +14 -2
index ad54610..17d61b1 100644
@@ -126,8 +126,12 @@ struct acpi_exception_info {
 #define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)
 #define AE_ACCESS                       EXCEP_ENV (0x001D)
 #define AE_IO_ERROR                     EXCEP_ENV (0x001E)
+#define AE_NUMERIC_OVERFLOW             EXCEP_ENV (0x001F)
+#define AE_HEX_OVERFLOW                 EXCEP_ENV (0x0020)
+#define AE_DECIMAL_OVERFLOW             EXCEP_ENV (0x0021)
+#define AE_OCTAL_OVERFLOW               EXCEP_ENV (0x0022)
 
-#define AE_CODE_ENV_MAX                 0x001E
+#define AE_CODE_ENV_MAX                 0x0022
 
 /*
  * Programmer exceptions
@@ -263,7 +267,15 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
 	EXCEP_TXT("AE_NOT_CONFIGURED",
 		  "The interface is not part of the current subsystem configuration"),
 	EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation"),
-	EXCEP_TXT("AE_IO_ERROR", "An I/O error occurred")
+	EXCEP_TXT("AE_IO_ERROR", "An I/O error occurred"),
+	EXCEP_TXT("AE_NUMERIC_OVERFLOW",
+		  "Overflow during string-to-integer conversion"),
+	EXCEP_TXT("AE_HEX_OVERFLOW",
+		  "Overflow during ASCII hex-to-binary conversion"),
+	EXCEP_TXT("AE_DECIMAL_OVERFLOW",
+		  "Overflow during ASCII decimal-to-binary conversion"),
+	EXCEP_TXT("AE_OCTAL_OVERFLOW",
+		  "Overflow during ASCII octal-to-binary conversion")
 };
 
 static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
tools/power/acpi/tools/acpidump/Makefile +1 -0
index f7c7af1..b436f86 100644
@@ -39,6 +39,7 @@ TOOL_OBJS = \
 	utnonansi.o\
 	utprint.o\
 	utstring.o\
+	utstrsuppt.o\
 	utstrtoul64.o\
 	utxferror.o\
 	oslinuxtbl.o\
tools/power/acpi/tools/acpidump/apdump.c +1 -2
index 60df1fb..0634449 100644
@@ -287,8 +287,7 @@ int ap_dump_table_by_address(char *ascii_address)
 
 	/* Convert argument to an integer physical address */
 
-	status = acpi_ut_strtoul64(ascii_address, ACPI_STRTOUL_64BIT,
-				   &long_address);
+	status = acpi_ut_strtoul64(ascii_address, &long_address);
 	if (ACPI_FAILURE(status)) {
 		fprintf(stderr, "%s: Could not convert to a physical address\n",
 			ascii_address);
tools/power/acpi/tools/acpidump/apmain.c +1 -3
index 943b6b6..22c3b4e 100644
@@ -208,9 +208,7 @@ static int ap_do_options(int argc, char **argv)
 		case 'r':	/* Dump tables from specified RSDP */
 
 			status =
-			    acpi_ut_strtoul64(acpi_gbl_optarg,
-					      ACPI_STRTOUL_64BIT,
-					      &gbl_rsdp_base);
+			    acpi_ut_strtoul64(acpi_gbl_optarg, &gbl_rsdp_base);
 			if (ACPI_FAILURE(status)) {
 				fprintf(stderr,
 					"%s: Could not convert to a physical address\n",
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/8 ACPICA: String conversions: Cleanup/format comments. No functional changes

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 33e38cd2406709b13fa0a7821e588505b3771163

Cleanup some of the language used in the large comments, especially the ones that reference the rules in the ACPI spec. Fixed some typos.

---
 drivers/acpi/acpica/utstrsuppt.c  |  48 ++++++++----------
 drivers/acpi/acpica/utstrtoul64.c | 104 +++++++++++++++++++-------------------
 2 files changed, 74 insertions(+), 78 deletions(-)
drivers/acpi/acpica/utstrsuppt.c +22 -26
index 64a5fae..e402cf7 100644
@@ -1,6 +1,6 @@
 /*******************************************************************************
  *
- * Module Name: utstrsuppt - string-to-integer conversion support functions
+ * Module Name: utstrsuppt - Support functions for string-to-integer conversion
  *
  ******************************************************************************/
 
@@ -83,7 +83,7 @@ acpi_status acpi_ut_convert_octal_string(char *string, u64 *return_value_ptr)
 
 	while (*string) {
 
-		/* Must be ASCII 0-7, otherwise terminate with no error */
+		/* Character must be ASCII 0-7, otherwise terminate with no error */
 
 		if (!(ACPI_IS_OCTAL_DIGIT(*string))) {
 			break;
@@ -132,7 +132,7 @@ acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr)
 
 	while (*string) {
 
-		/* Must be ASCII 0-9, otherwise terminate with no error */
+		/* Character must be ASCII 0-9, otherwise terminate with no error */
 
 		if (!isdigit(*string)) {
 			break;
@@ -210,18 +210,17 @@ acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr)
  *
  * PARAMETERS:  string                  - Pointer to input ASCII string
  *
- * RETURN:      Next character after the leading zeros. This behavior may be
- *              Used by the caller to detect end-of-string.
+ * RETURN:      Next character after any leading zeros. This character may be
+ *              used by the caller to detect end-of-string.
  *
- * DESCRIPTION: Remove all leading zeros in the input string. Return the
- *              next character after the final zero to check for the end
- *              of the string (NULL terminator).
+ * DESCRIPTION: Remove any leading zeros in the input string. Return the
+ *              next character after the final ASCII zero to enable the caller
+ *              to check for the end of the string (NULL terminator).
  *
  ******************************************************************************/
 
 char acpi_ut_remove_leading_zeros(char **string)
 {
-	/* Skip all leading zeros */
 
 	while (**string == ACPI_ASCII_ZERO) {
 		*string += 1;
@@ -236,9 +235,9 @@ char acpi_ut_remove_leading_zeros(char **string)
  *
  * PARAMETERS:  string                  - Pointer to input ASCII string
  *
- * RETURN:      TRUE if a 0x prefix was found
+ * RETURN:      TRUE if a "0x" prefix was found at the start of the string
  *
- * DESCRIPTION: Detect and remove a hex 0x prefix
+ * DESCRIPTION: Detect and remove a hex "0x" prefix
  *
  ******************************************************************************/
 
@@ -260,7 +259,8 @@ u8 acpi_ut_detect_hex_prefix(char **string)
  *
  * PARAMETERS:  string                  - Pointer to input ASCII string
  *
- * RETURN:      True if an octal 0 prefix was found
+ * RETURN:      True if an octal "0" prefix was found at the start of the
+ *              string
  *
  * DESCRIPTION: Detect and remove an octal prefix (zero)
  *
@@ -282,23 +282,22 @@ u8 acpi_ut_detect_octal_prefix(char **string)
  * FUNCTION:    acpi_ut_insert_digit
  *
  * PARAMETERS:  accumulated_value       - Current value of the integer value
- *                                        accumulator. The New value is
+ *                                        accumulator. The new value is
  *                                        returned here.
- *              base                    - Radix, either 8/10/16 supported
+ *              base                    - Radix, either 8/10/16
  *              ascii_digit             - ASCII single digit to be inserted
  *
- * RETURN:      Status and result of convert/insert operation. The only
- *              exception is numeric overflow of either the multiply or the
- *              add operations.
+ * RETURN:      Status and result of the convert/insert operation. The only
+ *              possible returned exception code is numeric overflow of
+ *              either the multiply or add conversion operations.
  *
  * DESCRIPTION: Generic conversion and insertion function for all bases:
  *
- *              1) Multiply the current accumulated converted value by the
+ *              1) Multiply the current accumulated/converted value by the
  *              base in order to make room for the new character.
  *
- *              2) Add the current accumulated/converted value the new
- *              character (after the character has been converted to a binary
- *              value).
+ *              2) Convert the new character to binary and add it to the
+ *              current accumulated value.
  *
  *              Note: The only possible exception indicates an integer
  *              overflow (AE_NUMERIC_OVERFLOW)
@@ -318,17 +317,14 @@ acpi_ut_insert_digit(u64 *accumulated_value, u32 base, int ascii_digit)
 		return (status);
 	}
 
-	/* Add in the new digit, and store to the caller's accumulated value */
+	/* Add in the new digit, and store the sum to the accumulated value */
 
 	status =
 	    acpi_ut_strtoul_add64(product,
 				  acpi_ut_ascii_char_to_hex(ascii_digit),
 				  accumulated_value);
-	if (ACPI_FAILURE(status)) {
-		return (status);
-	}
 
-	return (AE_OK);
+	return (status);
 }
 
 /*******************************************************************************
drivers/acpi/acpica/utstrtoul64.c +52 -52

245 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 6/8 ACPICA: String conversions: Update to add new behaviors

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit e3574138af82a25d76324559848689946982dbd0

1) Allow whitespace in string before the constant
2) ut_strtoul64 now always creates a 64-bit integer; iASL will truncate this to the lower 32-bits if the table being compiled is a 32-bit table (DSDT revision less than 2).

---
 drivers/acpi/acpica/acutils.h     |  2 ++
 drivers/acpi/acpica/utstrsuppt.c  | 25 ++++++++++++++
 drivers/acpi/acpica/utstrtoul64.c | 72 +++++++++++++++++++++++++++------------
 3 files changed, 78 insertions(+), 21 deletions(-)
drivers/acpi/acpica/acutils.h +2 -0
index 7a568c6..83b75e9 100644
@@ -211,6 +211,8 @@ acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr);
 
 acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr);
 
+char acpi_ut_remove_whitespace(char **string);
+
 char acpi_ut_remove_leading_zeros(char **string);
 
 u8 acpi_ut_detect_hex_prefix(char **string);
drivers/acpi/acpica/utstrsuppt.c +25 -0
index e402cf7..bec2b8e 100644
@@ -231,6 +231,31 @@ char acpi_ut_remove_leading_zeros(char **string)
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ut_remove_whitespace
+ *
+ * PARAMETERS:  string                  - Pointer to input ASCII string
+ *
+ * RETURN:      Next character after any whitespace. This character may be
+ *              used by the caller to detect end-of-string.
+ *
+ * DESCRIPTION: Remove any leading whitespace in the input string. Return the
+ *              next character after the final ASCII zero to enable the caller
+ *              to check for the end of the string (NULL terminator).
+ *
+ ******************************************************************************/
+
+char acpi_ut_remove_whitespace(char **string)
+{
+
+	while (isspace((u8)**string)) {
+		*string += 1;
+	}
+
+	return (**string);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ut_detect_hex_prefix
  *
  * PARAMETERS:  string                  - Pointer to input ASCII string
drivers/acpi/acpica/utstrtoul64.c +51 -21

143 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 7/8 ACPICA: Update acpi_get_timer for 64-bit interface to acpi_hw_read

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 1cdcf16447c15694faa564c0cd8e357b910344a0

Return value from acpi_hw_read is now 64 bits, but the ACPI PM Timer is defined by the ACPI spec to be 32 bits.

---
 drivers/acpi/acpica/hwtimer.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/acpi/acpica/hwtimer.c +9 -1
index b3c5d8c..a2f4e25 100644
@@ -94,6 +94,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_timer_resolution)
 acpi_status acpi_get_timer(u32 * ticks)
 {
 	acpi_status status;
+	u64 timer_value;
 
 	ACPI_FUNCTION_TRACE(acpi_get_timer);
 
@@ -107,7 +108,14 @@ acpi_status acpi_get_timer(u32 * ticks)
 		return_ACPI_STATUS(AE_SUPPORT);
 	}
 
-	status = acpi_hw_read(ticks, &acpi_gbl_FADT.xpm_timer_block);
+	status = acpi_hw_read(&timer_value, &acpi_gbl_FADT.xpm_timer_block);
+	if (ACPI_SUCCESS(status)) {
+
+		/* ACPI PM Timer is defined to be 32 bits (PM_TMR_LEN) */
+
+		*ticks = (u32)timer_value;
+	}
+
 	return_ACPI_STATUS(status);
 }
 
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 8/8 ACPICA: Update version to 20170831

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit faa9fdfbd035a14347e6a875be2a0cddb3e6fc00

Version 20170831.

---
 include/acpi/acpixf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 53c5e2f..e1dd1a8 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20170728
+#define ACPI_CA_VERSION                 0x20170831
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
2.7.4
#9 lore raw
In reply to Lv Zheng
Quoted 66 lines · CEST Lv Zheng

The 20170831 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "Microsoft Surface Pro 3"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20170728 Release):
390 lines
After applying (20170831 Release):
390 lines

Bob Moore (6):
ACPICA: Header support for the PDTT ACPI table
ACPICA: Restructure/cleanup all string-to-integer conversion functions
ACPICA: String conversions: Cleanup/format comments. No functional
changes
ACPICA: String conversions: Update to add new behaviors
ACPICA: Update acpi_get_timer for 64-bit interface to acpi_hw_read
ACPICA: Update version to 20170831

Lv Zheng (2):
ACPICA: Hardware: Enable 64-bit support of hardware accesses
ACPICA: acpiexec: Add testability of deferred table verification

 drivers/acpi/acpica/Makefile             |   1 +
 drivers/acpi/acpica/achware.h            |   4 +-
 drivers/acpi/acpica/acinterp.h           |   6 +-
 drivers/acpi/acpica/acutils.h            |  33 ++-
 drivers/acpi/acpica/dbconvert.c          |   5 +-
 drivers/acpi/acpica/dswexec.c            |   2 +-
 drivers/acpi/acpica/evgpe.c              |   6 +-
 drivers/acpi/acpica/exconcat.c           |   2 +-
 drivers/acpi/acpica/exconvrt.c           |  30 ++-
 drivers/acpi/acpica/exmisc.c             |   2 +-
 drivers/acpi/acpica/exresop.c            |   2 +-
 drivers/acpi/acpica/hwgpe.c              |   4 +-
 drivers/acpi/acpica/hwregs.c             |  72 ++---
 drivers/acpi/acpica/hwtimer.c            |  10 +-
 drivers/acpi/acpica/hwxface.c            | 118 +--------
 drivers/acpi/acpica/nsconvert.c          |   4 +-
 drivers/acpi/acpica/tbxface.c            |   9 +-
 drivers/acpi/acpica/utstrsuppt.c         | 437 ++++++++++++++++++++++++++++++
 drivers/acpi/acpica/utstrtoul64.c        | 442 ++++++++++++++++---------------
Quoted 8 lines
 include/acpi/acexcep.h                   |  16 +-
 include/acpi/acpixf.h                    |   2 +-
 include/acpi/actbl1.h                    |  30 +++
 tools/power/acpi/tools/acpidump/Makefile |   1 +
 tools/power/acpi/tools/acpidump/apdump.c |   3 +-
 tools/power/acpi/tools/acpidump/apmain.c |   4 +-
 25 files changed, 833 insertions(+), 412 deletions(-)
 create mode 100644 drivers/acpi/acpica/utstrsuppt.c

It looks like the series has not been picked up by Patchwork, probably due to a service outage.

Can you please resend it (for easier handling)?

Thanks,
Rafael