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

0 commit comments

Comments
 (0)