aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2019-01-14 12:55:23 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-01-15 12:04:02 -0500
commitf13c274da3896da705169409ad9b41df1ed84a33 (patch)
tree90c1f9f4716b9a56405a1e77adade51cfedb89f5
parent1c7fc5cbc33980acd13d668f1c8f0313d6ae9fd8 (diff)
ACPICA: Convert more ACPI errors to firmware errors
ACPICA commit f3198c12f2df9d170b3da891a180b774cfe01e59 Also adds a new firmware error function, acpi_bios_exception. Link: https://github.com/acpica/acpica/commit/f3198c12 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/dsopcode.c15
-rw-r--r--drivers/acpi/acpica/exoparg2.c8
-rw-r--r--drivers/acpi/acpica/utxferror.c44
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acpixf.h6
5 files changed, 64 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 78f9de260d5f..a0b821031063 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -130,8 +130,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
130 /* Must have a valid (>0) bit count */ 130 /* Must have a valid (>0) bit count */
131 131
132 if (bit_count == 0) { 132 if (bit_count == 0) {
133 ACPI_ERROR((AE_INFO, 133 ACPI_BIOS_ERROR((AE_INFO,
134 "Attempt to CreateField of length zero")); 134 "Attempt to CreateField of length zero"));
135 status = AE_AML_OPERAND_VALUE; 135 status = AE_AML_OPERAND_VALUE;
136 goto cleanup; 136 goto cleanup;
137 } 137 }
@@ -194,12 +194,13 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
194 /* Entire field must fit within the current length of the buffer */ 194 /* Entire field must fit within the current length of the buffer */
195 195
196 if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) { 196 if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
197 ACPI_ERROR((AE_INFO,
198 "Field [%4.4s] at bit offset/length %u/%u "
199 "exceeds size of target Buffer (%u bits)",
200 acpi_ut_get_node_name(result_desc), bit_offset,
201 bit_count, 8 * (u32)buffer_desc->buffer.length));
202 status = AE_AML_BUFFER_LIMIT; 197 status = AE_AML_BUFFER_LIMIT;
198 ACPI_BIOS_EXCEPTION((AE_INFO, status,
199 "Field [%4.4s] at bit offset/length %u/%u "
200 "exceeds size of target Buffer (%u bits)",
201 acpi_ut_get_node_name(result_desc),
202 bit_offset, bit_count,
203 8 * (u32)buffer_desc->buffer.length));
203 goto cleanup; 204 goto cleanup;
204 } 205 }
205 206
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c
index 3a477566ba1b..e9509b1c9a3a 100644
--- a/drivers/acpi/acpica/exoparg2.c
+++ b/drivers/acpi/acpica/exoparg2.c
@@ -390,10 +390,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
390 /* Failure means that the Index was beyond the end of the object */ 390 /* Failure means that the Index was beyond the end of the object */
391 391
392 if (ACPI_FAILURE(status)) { 392 if (ACPI_FAILURE(status)) {
393 ACPI_EXCEPTION((AE_INFO, status, 393 ACPI_BIOS_EXCEPTION((AE_INFO, status,
394 "Index (0x%X%8.8X) is beyond end of object (length 0x%X)", 394 "Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
395 ACPI_FORMAT_UINT64(index), 395 ACPI_FORMAT_UINT64(index),
396 (u32)length)); 396 (u32)length));
397 goto cleanup; 397 goto cleanup;
398 } 398 }
399 399
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 6bb85d691fcb..a1ed7fced4db 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -187,6 +187,50 @@ ACPI_EXPORT_SYMBOL(acpi_bios_error)
187 187
188/******************************************************************************* 188/*******************************************************************************
189 * 189 *
190 * FUNCTION: acpi_bios_exception
191 *
192 * PARAMETERS: module_name - Caller's module name (for error output)
193 * line_number - Caller's line number (for error output)
194 * status - Status value to be decoded/formatted
195 * format - Printf format string + additional args
196 *
197 * RETURN: None
198 *
199 * DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
200 * info as well as decoded acpi_status.
201 *
202 ******************************************************************************/
203void ACPI_INTERNAL_VAR_XFACE
204acpi_bios_exception(const char *module_name,
205 u32 line_number,
206 acpi_status status, const char *format, ...)
207{
208 va_list arg_list;
209
210 ACPI_MSG_REDIRECT_BEGIN;
211
212 /* For AE_OK, just print the message */
213
214 if (ACPI_SUCCESS(status)) {
215 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
216
217 } else {
218 acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s, ",
219 acpi_format_exception(status));
220 }
221
222 va_start(arg_list, format);
223 acpi_os_vprintf(format, arg_list);
224 ACPI_MSG_SUFFIX;
225 va_end(arg_list);
226
227 ACPI_MSG_REDIRECT_END;
228}
229
230ACPI_EXPORT_SYMBOL(acpi_bios_exception)
231
232/*******************************************************************************
233 *
190 * FUNCTION: acpi_bios_warning 234 * FUNCTION: acpi_bios_warning
191 * 235 *
192 * PARAMETERS: module_name - Caller's module name (for warning output) 236 * PARAMETERS: module_name - Caller's module name (for warning output)
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 6db9a6d40c85..93a280703318 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -201,6 +201,7 @@
201#define ACPI_EXCEPTION(plist) acpi_exception plist 201#define ACPI_EXCEPTION(plist) acpi_exception plist
202#define ACPI_ERROR(plist) acpi_error plist 202#define ACPI_ERROR(plist) acpi_error plist
203#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist 203#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
204#define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
204#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist 205#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
205#define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i) 206#define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i)
206 207
@@ -213,6 +214,7 @@
213#define ACPI_EXCEPTION(plist) 214#define ACPI_EXCEPTION(plist)
214#define ACPI_ERROR(plist) 215#define ACPI_ERROR(plist)
215#define ACPI_BIOS_WARNING(plist) 216#define ACPI_BIOS_WARNING(plist)
217#define ACPI_BIOS_EXCEPTION(plist)
216#define ACPI_BIOS_ERROR(plist) 218#define ACPI_BIOS_ERROR(plist)
217#define ACPI_DEBUG_OBJECT(obj,l,i) 219#define ACPI_DEBUG_OBJECT(obj,l,i)
218 220
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 7aa38b648564..f0adda015fc7 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -903,6 +903,12 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
903 acpi_bios_error(const char *module_name, 903 acpi_bios_error(const char *module_name,
904 u32 line_number, 904 u32 line_number,
905 const char *format, ...)) 905 const char *format, ...))
906ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
907 void ACPI_INTERNAL_VAR_XFACE
908 acpi_bios_exception(const char *module_name,
909 u32 line_number,
910 acpi_status status,
911 const char *format, ...))
906ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 912ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
907 void ACPI_INTERNAL_VAR_XFACE 913 void ACPI_INTERNAL_VAR_XFACE
908 acpi_bios_warning(const char *module_name, 914 acpi_bios_warning(const char *module_name,