aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 01:27:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 01:27:13 -0400
commit1ef27400c52bf54b34261da49968343b6cb79e32 (patch)
tree196f932d36aad3c3c51e977b14a6bafb3ff64ab0
parente37720e25df1cb70958a59716135385683e728b3 (diff)
parent9636603da3c3367139b46e19a38fb2e4850e7420 (diff)
Merge tag 'acpi-fixes-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix the return value of an IRQ mapping routine in the ACPI core, fix an EC driver issue causing abnormal fan behavior after system resume on some systems and add quirks for ACPI device objects that need to be treated as "always present" to work around bogus implementations of the _STA control method. Specifics: - Fix the return value of acpi_gsi_to_irq() to make the GSI to IRQ mapping work on the Mustang (ARM64) platform (Mark Salter). - Fix an EC driver issue that causes fans to behave abnormally after system resume on some systems which turns out to be related to switching over the EC into the polling mode during the noirq stages of system suspend and resume (Lv Zheng). - Add quirks for ACPI device objects that need to be treated as "always present", because their _STA methods are designed to work around Windows driver bugs and return garbage from our perspective (Hans de Goede)" * tag 'acpi-fixes-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: 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 Revert "ACPI / EC: Enable event freeze mode..." to fix a regression ACPI / EC: Drop EC noirq hooks to fix a regression ACPI / irq: Fix return code of acpi_gsi_to_irq()
-rw-r--r--drivers/acpi/ec.c21
-rw-r--r--drivers/acpi/irq.c4
-rw-r--r--drivers/acpi/x86/utils.c41
3 files changed, 40 insertions, 26 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 854d428e2a2d..ddb01e9fa5b2 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -147,7 +147,7 @@ static unsigned int ec_storm_threshold __read_mostly = 8;
147module_param(ec_storm_threshold, uint, 0644); 147module_param(ec_storm_threshold, uint, 0644);
148MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm"); 148MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
149 149
150static bool ec_freeze_events __read_mostly = true; 150static bool ec_freeze_events __read_mostly = false;
151module_param(ec_freeze_events, bool, 0644); 151module_param(ec_freeze_events, bool, 0644);
152MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume"); 152MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
153 153
@@ -1870,24 +1870,6 @@ error:
1870} 1870}
1871 1871
1872#ifdef CONFIG_PM_SLEEP 1872#ifdef CONFIG_PM_SLEEP
1873static 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
1882static 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
1891static int acpi_ec_suspend(struct device *dev) 1873static int acpi_ec_suspend(struct device *dev)
1892{ 1874{
1893 struct acpi_ec *ec = 1875 struct acpi_ec *ec =
@@ -1909,7 +1891,6 @@ static int acpi_ec_resume(struct device *dev)
1909#endif 1891#endif
1910 1892
1911static const struct dev_pm_ops acpi_ec_pm = { 1893static const struct dev_pm_ops acpi_ec_pm = {
1912 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend_noirq, acpi_ec_resume_noirq)
1913 SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume) 1894 SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume)
1914}; 1895};
1915 1896
diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
index 830299a74b84..7c352cba0528 100644
--- a/drivers/acpi/irq.c
+++ b/drivers/acpi/irq.c
@@ -24,7 +24,7 @@ static struct fwnode_handle *acpi_gsi_domain_id;
24 * 24 *
25 * irq location updated with irq value [>0 on success, 0 on failure] 25 * irq location updated with irq value [>0 on success, 0 on failure]
26 * 26 *
27 * Returns: linux IRQ number on success (>0) 27 * Returns: 0 on success
28 * -EINVAL on failure 28 * -EINVAL on failure
29 */ 29 */
30int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) 30int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -37,7 +37,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
37 * *irq == 0 means no mapping, that should 37 * *irq == 0 means no mapping, that should
38 * be reported as a failure 38 * be reported as a failure
39 */ 39 */
40 return (*irq > 0) ? *irq : -EINVAL; 40 return (*irq > 0) ? 0 : -EINVAL;
41} 41}
42EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); 42EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
43 43
diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index bd86b809c848..b4fbb9929482 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <linux/dmi.h>
15#include <asm/cpu_device_id.h> 16#include <asm/cpu_device_id.h>
16#include <asm/intel-family.h> 17#include <asm/intel-family.h>
17#include "../internal.h" 18#include "../internal.h"
@@ -20,6 +21,10 @@
20 * Some ACPI devices are hidden (status == 0x0) in recent BIOS-es because 21 * Some ACPI devices are hidden (status == 0x0) in recent BIOS-es because
21 * some recent Windows drivers bind to one device but poke at multiple 22 * some recent Windows drivers bind to one device but poke at multiple
22 * devices at the same time, so the others get hidden. 23 * 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 *
23 * We work around this by always reporting ACPI_STA_DEFAULT for these 28 * We work around this by always reporting ACPI_STA_DEFAULT for these
24 * devices. Note this MUST only be done for devices where this is safe. 29 * devices. Note this MUST only be done for devices where this is safe.
25 * 30 *
@@ -31,14 +36,16 @@
31struct always_present_id { 36struct always_present_id {
32 struct acpi_device_id hid[2]; 37 struct acpi_device_id hid[2];
33 struct x86_cpu_id cpu_ids[2]; 38 struct x86_cpu_id cpu_ids[2];
39 struct dmi_system_id dmi_ids[2]; /* Optional */
34 const char *uid; 40 const char *uid;
35}; 41};
36 42
37#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } 43#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
38 44
39#define ENTRY(hid, uid, cpu_models) { \ 45#define ENTRY(hid, uid, cpu_models, dmi...) { \
40 { { hid, }, {} }, \ 46 { { hid, }, {} }, \
41 { cpu_models, {} }, \ 47 { cpu_models, {} }, \
48 { { .matches = dmi }, {} }, \
42 uid, \ 49 uid, \
43} 50}
44 51
@@ -47,13 +54,35 @@ static const struct always_present_id always_present_ids[] = {
47 * Bay / Cherry Trail PWM directly poked by GPU driver in win10, 54 * Bay / Cherry Trail PWM directly poked by GPU driver in win10,
48 * but Linux uses a separate PWM driver, harmless if not used. 55 * but Linux uses a separate PWM driver, harmless if not used.
49 */ 56 */
50 ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT1)), 57 ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT1), {}),
51 ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT)), 58 ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
52 /* 59 /*
53 * The INT0002 device is necessary to clear wakeup interrupt sources 60 * The INT0002 device is necessary to clear wakeup interrupt sources
54 * on Cherry Trail devices, without it we get nobody cared IRQ msgs. 61 * on Cherry Trail devices, without it we get nobody cared IRQ msgs.
55 */ 62 */
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 }),
57}; 86};
58 87
59bool acpi_device_always_present(struct acpi_device *adev) 88bool acpi_device_always_present(struct acpi_device *adev)
@@ -76,6 +105,10 @@ bool acpi_device_always_present(struct acpi_device *adev)
76 if (!x86_match_cpu(always_present_ids[i].cpu_ids)) 105 if (!x86_match_cpu(always_present_ids[i].cpu_ids))
77 continue; 106 continue;
78 107
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
79 if (old_status != ACPI_STA_DEFAULT) /* Log only once */ 112 if (old_status != ACPI_STA_DEFAULT) /* Log only once */
80 dev_info(&adev->dev, 113 dev_info(&adev->dev,
81 "Device [%s] is in always present list\n", 114 "Device [%s] is in always present list\n",