Skip to content

Commit 8fa0db3

Browse files
committed
Merge tag 'acpi-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These rework the handling of ACPI device objects to use the driver core facilities for managing child ones instead of some questionable home-grown ways without the requisite locking and reference counting, clean up the EC driver, improve suspend-to-idle handling on x86, add some systems to the ACPI backlight quirk list, fix some assorted issues, clean up code and improve documentation. Specifics: - Use facilities provided by the driver core and some additional helpers to handle the children of a given ACPI device object in multiple places instead of using the children and node list heads in struct acpi_device which is error prone (Rafael Wysocki). - Fix ACPI-related device reference counting issue in the hisi_lpc bus driver (Yang Yingliang). - Drop the children and node list heads that are not needed any more from struct acpi_device (Rafael Wysocki). - Drop driver member from struct acpi_device (Uwe Kleine-König). - Drop redundant check from acpi_device_remove() (Uwe Kleine-König). - Prepare the CPPC library for handling backwards-compatible future _CPC return package formats gracefully (Rafael Wysocki). - Clean up the ACPI EC driver after previous changes in it (Hans de Goede). - Drop leftover acpi_processor_get_limit_info() declaration (Riwen Lu). - Split out thermal initialization from ACPI PSS (Riwen Lu). - Annotate more functions in the ACPI CPU idle driver to live in the cpuidle section (Guilherme G. Piccoli). - Fix _EINJ vs "special purpose" EFI memory regions (Dan Williams). - Implement a better fix to avoid spamming the console with old error logs (Tony Luck). - Fix typo in a comment in the APEI code (Xiang wangx). - 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). - Use native backlight on Dell Inspiron N4010 (Hans de Goede). - Use native backlight on some TongFang devices (Werner Sembach). - Drop X86 dependency from the ACPI backlight driver Kconfig (Riwen Lu). - Shorten the quirk list in the ACPI backlight driver by identifying Clevo by board_name only (Werner Sembach). - Remove useless NULL pointer checks from 2 ACPI PCI link management functions (Andrey Strachuk). - Fix obsolete example in the ACPI EINJ documentation (Qifu Zhang). - Update links and references to _DSD-related documents (Sudeep Holla)" * tag 'acpi-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (46 commits) ACPI/PCI: Remove useless NULL pointer checks ACPI: CPPC: Do not prevent CPPC from working in the future ACPI: PM: x86: Print messages regarding LPS0 idle support ACPI: resource: skip IRQ override on AMD Zen platforms Documentation: ACPI: EINJ: Fix obsolete example ACPI: video: Use native backlight on Dell Inspiron N4010 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: video: Shortening quirk list by identifying Clevo by board_name only ACPI: video: Force backlight native for some TongFang devices ACPI: PM: s2idle: Add support for upcoming AMD uPEP HID AMDI008 ACPI: VIOT: Fix ACS setup ACPI: bus: Drop unused list heads from struct acpi_device hisi_lpc: Use acpi_dev_for_each_child() bus: hisi_lpc: fix missing platform_device_put() in hisi_lpc_acpi_probe() ACPI: bus: Drop driver member of struct acpi_device ACPI: bus: Drop redundant check in acpi_device_remove() ACPI: APEI: Fix _EINJ vs EFI_MEMORY_SP ACPI: LPSS: Fix missing check in register_device_clock() ACPI: APEI: Better fix to avoid spamming the console with old error logs ...
2 parents 64ae88f + 6352f34 commit 8fa0db3

40 files changed

+748
-648
lines changed

Documentation/firmware-guide/acpi/DSD-properties-rules.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ specific type) associated with it.
2121

2222
In the ACPI _DSD context it is an element of the sub-package following the
2323
generic Device Properties UUID in the _DSD return package as specified in the
24-
Device Properties UUID definition document [1]_.
24+
section titled "Well-Known _DSD UUIDs and Data Structure Formats" sub-section
25+
"Device Properties UUID" in _DSD (Device Specific Data) Implementation Guide
26+
document [1]_.
2527

2628
It also may be regarded as the definition of a key and the associated data type
2729
that can be returned by _DSD in the Device Properties UUID sub-package for a
@@ -36,7 +38,9 @@ Property subsets are nested collections of properties. Each of them is
3638
associated with an additional key (name) allowing the subset to be referred
3739
to as a whole (and to be treated as a separate entity). The canonical
3840
representation of property subsets is via the mechanism specified in the
39-
Hierarchical Properties Extension UUID definition document [2]_.
41+
section titled "Well-Known _DSD UUIDs and Data Structure Formats" sub-section
42+
"Hierarchical Data Extension UUID" in _DSD (Device Specific Data)
43+
Implementation Guide document [1]_.
4044

4145
Property sets may be hierarchical. That is, a property set may contain
4246
multiple property subsets that each may contain property subsets of its
@@ -96,5 +100,4 @@ contents.
96100
References
97101
==========
98102

99-
.. [1] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
100-
.. [2] https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf
103+
.. [1] https://github.com/UEFI/DSD-Guide

Documentation/firmware-guide/acpi/apei/einj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ An error injection example::
168168
0x00000008 Memory Correctable
169169
0x00000010 Memory Uncorrectable non-fatal
170170
# echo 0x12345000 > param1 # Set memory address for injection
171-
# echo $((-1 << 12)) > param2 # Mask 0xfffffffffffff000 - anywhere in this page
171+
# echo 0xfffffffffffff000 > param2 # Mask - anywhere in this page
172172
# echo 0x8 > error_type # Choose correctable memory error
173173
# echo 1 > error_inject # Inject now
174174

drivers/acpi/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ config ACPI_TINY_POWER_BUTTON_SIGNAL
210210

211211
config ACPI_VIDEO
212212
tristate "Video"
213-
depends on X86 && BACKLIGHT_CLASS_DEVICE
213+
depends on BACKLIGHT_CLASS_DEVICE
214214
depends on INPUT
215215
select THERMAL
216216
help
@@ -255,7 +255,6 @@ config ACPI_DOCK
255255

256256
config ACPI_CPU_FREQ_PSS
257257
bool
258-
select THERMAL
259258

260259
config ACPI_PROCESSOR_CSTATE
261260
def_bool y
@@ -287,6 +286,7 @@ config ACPI_PROCESSOR
287286
depends on X86 || IA64 || ARM64 || LOONGARCH
288287
select ACPI_PROCESSOR_IDLE
289288
select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
289+
select THERMAL
290290
default y
291291
help
292292
This driver adds support for the ACPI Processor package. It is required

drivers/acpi/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ obj-$(CONFIG_ACPI_PPTT) += pptt.o
109109
obj-$(CONFIG_ACPI_PFRUT) += pfr_update.o pfr_telemetry.o
110110

111111
# processor has its own "processor." module_param namespace
112-
processor-y := processor_driver.o
112+
processor-y := processor_driver.o processor_thermal.o
113113
processor-$(CONFIG_ACPI_PROCESSOR_IDLE) += processor_idle.o
114-
processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_throttling.o \
115-
processor_thermal.o
114+
processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_throttling.o
116115
processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
117116

118117
obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o

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/acpi_video.c

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,24 +1150,25 @@ acpi_video_get_device_type(struct acpi_video_bus *video,
11501150
return 0;
11511151
}
11521152

1153-
static int
1154-
acpi_video_bus_get_one_device(struct acpi_device *device,
1155-
struct acpi_video_bus *video)
1153+
static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
11561154
{
1157-
unsigned long long device_id;
1158-
int status, device_type;
1159-
struct acpi_video_device *data;
1155+
struct acpi_video_bus *video = arg;
11601156
struct acpi_video_device_attrib *attribute;
1157+
struct acpi_video_device *data;
1158+
unsigned long long device_id;
1159+
acpi_status status;
1160+
int device_type;
11611161

1162-
status =
1163-
acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
1164-
/* Some device omits _ADR, we skip them instead of fail */
1162+
status = acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
1163+
/* Skip devices without _ADR instead of failing. */
11651164
if (ACPI_FAILURE(status))
1166-
return 0;
1165+
goto exit;
11671166

11681167
data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
1169-
if (!data)
1168+
if (!data) {
1169+
dev_dbg(&device->dev, "Cannot attach\n");
11701170
return -ENOMEM;
1171+
}
11711172

11721173
strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
11731174
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
@@ -1230,7 +1231,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
12301231
list_add_tail(&data->entry, &video->video_device_list);
12311232
mutex_unlock(&video->device_list_lock);
12321233

1233-
return status;
1234+
exit:
1235+
video->child_count++;
1236+
return 0;
12341237
}
12351238

12361239
/*
@@ -1542,26 +1545,14 @@ static int
15421545
acpi_video_bus_get_devices(struct acpi_video_bus *video,
15431546
struct acpi_device *device)
15441547
{
1545-
int status = 0;
1546-
struct acpi_device *dev;
1547-
15481548
/*
15491549
* There are systems where video module known to work fine regardless
15501550
* of broken _DOD and ignoring returned value here doesn't cause
15511551
* any issues later.
15521552
*/
15531553
acpi_video_device_enumerate(video);
15541554

1555-
list_for_each_entry(dev, &device->children, node) {
1556-
1557-
status = acpi_video_bus_get_one_device(dev, video);
1558-
if (status) {
1559-
dev_err(&dev->dev, "Can't attach device\n");
1560-
break;
1561-
}
1562-
video->child_count++;
1563-
}
1564-
return status;
1555+
return acpi_dev_for_each_child(device, acpi_video_bus_get_one_device, video);
15651556
}
15661557

15671558
/* acpi_video interface */

drivers/acpi/apei/apei-base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* apei-base.c - ACPI Platform Error Interface (APEI) supporting
44
* infrastructure
55
*
6-
* APEI allows to report errors (for example from the chipset) to the
6+
* APEI allows to report errors (for example from the chipset) to
77
* the operating system. This improves NMI handling especially. In
88
* addition it supports error serialization and error injection.
99
*

drivers/acpi/apei/bert.c

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,53 @@
2929

3030
#undef pr_fmt
3131
#define pr_fmt(fmt) "BERT: " fmt
32+
33+
#define ACPI_BERT_PRINT_MAX_RECORDS 5
3234
#define ACPI_BERT_PRINT_MAX_LEN 1024
3335

3436
static int bert_disable;
3537

38+
/*
39+
* Print "all" the error records in the BERT table, but avoid huge spam to
40+
* the console if the BIOS included oversize records, or too many records.
41+
* Skipping some records here does not lose anything because the full
42+
* data is available to user tools in:
43+
* /sys/firmware/acpi/tables/data/BERT
44+
*/
3645
static void __init bert_print_all(struct acpi_bert_region *region,
3746
unsigned int region_len)
3847
{
3948
struct acpi_hest_generic_status *estatus =
4049
(struct acpi_hest_generic_status *)region;
4150
int remain = region_len;
51+
int printed = 0, skipped = 0;
4252
u32 estatus_len;
4353

4454
while (remain >= sizeof(struct acpi_bert_region)) {
4555
estatus_len = cper_estatus_len(estatus);
4656
if (remain < estatus_len) {
4757
pr_err(FW_BUG "Truncated status block (length: %u).\n",
4858
estatus_len);
49-
return;
59+
break;
5060
}
5161

5262
/* No more error records. */
5363
if (!estatus->block_status)
54-
return;
64+
break;
5565

5666
if (cper_estatus_check(estatus)) {
5767
pr_err(FW_BUG "Invalid error record.\n");
58-
return;
68+
break;
5969
}
6070

61-
pr_info_once("Error records from previous boot:\n");
62-
if (region_len < ACPI_BERT_PRINT_MAX_LEN)
71+
if (estatus_len < ACPI_BERT_PRINT_MAX_LEN &&
72+
printed < ACPI_BERT_PRINT_MAX_RECORDS) {
73+
pr_info_once("Error records from previous boot:\n");
6374
cper_estatus_print(KERN_INFO HW_ERR, estatus);
64-
else
65-
pr_info_once("Max print length exceeded, table data is available at:\n"
66-
"/sys/firmware/acpi/tables/data/BERT");
75+
printed++;
76+
} else {
77+
skipped++;
78+
}
6779

6880
/*
6981
* Because the boot error source is "one-time polled" type,
@@ -75,6 +87,9 @@ static void __init bert_print_all(struct acpi_bert_region *region,
7587
estatus = (void *)estatus + estatus_len;
7688
remain -= estatus_len;
7789
}
90+
91+
if (skipped)
92+
pr_info(HW_ERR "Skipped %d error records\n", skipped);
7893
}
7994

8095
static int __init setup_bert_disable(char *str)

drivers/acpi/apei/einj.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
546546
!= REGION_INTERSECTS) &&
547547
(region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_PERSISTENT_MEMORY)
548548
!= REGION_INTERSECTS) &&
549+
(region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_SOFT_RESERVED)
550+
!= REGION_INTERSECTS) &&
549551
!arch_is_platform_page(base_addr)))
550552
return -EINVAL;
551553

0 commit comments

Comments
 (0)