Skip to content

Commit 18531f4

Browse files
committed
Merge tag 'acpi-6.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix an ACPI APEI error injection driver failure that started to occur after switching it over to using a faux device, address an EC driver issue related to invalid ECDT tables, clean up the usage of mwait_idle_with_hints() in the ACPI PAD driver, add a new IRQ override quirk, and fix a NULL pointer dereference related to nosmp: - Update the faux device handling code in the driver core and address an ACPI APEI error injection driver failure that started to occur after switching it over to using a faux device on top of that (Dan Williams) - Update data types of variables passed as arguments to mwait_idle_with_hints() in the ACPI PAD (processor aggregator device) driver to match the function definition after recent changes (Uros Bizjak) - Fix a NULL pointer dereference in the ACPI CPPC library that occurs when nosmp is passed to the kernel in the command line (Yunhui Cui) - Ignore ECDT tables with an invalid ID string to prevent using an incorrect GPE for signaling events on some systems (Armin Wolf) - Add a new IRQ override quirk for MACHENIKE 16P (Wentao Guan)" * tag 'acpi-6.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: resource: Use IRQ override on MACHENIKE 16P ACPI: EC: Ignore ECDT tables with an invalid ID string ACPI: CPPC: Fix NULL pointer dereference when nosmp is used ACPI: PAD: Update arguments of mwait_idle_with_hints() ACPI: APEI: EINJ: Do not fail einj_init() on faux_device_create() failure driver core: faux: Quiet probe failures driver core: faux: Suppress bind attributes
2 parents f688b59 + 28b0699 commit 18531f4

File tree

6 files changed

+31
-9
lines changed

6 files changed

+31
-9
lines changed

drivers/acpi/acpi_pad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
static DEFINE_MUTEX(isolated_cpus_lock);
3434
static DEFINE_MUTEX(round_robin_lock);
3535

36-
static unsigned long power_saving_mwait_eax;
36+
static unsigned int power_saving_mwait_eax;
3737

3838
static unsigned char tsc_detected_unstable;
3939
static unsigned char tsc_marked_unstable;

drivers/acpi/apei/einj-core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,19 +883,16 @@ static int __init einj_init(void)
883883
}
884884

885885
einj_dev = faux_device_create("acpi-einj", NULL, &einj_device_ops);
886-
if (!einj_dev)
887-
return -ENODEV;
888886

889-
einj_initialized = true;
887+
if (einj_dev)
888+
einj_initialized = true;
890889

891890
return 0;
892891
}
893892

894893
static void __exit einj_exit(void)
895894
{
896-
if (einj_initialized)
897-
faux_device_destroy(einj_dev);
898-
895+
faux_device_destroy(einj_dev);
899896
}
900897

901898
module_init(einj_init);

drivers/acpi/cppc_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ bool cppc_allow_fast_switch(void)
476476
struct cpc_desc *cpc_ptr;
477477
int cpu;
478478

479-
for_each_possible_cpu(cpu) {
479+
for_each_present_cpu(cpu) {
480480
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
481481
desired_reg = &cpc_ptr->cpc_regs[DESIRED_PERF];
482482
if (!CPC_IN_SYSTEM_MEMORY(desired_reg) &&

drivers/acpi/ec.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#include <linux/delay.h>
2424
#include <linux/interrupt.h>
2525
#include <linux/list.h>
26+
#include <linux/printk.h>
2627
#include <linux/spinlock.h>
2728
#include <linux/slab.h>
29+
#include <linux/string.h>
2830
#include <linux/suspend.h>
2931
#include <linux/acpi.h>
3032
#include <linux/dmi.h>
@@ -2031,6 +2033,21 @@ void __init acpi_ec_ecdt_probe(void)
20312033
goto out;
20322034
}
20332035

2036+
if (!strstarts(ecdt_ptr->id, "\\")) {
2037+
/*
2038+
* The ECDT table on some MSI notebooks contains invalid data, together
2039+
* with an empty ID string ("").
2040+
*
2041+
* Section 5.2.15 of the ACPI specification requires the ID string to be
2042+
* a "fully qualified reference to the (...) embedded controller device",
2043+
* so this string always has to start with a backslash.
2044+
*
2045+
* By verifying this we can avoid such faulty ECDT tables in a safe way.
2046+
*/
2047+
pr_err(FW_BUG "Ignoring ECDT due to invalid ID string \"%s\"\n", ecdt_ptr->id);
2048+
goto out;
2049+
}
2050+
20342051
ec = acpi_ec_alloc();
20352052
if (!ec)
20362053
goto out;

drivers/acpi/resource.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,13 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = {
666666
DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"),
667667
},
668668
},
669+
{
670+
/* MACHENIKE L16P/L16P */
671+
.matches = {
672+
DMI_MATCH(DMI_SYS_VENDOR, "MACHENIKE"),
673+
DMI_MATCH(DMI_BOARD_NAME, "L16P"),
674+
},
675+
},
669676
{
670677
/*
671678
* TongFang GM5HG0A in case of the SKIKK Vanaheim relabel the

drivers/base/faux.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static struct device_driver faux_driver = {
8686
.name = "faux_driver",
8787
.bus = &faux_bus_type,
8888
.probe_type = PROBE_FORCE_SYNCHRONOUS,
89+
.suppress_bind_attrs = true,
8990
};
9091

9192
static void faux_device_release(struct device *dev)
@@ -169,7 +170,7 @@ struct faux_device *faux_device_create_with_groups(const char *name,
169170
* successful is almost impossible to determine by the caller.
170171
*/
171172
if (!dev->driver) {
172-
dev_err(dev, "probe did not succeed, tearing down the device\n");
173+
dev_dbg(dev, "probe did not succeed, tearing down the device\n");
173174
faux_device_destroy(faux_dev);
174175
faux_dev = NULL;
175176
}

0 commit comments

Comments
 (0)