Skip to content

Commit ba609f7

Browse files
committed
Merge branch 'acpica'
* acpica: ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks ACPICA: Update version to 20180508 ACPICA: acpidump/acpixtract: Support for tables larger than 1MB ACPICA: Update version to 20180427 ACPICA: Debugger: Removed direct support for EC address space in "Test Objects" ACPICA: Debugger: Add Package support for "test objects" command ACPICA: Improve error messages for the namespace root node ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list ACPICA: vsnprintf: this statement may fall through ACPICA: Tables: Fix spelling mistake in comment ACPICA: iASL: Enhance the -tc option (create AML hex file in C) ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock ACPICA: provide abstraction for raw_spinlock_t
2 parents 5a802a7 + 087ec15 commit ba609f7

File tree

20 files changed

+151
-26
lines changed

20 files changed

+151
-26
lines changed

drivers/acpi/acpica/acapps.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ acpi_status
143143
fl_split_input_pathname(char *input_path,
144144
char **out_directory_path, char **out_filename);
145145

146+
char *fl_get_file_basename(char *file_pathname);
147+
146148
char *ad_generate_filename(char *prefix, char *table_id);
147149

148150
void

drivers/acpi/acpica/acglobal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ACPI_GLOBAL(u8, acpi_gbl_global_lock_pending);
8282
* interrupt level
8383
*/
8484
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_gpe_lock); /* For GPE data structs and registers */
85-
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_hardware_lock); /* For ACPI H/W except GPE registers */
85+
ACPI_GLOBAL(acpi_raw_spinlock, acpi_gbl_hardware_lock); /* For ACPI H/W except GPE registers */
8686
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock);
8787

8888
/* Mutex for _OSI support */

drivers/acpi/acpica/dbnames.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,15 @@ void acpi_db_dump_namespace(char *start_arg, char *depth_arg)
189189
}
190190

191191
acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT);
192-
acpi_os_printf("ACPI Namespace (from %4.4s (%p) subtree):\n",
193-
((struct acpi_namespace_node *)subtree_entry)->name.
194-
ascii, subtree_entry);
192+
193+
if (((struct acpi_namespace_node *)subtree_entry)->parent) {
194+
acpi_os_printf("ACPI Namespace (from %4.4s (%p) subtree):\n",
195+
((struct acpi_namespace_node *)subtree_entry)->
196+
name.ascii, subtree_entry);
197+
} else {
198+
acpi_os_printf("ACPI Namespace (from %s):\n",
199+
ACPI_NAMESPACE_ROOT);
200+
}
195201

196202
/* Display the subtree */
197203

drivers/acpi/acpica/dbtest.c

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length);
3030
static acpi_status
3131
acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
3232

33+
static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node);
34+
3335
static acpi_status
3436
acpi_db_read_from_object(struct acpi_namespace_node *node,
3537
acpi_object_type expected_type,
@@ -273,6 +275,11 @@ acpi_db_test_one_object(acpi_handle obj_handle,
273275
bit_length = byte_length * 8;
274276
break;
275277

278+
case ACPI_TYPE_PACKAGE:
279+
280+
local_type = ACPI_TYPE_PACKAGE;
281+
break;
282+
276283
case ACPI_TYPE_FIELD_UNIT:
277284
case ACPI_TYPE_BUFFER_FIELD:
278285
case ACPI_TYPE_LOCAL_REGION_FIELD:
@@ -305,6 +312,7 @@ acpi_db_test_one_object(acpi_handle obj_handle,
305312

306313
acpi_os_printf("%14s: %4.4s",
307314
acpi_ut_get_type_name(node->type), node->name.ascii);
315+
308316
if (!obj_desc) {
309317
acpi_os_printf(" Ignoring, no attached object\n");
310318
return (AE_OK);
@@ -322,14 +330,13 @@ acpi_db_test_one_object(acpi_handle obj_handle,
322330
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
323331
case ACPI_ADR_SPACE_SYSTEM_IO:
324332
case ACPI_ADR_SPACE_PCI_CONFIG:
325-
case ACPI_ADR_SPACE_EC:
326333

327334
break;
328335

329336
default:
330337

331338
acpi_os_printf
332-
(" %s space is not supported [%4.4s]\n",
339+
(" %s space is not supported in this command [%4.4s]\n",
333340
acpi_ut_get_region_name(region_obj->region.
334341
space_id),
335342
region_obj->region.node->name.ascii);
@@ -359,26 +366,40 @@ acpi_db_test_one_object(acpi_handle obj_handle,
359366
status = acpi_db_test_buffer_type(node, bit_length);
360367
break;
361368

369+
case ACPI_TYPE_PACKAGE:
370+
371+
status = acpi_db_test_package_type(node);
372+
break;
373+
362374
default:
363375

364376
acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
365377
local_type);
366378
break;
367379
}
368380

381+
/* Exit on error, but don't abort the namespace walk */
382+
383+
if (ACPI_FAILURE(status)) {
384+
status = AE_OK;
385+
goto exit;
386+
}
387+
369388
switch (node->type) {
370389
case ACPI_TYPE_LOCAL_REGION_FIELD:
371390

372391
region_obj = obj_desc->field.region_obj;
373392
acpi_os_printf(" (%s)",
374393
acpi_ut_get_region_name(region_obj->region.
375394
space_id));
395+
376396
break;
377397

378398
default:
379399
break;
380400
}
381401

402+
exit:
382403
acpi_os_printf("\n");
383404
return (status);
384405
}
@@ -431,7 +452,6 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
431452
if (temp1->integer.value == value_to_write) {
432453
value_to_write = 0;
433454
}
434-
435455
/* Write a new value */
436456

437457
write_value.type = ACPI_TYPE_INTEGER;
@@ -706,6 +726,35 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
706726
return (status);
707727
}
708728

729+
/*******************************************************************************
730+
*
731+
* FUNCTION: acpi_db_test_package_type
732+
*
733+
* PARAMETERS: node - Parent NS node for the object
734+
*
735+
* RETURN: Status
736+
*
737+
* DESCRIPTION: Test read for a Package object.
738+
*
739+
******************************************************************************/
740+
741+
static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node)
742+
{
743+
union acpi_object *temp1 = NULL;
744+
acpi_status status;
745+
746+
/* Read the original value */
747+
748+
status = acpi_db_read_from_object(node, ACPI_TYPE_PACKAGE, &temp1);
749+
if (ACPI_FAILURE(status)) {
750+
return (status);
751+
}
752+
753+
acpi_os_printf(" %8.8X Elements", temp1->package.count);
754+
acpi_os_free(temp1);
755+
return (status);
756+
}
757+
709758
/*******************************************************************************
710759
*
711760
* FUNCTION: acpi_db_read_from_object
@@ -746,8 +795,8 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
746795
acpi_gbl_method_executing = TRUE;
747796
status = acpi_evaluate_object(read_handle, NULL,
748797
&param_objects, &return_obj);
749-
acpi_gbl_method_executing = FALSE;
750798

799+
acpi_gbl_method_executing = FALSE;
751800
if (ACPI_FAILURE(status)) {
752801
acpi_os_printf("Could not read from object, %s",
753802
acpi_format_exception(status));
@@ -760,6 +809,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
760809
case ACPI_TYPE_INTEGER:
761810
case ACPI_TYPE_BUFFER:
762811
case ACPI_TYPE_STRING:
812+
case ACPI_TYPE_PACKAGE:
763813
/*
764814
* Did we receive the type we wanted? Most important for the
765815
* Integer/Buffer case (when a field is larger than an Integer,
@@ -771,6 +821,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
771821
acpi_ut_get_type_name(expected_type),
772822
acpi_ut_get_type_name(ret_value->type));
773823

824+
acpi_os_free(return_obj.pointer);
774825
return (AE_TYPE);
775826
}
776827

drivers/acpi/acpica/dswscope.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
115115
acpi_ut_get_type_name(old_scope_info->
116116
common.value)));
117117
} else {
118-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[\\___] (%s)", "ROOT"));
118+
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT));
119119
}
120120

121121
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
@@ -166,14 +166,14 @@ acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state)
166166

167167
new_scope_info = walk_state->scope_info;
168168
if (new_scope_info) {
169-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
170-
"[%4.4s] (%s)\n",
169+
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[%4.4s] (%s)\n",
171170
acpi_ut_get_node_name(new_scope_info->
172171
scope.node),
173172
acpi_ut_get_type_name(new_scope_info->
174173
common.value)));
175174
} else {
176-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "[\\___] (ROOT)\n"));
175+
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "%s\n",
176+
ACPI_NAMESPACE_ROOT));
177177
}
178178

179179
acpi_ut_delete_generic_state(scope_info);

drivers/acpi/acpica/hwregs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,14 @@ acpi_status acpi_hw_clear_acpi_status(void)
390390
ACPI_BITMASK_ALL_FIXED_STATUS,
391391
ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
392392

393-
lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
393+
lock_flags = acpi_os_acquire_raw_lock(acpi_gbl_hardware_lock);
394394

395395
/* Clear the fixed events in PM1 A/B */
396396

397397
status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
398398
ACPI_BITMASK_ALL_FIXED_STATUS);
399399

400-
acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
400+
acpi_os_release_raw_lock(acpi_gbl_hardware_lock, lock_flags);
401401

402402
if (ACPI_FAILURE(status)) {
403403
goto exit;

drivers/acpi/acpica/hwxface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value)
227227
return_ACPI_STATUS(AE_BAD_PARAMETER);
228228
}
229229

230-
lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
230+
lock_flags = acpi_os_acquire_raw_lock(acpi_gbl_hardware_lock);
231231

232232
/*
233233
* At this point, we know that the parent register is one of the
@@ -288,7 +288,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value)
288288

289289
unlock_and_exit:
290290

291-
acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
291+
acpi_os_release_raw_lock(acpi_gbl_hardware_lock, lock_flags);
292292
return_ACPI_STATUS(status);
293293
}
294294

drivers/acpi/acpica/rsdump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ static void acpi_rs_out_title(const char *title)
539539

540540
static void acpi_rs_dump_byte_list(u16 length, u8 * data)
541541
{
542-
u8 i;
542+
u16 i;
543543

544544
for (i = 0; i < length; i++) {
545545
acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);

drivers/acpi/acpica/tbinstal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ acpi_tb_install_table_with_override(struct acpi_table_desc *new_table_desc,
8888
* DESCRIPTION: This function is called to verify and install an ACPI table.
8989
* When this function is called by "Load" or "LoadTable" opcodes,
9090
* or by acpi_load_table() API, the "Reload" parameter is set.
91-
* After sucessfully returning from this function, table is
91+
* After successfully returning from this function, table is
9292
* "INSTALLED" but not "VALIDATED".
9393
*
9494
******************************************************************************/

drivers/acpi/acpica/utbuffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
5353

5454
/* Print current offset */
5555

56-
acpi_os_printf("%6.4X: ", (base_offset + i));
56+
acpi_os_printf("%8.4X: ", (base_offset + i));
5757

5858
/* Print 16 hex chars */
5959

@@ -219,7 +219,7 @@ acpi_ut_dump_buffer_to_file(ACPI_FILE file,
219219

220220
/* Print current offset */
221221

222-
fprintf(file, "%6.4X: ", (base_offset + i));
222+
fprintf(file, "%8.4X: ", (base_offset + i));
223223

224224
/* Print 16 hex chars */
225225

drivers/acpi/acpica/utmutex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ acpi_status acpi_ut_mutex_initialize(void)
5252
return_ACPI_STATUS (status);
5353
}
5454

55-
status = acpi_os_create_lock (&acpi_gbl_hardware_lock);
55+
status = acpi_os_create_raw_lock(&acpi_gbl_hardware_lock);
5656
if (ACPI_FAILURE (status)) {
5757
return_ACPI_STATUS (status);
5858
}
@@ -109,7 +109,7 @@ void acpi_ut_mutex_terminate(void)
109109
/* Delete the spinlocks */
110110

111111
acpi_os_delete_lock(acpi_gbl_gpe_lock);
112-
acpi_os_delete_lock(acpi_gbl_hardware_lock);
112+
acpi_os_delete_raw_lock(acpi_gbl_hardware_lock);
113113
acpi_os_delete_lock(acpi_gbl_reference_count_lock);
114114

115115
/* Delete the reader/writer lock */

drivers/acpi/acpica/utobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*****************************************************************************/
99

1010
#include <acpi/acpi.h>
11+
#include <linux/kmemleak.h>
1112
#include "accommon.h"
1213
#include "acnamesp.h"
1314

@@ -70,6 +71,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
7071
if (!object) {
7172
return_PTR(NULL);
7273
}
74+
kmemleak_not_leak(object);
7375

7476
switch (type) {
7577
case ACPI_TYPE_REGION:

drivers/acpi/acpica/utprint.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ int vsnprintf(char *string, acpi_size size, const char *format, va_list args)
470470
case 'X':
471471

472472
type |= ACPI_FORMAT_UPPER;
473+
/* FALLTHROUGH */
473474

474475
case 'x':
475476

drivers/acpi/acpica/utstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void acpi_ut_repair_name(char *name)
141141
* Special case for the root node. This can happen if we get an
142142
* error during the execution of module-level code.
143143
*/
144-
if (ACPI_COMPARE_NAME(name, "\\___")) {
144+
if (ACPI_COMPARE_NAME(name, ACPI_ROOT_PATHNAME)) {
145145
return;
146146
}
147147

include/acpi/acnames.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@
4949
/* Definitions of the predefined namespace names */
5050

5151
#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
52-
#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
53-
5452
#define ACPI_PREFIX_MIXED (u32) 0x69706341 /* "Acpi" */
5553
#define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */
5654

55+
/* Root name stuff */
56+
57+
#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
58+
#define ACPI_ROOT_PATHNAME "\\___"
59+
#define ACPI_NAMESPACE_ROOT "Namespace Root"
5760
#define ACPI_NS_ROOT_PATH "\\"
5861

5962
#endif /* __ACNAMES_H__ */

include/acpi/acpiosxf.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
9797
void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
9898
#endif
9999

100+
/*
101+
* RAW spinlock primitives. If the OS does not provide them, fallback to
102+
* spinlock primitives
103+
*/
104+
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_raw_lock
105+
# define acpi_os_create_raw_lock(out_handle) acpi_os_create_lock(out_handle)
106+
#endif
107+
108+
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_raw_lock
109+
# define acpi_os_delete_raw_lock(handle) acpi_os_delete_lock(handle)
110+
#endif
111+
112+
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_raw_lock
113+
# define acpi_os_acquire_raw_lock(handle) acpi_os_acquire_lock(handle)
114+
#endif
115+
116+
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_raw_lock
117+
# define acpi_os_release_raw_lock(handle, flags) \
118+
acpi_os_release_lock(handle, flags)
119+
#endif
120+
100121
/*
101122
* Semaphore primitives
102123
*/

include/acpi/acpixf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/* Current ACPICA subsystem version in YYYYMMDD format */
1414

15-
#define ACPI_CA_VERSION 0x20180313
15+
#define ACPI_CA_VERSION 0x20180508
1616

1717
#include <acpi/acconfig.h>
1818
#include <acpi/actypes.h>

0 commit comments

Comments
 (0)