Skip to content

Commit 6d90508

Browse files
committed
Merge tag 'acpi-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: - Update the ACPICA code in the kernel to the 20200214 upstream release including: * Fix to re-enable the sleep button after wakeup (Anchal Agarwal). * Fixes for mistakes in comments and typos (Bob Moore). * ASL-ASL+ converter updates (Erik Kaneda). * Type casting cleanups (Sven Barth). - Clean up the intialization of the EC driver and eliminate some dead code from it (Rafael Wysocki). - Clean up the quirk tables in the AC and battery drivers (Hans de Goede). - Fix the global lock handling on x86 to ignore unspecified bit positions in the global lock field (Jan Engelhardt). - Add a new "tiny" driver for ACPI button devices exposed by VMs to guest kernels to send signals directly to init (Josh Triplett). - Add a kernel parameter to disable ACPI BGRT on x86 (Alex Hung). - Make the ACPI PCI host bridge and fan drivers use scnprintf() to avoid potential buffer overflows (Takashi Iwai). - Clean up assorted pieces of code: * Reorder "asmlinkage" to make g++ happy (Alexey Dobriyan). * Drop unneeded variable initialization (Colin Ian King). * Add missing __acquires/__releases annotations (Jules Irenge). * Replace list_for_each_safe() with list_for_each_entry_safe() (chenqiwu)" * tag 'acpi-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (31 commits) ACPICA: Update version to 20200214 ACPI: PCI: Use scnprintf() for avoiding potential buffer overflow ACPI: fan: Use scnprintf() for avoiding potential buffer overflow ACPI: EC: Eliminate EC_FLAGS_QUERY_HANDSHAKE ACPI: EC: Do not clear boot_ec_is_ecdt in acpi_ec_add() ACPI: EC: Simplify acpi_ec_ecdt_start() and acpi_ec_init() ACPI: EC: Consolidate event handler installation code acpi/x86: ignore unspecified bit positions in the ACPI global lock field acpi/x86: add a kernel parameter to disable ACPI BGRT x86/acpi: make "asmlinkage" part first thing in the function definition ACPI: list_for_each_safe() -> list_for_each_entry_safe() ACPI: video: remove redundant assignments to variable result ACPI: OSL: Add missing __acquires/__releases annotations ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry ACPI / AC: Cleanup DMI quirk table ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC ACPI: EC: Simplify acpi_ec_add() ACPI: EC: Drop AE_NOT_FOUND special case from ec_install_handlers() ACPI: EC: Avoid passing redundant argument to functions ACPI: EC: Avoid printing confusing messages in acpi_ec_setup() ...
2 parents 49835c1 + 1da28f0 commit 6d90508

29 files changed

+298
-260
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@
450450
bert_disable [ACPI]
451451
Disable BERT OS support on buggy BIOSes.
452452

453+
bgrt_disable [ACPI][X86]
454+
Disable BGRT to avoid flickering OEM logo.
455+
453456
bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards)
454457
bttv.radio= Most important insmod options are available as
455458
kernel args too.

arch/x86/kernel/acpi/boot.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ EXPORT_SYMBOL(acpi_disabled);
4545
#define PREFIX "ACPI: "
4646

4747
int acpi_noirq; /* skip ACPI IRQ initialization */
48+
int acpi_nobgrt; /* skip ACPI BGRT */
4849
int acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */
4950
EXPORT_SYMBOL(acpi_pci_disabled);
5051

@@ -1619,7 +1620,7 @@ int __init acpi_boot_init(void)
16191620
acpi_process_madt();
16201621

16211622
acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet);
1622-
if (IS_ENABLED(CONFIG_ACPI_BGRT))
1623+
if (IS_ENABLED(CONFIG_ACPI_BGRT) && !acpi_nobgrt)
16231624
acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);
16241625

16251626
if (!acpi_noirq)
@@ -1671,6 +1672,13 @@ static int __init parse_acpi(char *arg)
16711672
}
16721673
early_param("acpi", parse_acpi);
16731674

1675+
static int __init parse_acpi_bgrt(char *arg)
1676+
{
1677+
acpi_nobgrt = true;
1678+
return 0;
1679+
}
1680+
early_param("bgrt_disable", parse_acpi_bgrt);
1681+
16741682
/* FIXME: Using pci= for an ACPI parameter is a travesty. */
16751683
static int __init parse_pci(char *arg)
16761684
{
@@ -1740,7 +1748,7 @@ int __acpi_acquire_global_lock(unsigned int *lock)
17401748
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
17411749
val = cmpxchg(lock, old, new);
17421750
} while (unlikely (val != old));
1743-
return (new < 3) ? -1 : 0;
1751+
return ((new & 0x3) < 3) ? -1 : 0;
17441752
}
17451753

17461754
int __acpi_release_global_lock(unsigned int *lock)

arch/x86/kernel/acpi/sleep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ unsigned long acpi_get_wakeup_address(void)
4343
*
4444
* Wrapper around acpi_enter_sleep_state() to be called by assmebly.
4545
*/
46-
acpi_status asmlinkage __visible x86_acpi_enter_sleep_state(u8 state)
46+
asmlinkage acpi_status __visible x86_acpi_enter_sleep_state(u8 state)
4747
{
4848
return acpi_enter_sleep_state(state);
4949
}

arch/x86/kernel/acpi/sleep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ extern void do_suspend_lowlevel(void);
1919

2020
extern int x86_acpi_suspend_lowlevel(void);
2121

22-
acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state);
22+
asmlinkage acpi_status x86_acpi_enter_sleep_state(u8 state);

drivers/acpi/Kconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,30 @@ config ACPI_BUTTON
190190
To compile this driver as a module, choose M here:
191191
the module will be called button.
192192

193+
config ACPI_TINY_POWER_BUTTON
194+
tristate "Tiny Power Button Driver"
195+
depends on !ACPI_BUTTON
196+
help
197+
This driver provides a tiny alternative to the ACPI Button driver.
198+
The tiny power button driver only handles the power button. Rather
199+
than notifying userspace via the input layer or a netlink event, this
200+
driver directly signals the init process to shut down.
201+
202+
This driver is particularly suitable for cloud and VM environments,
203+
which use a simulated power button to initiate a controlled poweroff,
204+
but which may not want to run a separate userspace daemon to process
205+
input events.
206+
207+
config ACPI_TINY_POWER_BUTTON_SIGNAL
208+
int "Tiny Power Button Signal"
209+
depends on ACPI_TINY_POWER_BUTTON
210+
default 38
211+
help
212+
Default signal to send to init in response to the power button.
213+
214+
Likely values here include 38 (SIGRTMIN+4) to power off, or 2
215+
(SIGINT) to simulate Ctrl+Alt+Del.
216+
193217
config ACPI_VIDEO
194218
tristate "Video"
195219
depends on X86 && BACKLIGHT_CLASS_DEVICE

drivers/acpi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ obj-$(CONFIG_ACPI_IPMI) += acpi_ipmi.o
7171

7272
obj-$(CONFIG_ACPI_AC) += ac.o
7373
obj-$(CONFIG_ACPI_BUTTON) += button.o
74+
obj-$(CONFIG_ACPI_TINY_POWER_BUTTON) += tiny-power-button.o
7475
obj-$(CONFIG_ACPI_FAN) += fan.o
7576
obj-$(CONFIG_ACPI_VIDEO) += video.o
7677
obj-$(CONFIG_ACPI_TAD) += acpi_tad.o

drivers/acpi/ac.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,29 +293,30 @@ static int __init ac_do_not_check_pmic_quirk(const struct dmi_system_id *d)
293293
return 0;
294294
}
295295

296+
/* Please keep this list alphabetically sorted */
296297
static const struct dmi_system_id ac_dmi_table[] __initconst = {
297298
{
298-
/* Thinkpad e530 */
299-
.callback = thinkpad_e530_quirk,
300-
.matches = {
301-
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
302-
DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"),
299+
/* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
300+
.callback = ac_do_not_check_pmic_quirk,
301+
.matches = {
302+
DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
303303
},
304304
},
305305
{
306-
/* ECS EF20EA */
306+
/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
307307
.callback = ac_do_not_check_pmic_quirk,
308308
.matches = {
309-
DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
309+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
310+
DMI_MATCH(DMI_PRODUCT_NAME, "80XF"),
311+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
310312
},
311313
},
312314
{
313-
/* Lenovo Ideapad Miix 320 */
314-
.callback = ac_do_not_check_pmic_quirk,
315+
/* Lenovo Thinkpad e530, see comment in acpi_ac_notify() */
316+
.callback = thinkpad_e530_quirk,
315317
.matches = {
316-
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
317-
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"),
318-
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
318+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
319+
DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"),
319320
},
320321
},
321322
{},

drivers/acpi/acpi_video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
943943
int i, max_level = 0;
944944
unsigned long long level, level_old;
945945
struct acpi_video_device_brightness *br = NULL;
946-
int result = -EINVAL;
946+
int result;
947947

948948
result = acpi_video_get_levels(device->dev, &br, &max_level);
949949
if (result)

drivers/acpi/acpica/acconvert.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ void cg_write_aml_comment(union acpi_parse_object *op);
6565
/*
6666
* cvparser
6767
*/
68-
void
69-
cv_init_file_tree(struct acpi_table_header *table,
70-
u8 *aml_start, u32 aml_length);
68+
void cv_init_file_tree(struct acpi_table_header *table, FILE * root_file);
7169

7270
void cv_clear_op_comments(union acpi_parse_object *op);
7371

drivers/acpi/acpica/acmacros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@
477477
#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) cv_print_one_comment_type (a,b,c,d);
478478
#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) cv_print_one_comment_list (a,b);
479479
#define ASL_CV_FILE_HAS_SWITCHED(a) cv_file_has_switched(a)
480-
#define ASL_CV_INIT_FILETREE(a,b,c) cv_init_file_tree(a,b,c);
480+
#define ASL_CV_INIT_FILETREE(a,b) cv_init_file_tree(a,b);
481481

482482
#else
483483

@@ -492,7 +492,7 @@
492492
#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d)
493493
#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b)
494494
#define ASL_CV_FILE_HAS_SWITCHED(a) 0
495-
#define ASL_CV_INIT_FILETREE(a,b,c)
495+
#define ASL_CV_INIT_FILETREE(a,b)
496496

497497
#endif
498498

drivers/acpi/acpica/evevent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
130130

131131
/*
132132
* Initialize the structure that keeps track of fixed event handlers and
133-
* enable the fixed events.
133+
* disable all of the fixed events.
134134
*/
135135
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
136136
acpi_gbl_fixed_event_handlers[i].handler = NULL;

drivers/acpi/acpica/hwsleep.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
300300
[ACPI_EVENT_POWER_BUTTON].
301301
status_register_id, ACPI_CLEAR_STATUS);
302302

303+
/* Enable sleep button */
304+
305+
(void)
306+
acpi_write_bit_register(acpi_gbl_fixed_event_info
307+
[ACPI_EVENT_SLEEP_BUTTON].
308+
enable_register_id, ACPI_ENABLE_EVENT);
309+
310+
(void)
311+
acpi_write_bit_register(acpi_gbl_fixed_event_info
312+
[ACPI_EVENT_SLEEP_BUTTON].
313+
status_register_id, ACPI_CLEAR_STATUS);
314+
303315
acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
304316
return_ACPI_STATUS(status);
305317
}

drivers/acpi/acpica/nsnames.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,
164164
/* Build the path in the caller buffer */
165165

166166
(void)acpi_ns_build_normalized_path(node, buffer->pointer,
167-
required_size, no_trailing);
167+
(u32)required_size, no_trailing);
168168

169169
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
170170
(char *)buffer->pointer, (u32) required_size));
@@ -315,7 +315,7 @@ char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node,
315315

316316
/* Build the path in the allocated buffer */
317317

318-
(void)acpi_ns_build_normalized_path(node, name_buffer, size,
318+
(void)acpi_ns_build_normalized_path(node, name_buffer, (u32)size,
319319
no_trailing);
320320

321321
ACPI_DEBUG_PRINT_RAW((ACPI_DB_NAMES, "%s: Path \"%s\"\n",
@@ -346,7 +346,7 @@ char *acpi_ns_build_prefixed_pathname(union acpi_generic_state *prefix_scope,
346346
char *full_path = NULL;
347347
char *external_path = NULL;
348348
char *prefix_path = NULL;
349-
u32 prefix_path_length = 0;
349+
acpi_size prefix_path_length = 0;
350350

351351
/* If there is a prefix, get the pathname to it */
352352

drivers/acpi/acpica/nsxfname.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ acpi_status acpi_install_method(u8 *buffer)
516516

517517
method_flags = *parser_state.aml++;
518518
aml_start = parser_state.aml;
519-
aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start);
519+
aml_length = (u32)ACPI_PTR_DIFF(parser_state.pkg_end, aml_start);
520520

521521
/*
522522
* Allocate resources up-front. We don't want to have to delete a new

drivers/acpi/acpica/tbxface.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ ACPI_EXPORT_SYMBOL_INIT(acpi_reallocate_root_table)
202202
*
203203
* PARAMETERS: signature - ACPI signature of needed table
204204
* instance - Which instance (for SSDTs)
205-
* out_table_header - The pointer to the table header to fill
205+
* out_table_header - The pointer to the where the table header
206+
* is returned
206207
*
207-
* RETURN: Status and pointer to mapped table header
208+
* RETURN: Status and a copy of the table header
208209
*
209-
* DESCRIPTION: Finds an ACPI table header.
210-
*
211-
* NOTE: Caller is responsible in unmapping the header with
212-
* acpi_os_unmap_memory
210+
* DESCRIPTION: Finds and returns an ACPI table header. Caller provides the
211+
* memory where a copy of the header is to be returned
212+
* (fixed length).
213213
*
214214
******************************************************************************/
215215
acpi_status

drivers/acpi/acpica/utobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ acpi_ut_get_element_length(u8 object_type,
4444
*
4545
* NOTE: We always allocate the worst-case object descriptor because
4646
* these objects are cached, and we want them to be
47-
* one-size-satisifies-any-request. This in itself may not be
47+
* one-size-satisfies-any-request. This in itself may not be
4848
* the most memory efficient, but the efficiency of the object
4949
* cache should more than make up for this!
5050
*

drivers/acpi/battery.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,19 +1365,19 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
13651365
},
13661366
},
13671367
{
1368-
/* ECS EF20EA */
1368+
/* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
13691369
.callback = battery_do_not_check_pmic_quirk,
13701370
.matches = {
13711371
DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
13721372
},
13731373
},
13741374
{
1375-
/* Lenovo Ideapad Miix 320 */
1375+
/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
13761376
.callback = battery_do_not_check_pmic_quirk,
13771377
.matches = {
1378-
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1379-
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"),
1380-
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
1378+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1379+
DMI_MATCH(DMI_PRODUCT_NAME, "80XF"),
1380+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
13811381
},
13821382
},
13831383
{},

drivers/acpi/button.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@
3030
#define ACPI_BUTTON_NOTIFY_STATUS 0x80
3131

3232
#define ACPI_BUTTON_SUBCLASS_POWER "power"
33-
#define ACPI_BUTTON_HID_POWER "PNP0C0C"
3433
#define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button"
3534
#define ACPI_BUTTON_TYPE_POWER 0x01
3635

3736
#define ACPI_BUTTON_SUBCLASS_SLEEP "sleep"
38-
#define ACPI_BUTTON_HID_SLEEP "PNP0C0E"
3937
#define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button"
4038
#define ACPI_BUTTON_TYPE_SLEEP 0x03
4139

4240
#define ACPI_BUTTON_SUBCLASS_LID "lid"
43-
#define ACPI_BUTTON_HID_LID "PNP0C0D"
4441
#define ACPI_BUTTON_DEVICE_NAME_LID "Lid Switch"
4542
#define ACPI_BUTTON_TYPE_LID 0x05
4643

0 commit comments

Comments
 (0)