Skip to content

Commit 3b319ee

Browse files
committed
Merge tag 'acpi-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI updates from Rafael Wysocki: "These fix a couple of issues and do some cleanups on top of the previous ACPI changes for 5.1-rc1. Specifics: - Fix a crash caused by unloading an SSDT overlay (Andy Shevchenko) - Prevent user space from getting confusing error values on failing ACPI sysfs accesses (Rafael Wysocki) - Simplify leaf node detection in the PPTT parsing code by using a new flag defined in ACPI 6.3 (Jeremy Linton) - Add missing "static" in some places in the ACPI configfs code (Andy Shevchenko) - Fix acpidbg tool path in the ACPI documentation (Flavio Suligoi)" * tag 'acpi-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: sysfs: Prevent get_status() from returning acpi_status ACPI / device_sysfs: Avoid OF modalias creation for removed device ACPI / configfs: Mark local data structures static ACPI / configfs: Mark local functions static ACPI: tables: Simplify PPTT leaf node detection ACPI: Documentation: Fix path for acpidbg tool
2 parents 9352ca5 + b6e8811 commit 3b319ee

File tree

5 files changed

+35
-24
lines changed

5 files changed

+35
-24
lines changed

Documentation/acpi/aml-debugger.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ kernel.
2323

2424
The resultant userspace tool binary is then located at:
2525

26-
tools/acpi/power/acpi/acpidbg/acpidbg
26+
tools/power/acpi/acpidbg
2727

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

3636
# mount -t debugfs none /sys/kernel/debug
3737
# modprobe acpi_dbg
38-
# tools/acpi/power/acpi/acpidbg/acpidbg
38+
# tools/power/acpi/acpidbg
3939

4040
That spawns the interactive AML debugger environment where you can execute
4141
debugger commands.

drivers/acpi/acpi_configfs.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ static ssize_t acpi_table_aml_read(struct config_item *cfg,
9797

9898
CONFIGFS_BIN_ATTR(acpi_table_, aml, NULL, MAX_ACPI_TABLE_SIZE);
9999

100-
struct configfs_bin_attribute *acpi_table_bin_attrs[] = {
100+
static struct configfs_bin_attribute *acpi_table_bin_attrs[] = {
101101
&acpi_table_attr_aml,
102102
NULL,
103103
};
104104

105-
ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
105+
static ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
106106
{
107107
struct acpi_table_header *h = get_header(cfg);
108108

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

115-
ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
115+
static ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
116116
{
117117
struct acpi_table_header *h = get_header(cfg);
118118

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

125-
ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
125+
static ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
126126
{
127127
struct acpi_table_header *h = get_header(cfg);
128128

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

135-
ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
135+
static ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
136136
{
137137
struct acpi_table_header *h = get_header(cfg);
138138

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

145-
ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
145+
static ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
146146
{
147147
struct acpi_table_header *h = get_header(cfg);
148148

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

155-
ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
155+
static ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
156156
{
157157
struct acpi_table_header *h = get_header(cfg);
158158

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

165-
ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, char *str)
165+
static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg,
166+
char *str)
166167
{
167168
struct acpi_table_header *h = get_header(cfg);
168169

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

175-
ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
176-
char *str)
176+
static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
177+
char *str)
177178
{
178179
struct acpi_table_header *h = get_header(cfg);
179180

@@ -192,7 +193,7 @@ CONFIGFS_ATTR_RO(acpi_table_, oem_revision);
192193
CONFIGFS_ATTR_RO(acpi_table_, asl_compiler_id);
193194
CONFIGFS_ATTR_RO(acpi_table_, asl_compiler_revision);
194195

195-
struct configfs_attribute *acpi_table_attrs[] = {
196+
static struct configfs_attribute *acpi_table_attrs[] = {
196197
&acpi_table_attr_signature,
197198
&acpi_table_attr_length,
198199
&acpi_table_attr_revision,
@@ -232,7 +233,7 @@ static void acpi_table_drop_item(struct config_group *group,
232233
acpi_tb_unload_table(table->index);
233234
}
234235

235-
struct configfs_group_operations acpi_table_group_ops = {
236+
static struct configfs_group_operations acpi_table_group_ops = {
236237
.make_item = acpi_table_make_item,
237238
.drop_item = acpi_table_drop_item,
238239
};

drivers/acpi/device_sysfs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,15 @@ static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias,
202202
{
203203
struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER };
204204
const union acpi_object *of_compatible, *obj;
205+
acpi_status status;
205206
int len, count;
206207
int i, nval;
207208
char *c;
208209

209-
acpi_get_name(acpi_dev->handle, ACPI_SINGLE_NAME, &buf);
210+
status = acpi_get_name(acpi_dev->handle, ACPI_SINGLE_NAME, &buf);
211+
if (ACPI_FAILURE(status))
212+
return -ENODEV;
213+
210214
/* DT strings are all in lower case */
211215
for (c = buf.pointer; *c != '\0'; c++)
212216
*c = tolower(*c);

drivers/acpi/pptt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
209209
struct acpi_pptt_processor *cpu_node;
210210
u32 proc_sz;
211211

212+
if (table_hdr->revision > 1)
213+
return (node->flags & ACPI_PPTT_ACPI_LEAF_NODE);
214+
212215
table_end = (unsigned long)table_hdr + table_hdr->length;
213216
node_entry = ACPI_PTR_DIFF(node, table_hdr);
214217
entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,

drivers/acpi/sysfs.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -648,26 +648,29 @@ static void acpi_global_event_handler(u32 event_type, acpi_handle device,
648648
}
649649
}
650650

651-
static int get_status(u32 index, acpi_event_status *status,
651+
static int get_status(u32 index, acpi_event_status *ret,
652652
acpi_handle *handle)
653653
{
654-
int result;
654+
acpi_status status;
655655

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

659659
if (index < num_gpes) {
660-
result = acpi_get_gpe_device(index, handle);
661-
if (result) {
660+
status = acpi_get_gpe_device(index, handle);
661+
if (ACPI_FAILURE(status)) {
662662
ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
663663
"Invalid GPE 0x%x", index));
664-
return result;
664+
return -ENXIO;
665665
}
666-
result = acpi_get_gpe_status(*handle, index, status);
667-
} else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
668-
result = acpi_get_event_status(index - num_gpes, status);
666+
status = acpi_get_gpe_status(*handle, index, ret);
667+
} else {
668+
status = acpi_get_event_status(index - num_gpes, ret);
669+
}
670+
if (ACPI_FAILURE(status))
671+
return -EIO;
669672

670-
return result;
673+
return 0;
671674
}
672675

673676
static ssize_t counter_show(struct kobject *kobj,

0 commit comments

Comments
 (0)