Skip to content

Commit

Permalink
Merge branches 'acpi-tables', 'acpi-debug', 'acpi-doc' and 'acpi-misc'
Browse files Browse the repository at this point in the history
* acpi-tables:
  ACPI: tables: Simplify PPTT leaf node detection

* acpi-debug:
  ACPI: sysfs: Prevent get_status() from returning acpi_status

* acpi-doc:
  ACPI: Documentation: Fix path for acpidbg tool

* acpi-misc:
  ACPI / configfs: Mark local data structures static
  ACPI / configfs: Mark local functions static
  • Loading branch information
rafaeljw committed Mar 14, 2019
5 parents f16eb8a + 4909e6d + 3fd16d7 + 666dccf + bf567dd commit b6e8811
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Documentation/acpi/aml-debugger.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kernel.

The resultant userspace tool binary is then located at:

tools/acpi/power/acpi/acpidbg/acpidbg
tools/power/acpi/acpidbg

It can be installed to system directories by running "make install" (as a
sufficiently privileged user).
Expand All @@ -35,7 +35,7 @@ kernel.

# mount -t debugfs none /sys/kernel/debug
# modprobe acpi_dbg
# tools/acpi/power/acpi/acpidbg/acpidbg
# tools/power/acpi/acpidbg

That spawns the interactive AML debugger environment where you can execute
debugger commands.
Expand Down
25 changes: 13 additions & 12 deletions drivers/acpi/acpi_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ static ssize_t acpi_table_aml_read(struct config_item *cfg,

CONFIGFS_BIN_ATTR(acpi_table_, aml, NULL, MAX_ACPI_TABLE_SIZE);

struct configfs_bin_attribute *acpi_table_bin_attrs[] = {
static struct configfs_bin_attribute *acpi_table_bin_attrs[] = {
&acpi_table_attr_aml,
NULL,
};

ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -112,7 +112,7 @@ ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->signature);
}

ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -122,7 +122,7 @@ ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
return sprintf(str, "%d\n", h->length);
}

ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -132,7 +132,7 @@ ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
return sprintf(str, "%d\n", h->revision);
}

ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -142,7 +142,7 @@ ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
return sprintf(str, "%.*s\n", ACPI_OEM_ID_SIZE, h->oem_id);
}

ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -152,7 +152,7 @@ ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
return sprintf(str, "%.*s\n", ACPI_OEM_TABLE_ID_SIZE, h->oem_table_id);
}

ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -162,7 +162,8 @@ ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
return sprintf(str, "%d\n", h->oem_revision);
}

ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg,
char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -172,8 +173,8 @@ ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->asl_compiler_id);
}

ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
char *str)
static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
char *str)
{
struct acpi_table_header *h = get_header(cfg);

Expand All @@ -192,7 +193,7 @@ CONFIGFS_ATTR_RO(acpi_table_, oem_revision);
CONFIGFS_ATTR_RO(acpi_table_, asl_compiler_id);
CONFIGFS_ATTR_RO(acpi_table_, asl_compiler_revision);

struct configfs_attribute *acpi_table_attrs[] = {
static struct configfs_attribute *acpi_table_attrs[] = {
&acpi_table_attr_signature,
&acpi_table_attr_length,
&acpi_table_attr_revision,
Expand Down Expand Up @@ -232,7 +233,7 @@ static void acpi_table_drop_item(struct config_group *group,
acpi_tb_unload_table(table->index);
}

struct configfs_group_operations acpi_table_group_ops = {
static struct configfs_group_operations acpi_table_group_ops = {
.make_item = acpi_table_make_item,
.drop_item = acpi_table_drop_item,
};
Expand Down
3 changes: 3 additions & 0 deletions drivers/acpi/pptt.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
struct acpi_pptt_processor *cpu_node;
u32 proc_sz;

if (table_hdr->revision > 1)
return (node->flags & ACPI_PPTT_ACPI_LEAF_NODE);

table_end = (unsigned long)table_hdr + table_hdr->length;
node_entry = ACPI_PTR_DIFF(node, table_hdr);
entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
Expand Down
21 changes: 12 additions & 9 deletions drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,26 +648,29 @@ static void acpi_global_event_handler(u32 event_type, acpi_handle device,
}
}

static int get_status(u32 index, acpi_event_status *status,
static int get_status(u32 index, acpi_event_status *ret,
acpi_handle *handle)
{
int result;
acpi_status status;

if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
return -EINVAL;

if (index < num_gpes) {
result = acpi_get_gpe_device(index, handle);
if (result) {
status = acpi_get_gpe_device(index, handle);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
"Invalid GPE 0x%x", index));
return result;
return -ENXIO;
}
result = acpi_get_gpe_status(*handle, index, status);
} else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
result = acpi_get_event_status(index - num_gpes, status);
status = acpi_get_gpe_status(*handle, index, ret);
} else {
status = acpi_get_event_status(index - num_gpes, ret);
}
if (ACPI_FAILURE(status))
return -EIO;

return result;
return 0;
}

static ssize_t counter_show(struct kobject *kobj,
Expand Down

0 comments on commit b6e8811

Please sign in to comment.