Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Moore and committed by
Rafael J. Wysocki
f13c274d 1c7fc5cb

+64 -11
+8 -7
drivers/acpi/acpica/dsopcode.c
··· 130 130 /* Must have a valid (>0) bit count */ 131 131 132 132 if (bit_count == 0) { 133 - ACPI_ERROR((AE_INFO, 134 - "Attempt to CreateField of length zero")); 133 + ACPI_BIOS_ERROR((AE_INFO, 134 + "Attempt to CreateField of length zero")); 135 135 status = AE_AML_OPERAND_VALUE; 136 136 goto cleanup; 137 137 } ··· 194 194 /* Entire field must fit within the current length of the buffer */ 195 195 196 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 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 204 goto cleanup; 204 205 } 205 206
+4 -4
drivers/acpi/acpica/exoparg2.c
··· 390 390 /* Failure means that the Index was beyond the end of the object */ 391 391 392 392 if (ACPI_FAILURE(status)) { 393 - ACPI_EXCEPTION((AE_INFO, status, 394 - "Index (0x%X%8.8X) is beyond end of object (length 0x%X)", 395 - ACPI_FORMAT_UINT64(index), 396 - (u32)length)); 393 + ACPI_BIOS_EXCEPTION((AE_INFO, status, 394 + "Index (0x%X%8.8X) is beyond end of object (length 0x%X)", 395 + ACPI_FORMAT_UINT64(index), 396 + (u32)length)); 397 397 goto cleanup; 398 398 } 399 399
+44
drivers/acpi/acpica/utxferror.c
··· 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 + ******************************************************************************/ 203 + void ACPI_INTERNAL_VAR_XFACE 204 + acpi_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 + 230 + ACPI_EXPORT_SYMBOL(acpi_bios_exception) 231 + 232 + /******************************************************************************* 233 + * 190 234 * FUNCTION: acpi_bios_warning 191 235 * 192 236 * PARAMETERS: module_name - Caller's module name (for warning output)
+2
include/acpi/acoutput.h
··· 201 201 #define ACPI_EXCEPTION(plist) acpi_exception plist 202 202 #define ACPI_ERROR(plist) acpi_error plist 203 203 #define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist 204 + #define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist 204 205 #define ACPI_BIOS_ERROR(plist) acpi_bios_error plist 205 206 #define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i) 206 207 ··· 214 213 #define ACPI_EXCEPTION(plist) 215 214 #define ACPI_ERROR(plist) 216 215 #define ACPI_BIOS_WARNING(plist) 216 + #define ACPI_BIOS_EXCEPTION(plist) 217 217 #define ACPI_BIOS_ERROR(plist) 218 218 #define ACPI_DEBUG_OBJECT(obj,l,i) 219 219
+6
include/acpi/acpixf.h
··· 903 903 acpi_bios_error(const char *module_name, 904 904 u32 line_number, 905 905 const char *format, ...)) 906 + ACPI_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, ...)) 906 912 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 907 913 void ACPI_INTERNAL_VAR_XFACE 908 914 acpi_bios_warning(const char *module_name,