Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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()

+40 -26
+1 -20
drivers/acpi/ec.c
··· 147 147 module_param(ec_storm_threshold, uint, 0644); 148 148 MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm"); 149 149 150 - static bool ec_freeze_events __read_mostly = true; 150 + static bool ec_freeze_events __read_mostly = false; 151 151 module_param(ec_freeze_events, bool, 0644); 152 152 MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume"); 153 153 ··· 1870 1870 } 1871 1871 1872 1872 #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 - 1891 1873 static int acpi_ec_suspend(struct device *dev) 1892 1874 { 1893 1875 struct acpi_ec *ec = ··· 1891 1909 #endif 1892 1910 1893 1911 static const struct dev_pm_ops acpi_ec_pm = { 1894 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend_noirq, acpi_ec_resume_noirq) 1895 1912 SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume) 1896 1913 }; 1897 1914
+2 -2
drivers/acpi/irq.c
··· 24 24 * 25 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 28 * -EINVAL on failure 29 29 */ 30 30 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) ··· 37 37 * *irq == 0 means no mapping, that should 38 38 * be reported as a failure 39 39 */ 40 - return (*irq > 0) ? *irq : -EINVAL; 40 + return (*irq > 0) ? 0 : -EINVAL; 41 41 } 42 42 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); 43 43
+37 -4
drivers/acpi/x86/utils.c
··· 12 12 */ 13 13 14 14 #include <linux/acpi.h> 15 + #include <linux/dmi.h> 15 16 #include <asm/cpu_device_id.h> 16 17 #include <asm/intel-family.h> 17 18 #include "../internal.h" ··· 21 20 * Some ACPI devices are hidden (status == 0x0) in recent BIOS-es because 22 21 * some recent Windows drivers bind to one device but poke at multiple 23 22 * devices at the same time, so the others get hidden. 23 + * 24 + * Some BIOS-es (temporarily) hide specific APCI devices to work around Windows 25 + * driver bugs. We use DMI matching to match known cases of this. 26 + * 24 27 * We work around this by always reporting ACPI_STA_DEFAULT for these 25 28 * devices. Note this MUST only be done for devices where this is safe. 26 29 * ··· 36 31 struct always_present_id { 37 32 struct acpi_device_id hid[2]; 38 33 struct x86_cpu_id cpu_ids[2]; 34 + struct dmi_system_id dmi_ids[2]; /* Optional */ 39 35 const char *uid; 40 36 }; 41 37 42 38 #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } 43 39 44 - #define ENTRY(hid, uid, cpu_models) { \ 40 + #define ENTRY(hid, uid, cpu_models, dmi...) { \ 45 41 { { hid, }, {} }, \ 46 42 { cpu_models, {} }, \ 43 + { { .matches = dmi }, {} }, \ 47 44 uid, \ 48 45 } 49 46 ··· 54 47 * Bay / Cherry Trail PWM directly poked by GPU driver in win10, 55 48 * but Linux uses a separate PWM driver, harmless if not used. 56 49 */ 57 - ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT1)), 58 - ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT)), 50 + ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT1), {}), 51 + ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}), 59 52 /* 60 53 * The INT0002 device is necessary to clear wakeup interrupt sources 61 54 * on Cherry Trail devices, without it we get nobody cared IRQ msgs. 62 55 */ 63 - ENTRY("INT0002", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT)), 56 + ENTRY("INT0002", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}), 57 + /* 58 + * On the Dell Venue 11 Pro 7130 the DSDT hides the touchscreen ACPI 59 + * device until a certain time after _SB.PCI0.GFX0.LCD.LCD1._ON gets 60 + * called has passed *and* _STA has been called at least 3 times since. 61 + */ 62 + ENTRY("SYNA7500", "1", ICPU(INTEL_FAM6_HASWELL_ULT), { 63 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 64 + DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"), 65 + }), 66 + /* 67 + * The GPD win BIOS dated 20170320 has disabled the accelerometer, the 68 + * drivers sometimes cause crashes under Windows and this is how the 69 + * manufacturer has solved this :| Note that the the DMI data is less 70 + * generic then it seems, a board_vendor of "AMI Corporation" is quite 71 + * rare and a board_name of "Default String" also is rare. 72 + */ 73 + ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), { 74 + DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 75 + DMI_MATCH(DMI_BOARD_NAME, "Default string"), 76 + DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), 77 + DMI_MATCH(DMI_BIOS_DATE, "03/20/2017") 78 + }), 64 79 }; 65 80 66 81 bool acpi_device_always_present(struct acpi_device *adev) ··· 103 74 continue; 104 75 105 76 if (!x86_match_cpu(always_present_ids[i].cpu_ids)) 77 + continue; 78 + 79 + if (always_present_ids[i].dmi_ids[0].matches[0].slot && 80 + !dmi_check_system(always_present_ids[i].dmi_ids)) 106 81 continue; 107 82 108 83 if (old_status != ACPI_STA_DEFAULT) /* Log only once */