Skip to content

Commit 9636603

Browse files
committed
Merge branches 'acpi-ec', 'acpi-irq' and 'acpi-quirks'
* acpi-ec: Revert "ACPI / EC: Enable event freeze mode..." to fix a regression ACPI / EC: Drop EC noirq hooks to fix a regression * acpi-irq: ACPI / irq: Fix return code of acpi_gsi_to_irq() * acpi-quirks: ACPI / x86: Add KIOX000A accelerometer on GPD win to always_present_ids array ACPI / x86: Add Dell Venue 11 Pro 7130 touchscreen to always_present_ids ACPI / x86: Allow matching always_present_id array entries by DMI
4 parents 3226186 + 9c40f95 + 1dc482b + 906dc28 commit 9636603

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed

drivers/acpi/ec.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static unsigned int ec_storm_threshold __read_mostly = 8;
147147
module_param(ec_storm_threshold, uint, 0644);
148148
MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
149149

150-
static bool ec_freeze_events __read_mostly = true;
150+
static bool ec_freeze_events __read_mostly = false;
151151
module_param(ec_freeze_events, bool, 0644);
152152
MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
153153

@@ -1870,24 +1870,6 @@ int __init acpi_ec_ecdt_probe(void)
18701870
}
18711871

18721872
#ifdef CONFIG_PM_SLEEP
1873-
static int acpi_ec_suspend_noirq(struct device *dev)
1874-
{
1875-
struct acpi_ec *ec =
1876-
acpi_driver_data(to_acpi_device(dev));
1877-
1878-
acpi_ec_enter_noirq(ec);
1879-
return 0;
1880-
}
1881-
1882-
static int acpi_ec_resume_noirq(struct device *dev)
1883-
{
1884-
struct acpi_ec *ec =
1885-
acpi_driver_data(to_acpi_device(dev));
1886-
1887-
acpi_ec_leave_noirq(ec);
1888-
return 0;
1889-
}
1890-
18911873
static int acpi_ec_suspend(struct device *dev)
18921874
{
18931875
struct acpi_ec *ec =
@@ -1909,7 +1891,6 @@ static int acpi_ec_resume(struct device *dev)
19091891
#endif
19101892

19111893
static const struct dev_pm_ops acpi_ec_pm = {
1912-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend_noirq, acpi_ec_resume_noirq)
19131894
SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume)
19141895
};
19151896

drivers/acpi/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static struct fwnode_handle *acpi_gsi_domain_id;
2424
*
2525
* irq location updated with irq value [>0 on success, 0 on failure]
2626
*
27-
* Returns: linux IRQ number on success (>0)
27+
* Returns: 0 on success
2828
* -EINVAL on failure
2929
*/
3030
int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -37,7 +37,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
3737
* *irq == 0 means no mapping, that should
3838
* be reported as a failure
3939
*/
40-
return (*irq > 0) ? *irq : -EINVAL;
40+
return (*irq > 0) ? 0 : -EINVAL;
4141
}
4242
EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
4343

drivers/acpi/x86/utils.c

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
#include <linux/acpi.h>
15+
#include <linux/dmi.h>
1516
#include <asm/cpu_device_id.h>
1617
#include <asm/intel-family.h>
1718
#include "../internal.h"
@@ -20,6 +21,10 @@
2021
* Some ACPI devices are hidden (status == 0x0) in recent BIOS-es because
2122
* some recent Windows drivers bind to one device but poke at multiple
2223
* devices at the same time, so the others get hidden.
24+
*
25+
* Some BIOS-es (temporarily) hide specific APCI devices to work around Windows
26+
* driver bugs. We use DMI matching to match known cases of this.
27+
*
2328
* We work around this by always reporting ACPI_STA_DEFAULT for these
2429
* devices. Note this MUST only be done for devices where this is safe.
2530
*
@@ -31,14 +36,16 @@
3136
struct always_present_id {
3237
struct acpi_device_id hid[2];
3338
struct x86_cpu_id cpu_ids[2];
39+
struct dmi_system_id dmi_ids[2]; /* Optional */
3440
const char *uid;
3541
};
3642

3743
#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
3844

39-
#define ENTRY(hid, uid, cpu_models) { \
45+
#define ENTRY(hid, uid, cpu_models, dmi...) { \
4046
{ { hid, }, {} }, \
4147
{ cpu_models, {} }, \
48+
{ { .matches = dmi }, {} }, \
4249
uid, \
4350
}
4451

@@ -47,13 +54,35 @@ static const struct always_present_id always_present_ids[] = {
4754
* Bay / Cherry Trail PWM directly poked by GPU driver in win10,
4855
* but Linux uses a separate PWM driver, harmless if not used.
4956
*/
50-
ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT1)),
51-
ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT)),
57+
ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT1), {}),
58+
ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
5259
/*
5360
* The INT0002 device is necessary to clear wakeup interrupt sources
5461
* on Cherry Trail devices, without it we get nobody cared IRQ msgs.
5562
*/
56-
ENTRY("INT0002", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT)),
63+
ENTRY("INT0002", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
64+
/*
65+
* On the Dell Venue 11 Pro 7130 the DSDT hides the touchscreen ACPI
66+
* device until a certain time after _SB.PCI0.GFX0.LCD.LCD1._ON gets
67+
* called has passed *and* _STA has been called at least 3 times since.
68+
*/
69+
ENTRY("SYNA7500", "1", ICPU(INTEL_FAM6_HASWELL_ULT), {
70+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
71+
DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
72+
}),
73+
/*
74+
* The GPD win BIOS dated 20170320 has disabled the accelerometer, the
75+
* drivers sometimes cause crashes under Windows and this is how the
76+
* manufacturer has solved this :| Note that the the DMI data is less
77+
* generic then it seems, a board_vendor of "AMI Corporation" is quite
78+
* rare and a board_name of "Default String" also is rare.
79+
*/
80+
ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
81+
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
82+
DMI_MATCH(DMI_BOARD_NAME, "Default string"),
83+
DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
84+
DMI_MATCH(DMI_BIOS_DATE, "03/20/2017")
85+
}),
5786
};
5887

5988
bool acpi_device_always_present(struct acpi_device *adev)
@@ -76,6 +105,10 @@ bool acpi_device_always_present(struct acpi_device *adev)
76105
if (!x86_match_cpu(always_present_ids[i].cpu_ids))
77106
continue;
78107

108+
if (always_present_ids[i].dmi_ids[0].matches[0].slot &&
109+
!dmi_check_system(always_present_ids[i].dmi_ids))
110+
continue;
111+
79112
if (old_status != ACPI_STA_DEFAULT) /* Log only once */
80113
dev_info(&adev->dev,
81114
"Device [%s] is in always present list\n",

0 commit comments

Comments
 (0)