Skip to content

Commit 59fa06c

Browse files
committed
Merge branches 'acpi-pm', 'acpi-soc', 'acpi-tables' and 'acpi-resource'
Merge ACPI power management changes, ACPI LPSS driver changes, ACPI table parsing code changes and ACPI resource handling changes for v5.20-rc1: - Save NVS memory during transitions into S3 on Lenovo G40-45 (Manyi Li). - Add support for upcoming AMD uPEP device ID AMDI008 to the ACPI suspend-to-idle driver for x86 platforms (Shyam Sundar S K). - Clean up checks related to the ACPI_FADT_LOW_POWER_S0 platform flag in the LPIT table driver and the suspend-to-idle driver for x86 platforms (Rafael Wysocki). - Print information messages regarding declared LPS0 idle support in the platform firmware (Rafael Wysocki). - Fix missing check in register_device_clock() in the ACPI driver for Intel SoCs (huhai). - Fix ACS setup in the VIOT table parser (Eric Auger). - Skip IRQ override on AMD Zen platforms where it's harmful (Chuanhong Guo). * acpi-pm: ACPI: PM: x86: Print messages regarding LPS0 idle support ACPI: PM: s2idle: Use LPS0 idle if ACPI_FADT_LOW_POWER_S0 is unset Revert "ACPI / PM: LPIT: Register sysfs attributes based on FADT" ACPI: PM: s2idle: Add support for upcoming AMD uPEP HID AMDI008 ACPI: PM: save NVS memory for Lenovo G40-45 * acpi-soc: ACPI: LPSS: Fix missing check in register_device_clock() * acpi-tables: ACPI: VIOT: Fix ACS setup * acpi-resource: ACPI: resource: skip IRQ override on AMD Zen platforms
5 parents 198c414 + ec6c050 + b4f1f61 + 3dcb861 + 9946e39 commit 59fa06c

File tree

8 files changed

+57
-19
lines changed

8 files changed

+57
-19
lines changed

drivers/acpi/acpi_lpit.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,11 @@ static void lpit_update_residency(struct lpit_residency_info *info,
109109
if (!info->iomem_addr)
110110
return;
111111

112-
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
113-
return;
114-
115112
/* Silently fail, if cpuidle attribute group is not present */
116113
sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
117114
&dev_attr_low_power_idle_system_residency_us.attr,
118115
"cpuidle");
119116
} else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
120-
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
121-
return;
122-
123117
/* Silently fail, if cpuidle attribute group is not present */
124118
sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
125119
&dev_attr_low_power_idle_cpu_residency_us.attr,

drivers/acpi/acpi_lpss.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ static int register_device_clock(struct acpi_device *adev,
422422
if (!lpss_clk_dev)
423423
lpt_register_clock_device();
424424

425+
if (IS_ERR(lpss_clk_dev))
426+
return PTR_ERR(lpss_clk_dev);
427+
425428
clk_data = platform_get_drvdata(lpss_clk_dev);
426429
if (!clk_data)
427430
return -ENODEV;

drivers/acpi/bus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,7 @@ static int __init acpi_init(void)
14111411

14121412
pci_mmcfg_late_init();
14131413
acpi_iort_init();
1414+
acpi_viot_early_init();
14141415
acpi_hest_init();
14151416
acpi_ghes_init();
14161417
acpi_scan_init();

drivers/acpi/resource.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
416416
{
417417
int i;
418418

419+
#ifdef CONFIG_X86
420+
/*
421+
* IRQ override isn't needed on modern AMD Zen systems and
422+
* this override breaks active low IRQs on AMD Ryzen 6000 and
423+
* newer systems. Skip it.
424+
*/
425+
if (boot_cpu_has(X86_FEATURE_ZEN))
426+
return false;
427+
#endif
428+
419429
for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
420430
const struct irq_override_cmp *entry = &skip_override_table[i];
421431

drivers/acpi/sleep.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
360360
DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
361361
},
362362
},
363+
{
364+
.callback = init_nvs_save_s3,
365+
.ident = "Lenovo G40-45",
366+
.matches = {
367+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
368+
DMI_MATCH(DMI_PRODUCT_NAME, "80E1"),
369+
},
370+
},
363371
/*
364372
* ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using
365373
* the Low Power S0 Idle firmware interface (see
@@ -816,6 +824,9 @@ static const struct platform_s2idle_ops acpi_s2idle_ops = {
816824

817825
void __weak acpi_s2idle_setup(void)
818826
{
827+
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)
828+
pr_info("Efficient low-power S0 idle declared\n");
829+
819830
s2idle_set_ops(&acpi_s2idle_ops);
820831
}
821832

drivers/acpi/viot.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,26 @@ static int __init viot_parse_node(const struct acpi_viot_header *hdr)
248248
return ret;
249249
}
250250

251+
/**
252+
* acpi_viot_early_init - Test the presence of VIOT and enable ACS
253+
*
254+
* If the VIOT does exist, ACS must be enabled. This cannot be
255+
* done in acpi_viot_init() which is called after the bus scan
256+
*/
257+
void __init acpi_viot_early_init(void)
258+
{
259+
#ifdef CONFIG_PCI
260+
acpi_status status;
261+
struct acpi_table_header *hdr;
262+
263+
status = acpi_get_table(ACPI_SIG_VIOT, 0, &hdr);
264+
if (ACPI_FAILURE(status))
265+
return;
266+
pci_request_acs();
267+
acpi_put_table(hdr);
268+
#endif
269+
}
270+
251271
/**
252272
* acpi_viot_init - Parse the VIOT table
253273
*
@@ -319,12 +339,6 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data)
319339
epid = ((domain_nr - ep->segment_start) << 16) +
320340
dev_id - ep->bdf_start + ep->endpoint_id;
321341

322-
/*
323-
* If we found a PCI range managed by the viommu, we're
324-
* the one that has to request ACS.
325-
*/
326-
pci_request_acs();
327-
328342
return viot_dev_iommu_init(&pdev->dev, ep->viommu,
329343
epid);
330344
}

drivers/acpi/x86/s2idle.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ static int lps0_device_attach(struct acpi_device *adev,
369369
if (lps0_device_handle)
370370
return 0;
371371

372-
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
373-
return 0;
374-
375372
if (acpi_s2idle_vendor_amd()) {
376373
/* AMD0004, AMD0005, AMDI0005:
377374
* - Should use rev_id 0x0
@@ -397,7 +394,9 @@ static int lps0_device_attach(struct acpi_device *adev,
397394
lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
398395
acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
399396
ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
400-
} else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) {
397+
} else if (lps0_dsm_func_mask_microsoft > 0 &&
398+
(!strcmp(hid, "AMDI0007") ||
399+
!strcmp(hid, "AMDI0008"))) {
401400
lps0_dsm_func_mask_microsoft = -EINVAL;
402401
acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
403402
}
@@ -419,11 +418,15 @@ static int lps0_device_attach(struct acpi_device *adev,
419418
lpi_device_get_constraints();
420419

421420
/*
422-
* Use suspend-to-idle by default if the default suspend mode was not
423-
* set from the command line.
421+
* Use suspend-to-idle by default if ACPI_FADT_LOW_POWER_S0 is set in
422+
* the FADT and the default suspend mode was not set from the command
423+
* line.
424424
*/
425-
if (mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
425+
if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) &&
426+
mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3) {
426427
mem_sleep_current = PM_SUSPEND_TO_IDLE;
428+
pr_info("Low-power S0 idle used by default for system suspend\n");
429+
}
427430

428431
/*
429432
* Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the

include/linux/acpi_viot.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
#include <linux/acpi.h>
77

88
#ifdef CONFIG_ACPI_VIOT
9+
void __init acpi_viot_early_init(void);
910
void __init acpi_viot_init(void);
1011
int viot_iommu_configure(struct device *dev);
1112
#else
13+
static inline void acpi_viot_early_init(void) {}
1214
static inline void acpi_viot_init(void) {}
1315
static inline int viot_iommu_configure(struct device *dev)
1416
{

0 commit comments

Comments
 (0)