diff options
-rw-r--r-- | MAINTAINERS | 20 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/cstate.c | 15 | ||||
-rw-r--r-- | drivers/acpi/Kconfig | 2 | ||||
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 2 | ||||
-rw-r--r-- | drivers/acpi/dock.c | 8 | ||||
-rw-r--r-- | drivers/acpi/glue.c | 25 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 1 | ||||
-rw-r--r-- | drivers/acpi/resource.c | 56 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 6 | ||||
-rw-r--r-- | include/acpi/actbl2.h | 1 |
11 files changed, 119 insertions, 26 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index f26920f0fa65..cd2d9afb8a55 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -334,7 +334,7 @@ F: drivers/platform/x86/acer-wmi.c ACPI M: "Rafael J. Wysocki" <rafael@kernel.org> -M: Len Brown <lenb@kernel.org> +R: Len Brown <lenb@kernel.org> L: linux-acpi@vger.kernel.org S: Supported W: https://01.org/linux-acpi @@ -355,7 +355,7 @@ F: tools/power/acpi/ ACPI APEI M: "Rafael J. Wysocki" <rafael@kernel.org> -M: Len Brown <lenb@kernel.org> +R: Len Brown <lenb@kernel.org> R: James Morse <james.morse@arm.com> R: Tony Luck <tony.luck@intel.com> R: Borislav Petkov <bp@alien8.de> @@ -378,14 +378,6 @@ F: drivers/acpi/acpica/ F: include/acpi/ F: tools/power/acpi/ -ACPI FAN DRIVER -M: Zhang Rui <rui.zhang@intel.com> -L: linux-acpi@vger.kernel.org -S: Supported -W: https://01.org/linux-acpi -B: https://bugzilla.kernel.org -F: drivers/acpi/fan.c - ACPI FOR ARM64 (ACPI/arm64) M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> M: Hanjun Guo <guohanjun@huawei.com> @@ -422,14 +414,6 @@ W: https://01.org/linux-acpi B: https://bugzilla.kernel.org F: drivers/acpi/*thermal* -ACPI VIDEO DRIVER -M: Zhang Rui <rui.zhang@intel.com> -L: linux-acpi@vger.kernel.org -S: Supported -W: https://01.org/linux-acpi -B: https://bugzilla.kernel.org -F: drivers/acpi/acpi_video.c - ACPI VIOT DRIVER M: Jean-Philippe Brucker <jean-philippe@linaro.org> L: linux-acpi@vger.kernel.org diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 14bcd59bcdee..5b6d1a95776f 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -62,6 +62,7 @@ int acpi_fix_pin2_polarity __initdata; #ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; +static bool acpi_support_online_capable; #endif #ifdef CONFIG_X86_IO_APIC @@ -138,6 +139,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) pr_debug("Local APIC address 0x%08x\n", madt->address); } + if (madt->header.revision >= 5) + acpi_support_online_capable = true; default_acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); @@ -239,6 +242,12 @@ acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end) if (processor->id == 0xff) return 0; + /* don't register processors that can not be onlined */ + if (acpi_support_online_capable && + !(processor->lapic_flags & ACPI_MADT_ENABLED) && + !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) + return 0; + /* * We need to register disabled CPU as well to permit * counting disabled CPUs. This allows us to size diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 7de599eba7f0..7945eae5b315 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c @@ -79,6 +79,21 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, */ flags->bm_control = 0; } + if (c->x86_vendor == X86_VENDOR_AMD && c->x86 >= 0x17) { + /* + * For all AMD Zen or newer CPUs that support C3, caches + * should not be flushed by software while entering C3 + * type state. Set bm->check to 1 so that kernel doesn't + * need to execute cache flush operation. + */ + flags->bm_check = 1; + /* + * In current AMD C state implementation ARB_DIS is no longer + * used. So set bm_control to zero to indicate ARB_DIS is not + * required while entering C3 type state. + */ + flags->bm_control = 0; + } } EXPORT_SYMBOL(acpi_processor_power_init_bm_check); diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 1da360c51d66..cdbdf68bd98f 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -71,7 +71,7 @@ config ACPI_DEBUGGER if ACPI_DEBUGGER config ACPI_DEBUGGER_USER - tristate "Userspace debugger accessiblity" + tristate "Userspace debugger accessibility" depends on DEBUG_FS help Export /sys/kernel/debug/acpi/acpidbg for userspace utilities diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 30b1f511c2af..07447213a752 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -750,7 +750,7 @@ static ssize_t lpss_ltr_show(struct device *dev, struct device_attribute *attr, if (ret) return ret; - return snprintf(buf, PAGE_SIZE, "%08x\n", ltr_value); + return sysfs_emit(buf, "%08x\n", ltr_value); } static ssize_t lpss_ltr_mode_show(struct device *dev, diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 7cf92158008f..c8e9b962e18c 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -492,7 +492,7 @@ static ssize_t docked_show(struct device *dev, struct acpi_device *adev = NULL; acpi_bus_get_device(dock_station->handle, &adev); - return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev)); + return sysfs_emit(buf, "%u\n", acpi_device_enumerated(adev)); } static DEVICE_ATTR_RO(docked); @@ -504,7 +504,7 @@ static ssize_t flags_show(struct device *dev, { struct dock_station *dock_station = dev->platform_data; - return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags); + return sysfs_emit(buf, "%d\n", dock_station->flags); } static DEVICE_ATTR_RO(flags); @@ -543,7 +543,7 @@ static ssize_t uid_show(struct device *dev, if (ACPI_FAILURE(status)) return 0; - return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf); + return sysfs_emit(buf, "%llx\n", lbuf); } static DEVICE_ATTR_RO(uid); @@ -562,7 +562,7 @@ static ssize_t type_show(struct device *dev, else type = "unknown"; - return snprintf(buf, PAGE_SIZE, "%s\n", type); + return sysfs_emit(buf, "%s\n", type); } static DEVICE_ATTR_RO(type); diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 7a33a6d985f8..1cfafa254e3d 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -340,3 +340,28 @@ void acpi_device_notify_remove(struct device *dev) acpi_unbind_one(dev); } + +int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used) +{ + struct acpi_device *adev = to_acpi_device(dev); + + /* + * Skip device objects with device IDs, because they may be in use even + * if they are not companions of any physical device objects. + */ + if (adev->pnp.type.hardware_id) + return 0; + + mutex_lock(&adev->physical_node_lock); + + /* + * Device objects without device IDs are not in use if they have no + * corresponding physical device objects. + */ + if (list_empty(&adev->physical_node_list)) + acpi_device_set_power(adev, ACPI_STATE_D3_COLD); + + mutex_unlock(&adev->physical_node_lock); + + return 0; +} diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index d91b560e8867..8fbdc172864b 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -117,6 +117,7 @@ bool acpi_device_is_battery(struct acpi_device *adev); bool acpi_device_is_first_physical_node(struct acpi_device *adev, const struct device *dev); int acpi_bus_register_early_device(int type); +int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used); /* -------------------------------------------------------------------------- Device Matching and Notification diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index ee78a210c606..3c25ce8c95ba 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -16,6 +16,7 @@ #include <linux/ioport.h> #include <linux/slab.h> #include <linux/irq.h> +#include <linux/dmi.h> #ifdef CONFIG_X86 #define valid_IRQ(i) (((i) != 0) && ((i) != 2)) @@ -380,9 +381,58 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity) } EXPORT_SYMBOL_GPL(acpi_dev_get_irq_type); +static const struct dmi_system_id medion_laptop[] = { + { + .ident = "MEDION P15651", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), + DMI_MATCH(DMI_BOARD_NAME, "M15T"), + }, + }, + { + .ident = "MEDION S17405", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), + DMI_MATCH(DMI_BOARD_NAME, "M17T"), + }, + }, + { } +}; + +struct irq_override_cmp { + const struct dmi_system_id *system; + unsigned char irq; + unsigned char triggering; + unsigned char polarity; + unsigned char shareable; +}; + +static const struct irq_override_cmp skip_override_table[] = { + { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 }, +}; + +static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity, + u8 shareable) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) { + const struct irq_override_cmp *entry = &skip_override_table[i]; + + if (dmi_check_system(entry->system) && + entry->irq == gsi && + entry->triggering == triggering && + entry->polarity == polarity && + entry->shareable == shareable) + return false; + } + + return true; +} + static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, u8 triggering, u8 polarity, u8 shareable, - bool legacy) + bool check_override) { int irq, p, t; @@ -401,7 +451,9 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, * using extended IRQ descriptors we take the IRQ configuration * from _CRS directly. */ - if (legacy && !acpi_get_override_irq(gsi, &t, &p)) { + if (check_override && + acpi_dev_irq_override(gsi, triggering, polarity, shareable) && + !acpi_get_override_irq(gsi, &t, &p)) { u8 trig = t ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE; u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 5b54c80b9d32..770b82483d74 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2559,6 +2559,12 @@ int __init acpi_scan_init(void) } } + /* + * Make sure that power management resources are not blocked by ACPI + * device objects with no users. + */ + bus_for_each_dev(&acpi_bus_type, NULL, NULL, acpi_dev_turn_off_if_unused); + acpi_turn_off_unused_power_resources(); acpi_scan_initialized = true; diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index a8c3829b8000..71ca090fd61b 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -978,6 +978,7 @@ struct acpi_madt_multiproc_wakeup_mailbox { /* MADT Local APIC flags */ #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ +#define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */ /* MADT MPS INTI flags (inti_flags) */ |