Skip to content

Commit 330235e

Browse files
committed
Merge tag 'acpi-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These include new ACPICA material, a rework of the ACPI thermal driver, a switch-over of the ACPI processor driver to using _OSC instead of (long deprecated) _PDC for CPU initialization, a rework of firmware notifications handling in several drivers, fixes and cleanups for suspend-to-idle handling on AMD systems, ACPI backlight driver updates and more. Specifics: - Update the ACPICA code in the kernel to upstream revision 2023062 including the following changes: - Suppress a GCC 12 dangling-pointer warning (Philip Prindeville) - Reformat the ACPI_STATE_COMMON macro and its users (George Guo) - Replace the ternary operator with ACPI_MIN() (Jiangshan Yi) - Add support for _DSC as per ACPI 6.5 (Saket Dumbre) - Remove a duplicate macro from zephyr header (Najumon B.A) - Add data structures for GED and _EVT tracking (Jose Marinho) - Fix misspelled CDAT DSMAS define (Dave Jiang) - Simplify an error message in acpi_ds_result_push() (Christophe Jaillet) - Add a struct size macro related to SRAT (Dave Jiang) - Add AML_NO_OPERAND_RESOLVE flag to Timer (Abhishek Mainkar) - Add support for RISC-V external interrupt controllers in MADT (Sunil V L) - Add RHCT flags, CMO and MMU nodes (Sunil V L) - Change ACPICA version to 2023062 (Bob Moore) - Introduce new wrappers for ACPICA notify handler install/remove and convert multiple drivers to using their own Notify() handlers instead of the ACPI bus type .notify() slated for removal (Michal Wilczynski) - Add backlight=native DMI quirk for Apple iMac12,1 and iMac12,2 (Hans de Goede) - Put ACPI video and its child devices explicitly into D0 on boot to avoid platform firmware confusion (Kai-Heng Feng) - Add backlight=native DMI quirk for Lenovo Ideapad Z470 (Jiri Slaby) - Support obtaining physical CPU ID from MADT on LoongArch (Bibo Mao) - Convert ACPI CPU initialization to using _OSC instead of _PDC that has been depreceted since 2018 and dropped from the specification in ACPI 6.5 (Michal Wilczynski, Rafael Wysocki) - Drop non-functional nocrt parameter from ACPI thermal (Mario Limonciello) - Clean up the ACPI thermal driver, rework the handling of firmware notifications in it and make it provide a table of generic trip point structures to the core during initialization (Rafael Wysocki) - Defer enumeration of devices with _DEP pointing to IVSC (Wentong Wu) - Install SystemCMOS address space handler for ACPI000E (TAD) to meet platform firmware expectations on some platforms (Zhang Rui) - Fix finding the generic error data in the ACPi extlog driver for compatibility with old and new firmware interface versions (Xiaochun Lee) - Remove assorted unused declarations of functions (Yue Haibing) - Move AMBA bus scan handling into arm64 specific directory (Sudeep Holla) - Fix and clean up suspend-to-idle interface for AMD systems (Mario Limonciello, Andy Shevchenko) - Fix string truncation warning in pnpacpi_add_device() (Sunil V L)" * tag 'acpi-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (66 commits) ACPI: x86: s2idle: Add a function to get LPS0 constraint for a device ACPI: x86: s2idle: Add for_each_lpi_constraint() helper ACPI: x86: s2idle: Add more debugging for AMD constraints parsing ACPI: x86: s2idle: Fix a logic error parsing AMD constraints table ACPI: x86: s2idle: Catch multiple ACPI_TYPE_PACKAGE objects ACPI: x86: s2idle: Post-increment variables when getting constraints ACPI: Adjust #ifdef for *_lps0_dev use ACPI: TAD: Install SystemCMOS address space handler for ACPI000E ACPI: Remove assorted unused declarations of functions ACPI: extlog: Fix finding the generic error data for v3 structure PNP: ACPI: Fix string truncation warning ACPI: Remove unused extern declaration acpi_paddr_to_node() ACPI: video: Add backlight=native DMI quirk for Apple iMac12,1 and iMac12,2 ACPI: video: Put ACPI video and its child devices into D0 on boot ACPI: processor: LoongArch: Get physical ID from MADT ACPI: scan: Defer enumeration of devices with a _DEP pointing to IVSC device ACPI: thermal: Eliminate code duplication from acpi_thermal_notify() ACPI: thermal: Drop unnecessary thermal zone callbacks ACPI: thermal: Rework thermal_get_trend() ACPI: thermal: Use trip point table to register thermal zones ...
2 parents 2927d22 + b483d3b commit 330235e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+967
-580
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6333,10 +6333,6 @@
63336333
-1: disable all critical trip points in all thermal zones
63346334
<degrees C>: override all critical trip points
63356335

6336-
thermal.nocrt= [HW,ACPI]
6337-
Set to disable actions on ACPI thermal zone
6338-
critical and hot trip points.
6339-
63406336
thermal.off= [HW,ACPI]
63416337
1: disable ACPI thermal control
63426338

arch/ia64/include/asm/acpi.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#ifdef __KERNEL__
1313

14-
#include <acpi/pdc_intel.h>
14+
#include <acpi/proc_cap_intel.h>
1515

1616
#include <linux/init.h>
1717
#include <linux/numa.h>
@@ -69,9 +69,9 @@ extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
6969
#endif
7070

7171
static inline bool arch_has_acpi_pdc(void) { return true; }
72-
static inline void arch_acpi_set_pdc_bits(u32 *buf)
72+
static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
7373
{
74-
buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
74+
*cap |= ACPI_PROC_CAP_EST_CAPABILITY_SMP;
7575
}
7676

7777
#ifdef CONFIG_ACPI_NUMA

arch/x86/include/asm/acpi.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
77
* Copyright (C) 2001 Patrick Mochel <mochel@osdl.org>
88
*/
9-
#include <acpi/pdc_intel.h>
9+
#include <acpi/proc_cap_intel.h>
1010

1111
#include <asm/numa.h>
1212
#include <asm/fixmap.h>
@@ -102,23 +102,31 @@ static inline bool arch_has_acpi_pdc(void)
102102
c->x86_vendor == X86_VENDOR_CENTAUR);
103103
}
104104

105-
static inline void arch_acpi_set_pdc_bits(u32 *buf)
105+
static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
106106
{
107107
struct cpuinfo_x86 *c = &cpu_data(0);
108108

109-
buf[2] |= ACPI_PDC_C_CAPABILITY_SMP;
109+
*cap |= ACPI_PROC_CAP_C_CAPABILITY_SMP;
110+
111+
/* Enable coordination with firmware's _TSD info */
112+
*cap |= ACPI_PROC_CAP_SMP_T_SWCOORD;
110113

111114
if (cpu_has(c, X86_FEATURE_EST))
112-
buf[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP;
115+
*cap |= ACPI_PROC_CAP_EST_CAPABILITY_SWSMP;
113116

114117
if (cpu_has(c, X86_FEATURE_ACPI))
115-
buf[2] |= ACPI_PDC_T_FFH;
118+
*cap |= ACPI_PROC_CAP_T_FFH;
119+
120+
if (cpu_has(c, X86_FEATURE_HWP))
121+
*cap |= ACPI_PROC_CAP_COLLAB_PROC_PERF;
116122

117123
/*
118-
* If mwait/monitor is unsupported, C2/C3_FFH will be disabled
124+
* If mwait/monitor is unsupported, C_C1_FFH and
125+
* C2/C3_FFH will be disabled.
119126
*/
120-
if (!cpu_has(c, X86_FEATURE_MWAIT))
121-
buf[2] &= ~(ACPI_PDC_C_C2C3_FFH);
127+
if (!cpu_has(c, X86_FEATURE_MWAIT) ||
128+
boot_option_idle_override == IDLE_NOMWAIT)
129+
*cap &= ~(ACPI_PROC_CAP_C_C1_FFH | ACPI_PROC_CAP_C_C2C3_FFH);
122130
}
123131

124132
static inline bool acpi_has_cpu_in_madt(void)

arch/x86/xen/enlighten_pv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
#ifdef CONFIG_ACPI
8080
#include <linux/acpi.h>
8181
#include <asm/acpi.h>
82-
#include <acpi/pdc_intel.h>
82+
#include <acpi/proc_cap_intel.h>
8383
#include <acpi/processor.h>
8484
#include <xen/interface/platform.h>
8585
#endif
@@ -288,17 +288,17 @@ static bool __init xen_check_mwait(void)
288288

289289
native_cpuid(&ax, &bx, &cx, &dx);
290290

291-
/* Ask the Hypervisor whether to clear ACPI_PDC_C_C2C3_FFH. If so,
291+
/* Ask the Hypervisor whether to clear ACPI_PROC_CAP_C_C2C3_FFH. If so,
292292
* don't expose MWAIT_LEAF and let ACPI pick the IOPORT version of C3.
293293
*/
294294
buf[0] = ACPI_PDC_REVISION_ID;
295295
buf[1] = 1;
296-
buf[2] = (ACPI_PDC_C_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_SWSMP);
296+
buf[2] = (ACPI_PROC_CAP_C_CAPABILITY_SMP | ACPI_PROC_CAP_EST_CAPABILITY_SWSMP);
297297

298298
set_xen_guest_handle(op.u.set_pminfo.pdc, buf);
299299

300300
if ((HYPERVISOR_platform_op(&op) == 0) &&
301-
(buf[2] & (ACPI_PDC_C_C1_FFH | ACPI_PDC_C_C2C3_FFH))) {
301+
(buf[2] & (ACPI_PROC_CAP_C_C1_FFH | ACPI_PROC_CAP_C_C2C3_FFH))) {
302302
cpuid_leaf5_ecx_val = cx;
303303
cpuid_leaf5_edx_val = dx;
304304
}

drivers/acpi/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ acpi-$(CONFIG_PCI) += acpi_lpss.o
5050
acpi-y += acpi_apd.o
5151
acpi-y += acpi_platform.o
5252
acpi-y += acpi_pnp.o
53-
acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
5453
acpi-y += power.o
5554
acpi-y += event.o
5655
acpi-y += evged.o

drivers/acpi/ac.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MODULE_LICENSE("GPL");
3434

3535
static int acpi_ac_add(struct acpi_device *device);
3636
static void acpi_ac_remove(struct acpi_device *device);
37-
static void acpi_ac_notify(struct acpi_device *device, u32 event);
37+
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data);
3838

3939
static const struct acpi_device_id ac_device_ids[] = {
4040
{"ACPI0003", 0},
@@ -54,11 +54,9 @@ static struct acpi_driver acpi_ac_driver = {
5454
.name = "ac",
5555
.class = ACPI_AC_CLASS,
5656
.ids = ac_device_ids,
57-
.flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
5857
.ops = {
5958
.add = acpi_ac_add,
6059
.remove = acpi_ac_remove,
61-
.notify = acpi_ac_notify,
6260
},
6361
.drv.pm = &acpi_ac_pm,
6462
};
@@ -128,8 +126,9 @@ static enum power_supply_property ac_props[] = {
128126
};
129127

130128
/* Driver Model */
131-
static void acpi_ac_notify(struct acpi_device *device, u32 event)
129+
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
132130
{
131+
struct acpi_device *device = data;
133132
struct acpi_ac *ac = acpi_driver_data(device);
134133

135134
if (!ac)
@@ -235,7 +234,7 @@ static int acpi_ac_add(struct acpi_device *device)
235234

236235
result = acpi_ac_get_state(ac);
237236
if (result)
238-
goto end;
237+
goto err_release_ac;
239238

240239
psy_cfg.drv_data = ac;
241240

@@ -248,17 +247,27 @@ static int acpi_ac_add(struct acpi_device *device)
248247
&ac->charger_desc, &psy_cfg);
249248
if (IS_ERR(ac->charger)) {
250249
result = PTR_ERR(ac->charger);
251-
goto end;
250+
goto err_release_ac;
252251
}
253252

254253
pr_info("%s [%s] (%s)\n", acpi_device_name(device),
255254
acpi_device_bid(device), ac->state ? "on-line" : "off-line");
256255

257256
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
258257
register_acpi_notifier(&ac->battery_nb);
259-
end:
258+
259+
result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
260+
acpi_ac_notify);
260261
if (result)
261-
kfree(ac);
262+
goto err_unregister;
263+
264+
return 0;
265+
266+
err_unregister:
267+
power_supply_unregister(ac->charger);
268+
unregister_acpi_notifier(&ac->battery_nb);
269+
err_release_ac:
270+
kfree(ac);
262271

263272
return result;
264273
}
@@ -297,6 +306,8 @@ static void acpi_ac_remove(struct acpi_device *device)
297306

298307
ac = acpi_driver_data(device);
299308

309+
acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY,
310+
acpi_ac_notify);
300311
power_supply_unregister(ac->charger);
301312
unregister_acpi_notifier(&ac->battery_nb);
302313

drivers/acpi/acpi_cmos_rtc.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
5151
return AE_OK;
5252
}
5353

54-
static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
55-
const struct acpi_device_id *id)
54+
int acpi_install_cmos_rtc_space_handler(acpi_handle handle)
5655
{
5756
acpi_status status;
5857

59-
status = acpi_install_address_space_handler(adev->handle,
58+
status = acpi_install_address_space_handler(handle,
6059
ACPI_ADR_SPACE_CMOS,
6160
&acpi_cmos_rtc_space_handler,
6261
NULL, NULL);
@@ -67,18 +66,30 @@ static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
6766

6867
return 1;
6968
}
69+
EXPORT_SYMBOL_GPL(acpi_install_cmos_rtc_space_handler);
7070

71-
static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev)
71+
void acpi_remove_cmos_rtc_space_handler(acpi_handle handle)
7272
{
73-
if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle,
73+
if (ACPI_FAILURE(acpi_remove_address_space_handler(handle,
7474
ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler)))
7575
pr_err("Error removing CMOS-RTC region handler\n");
7676
}
77+
EXPORT_SYMBOL_GPL(acpi_remove_cmos_rtc_space_handler);
78+
79+
static int acpi_cmos_rtc_attach_handler(struct acpi_device *adev, const struct acpi_device_id *id)
80+
{
81+
return acpi_install_cmos_rtc_space_handler(adev->handle);
82+
}
83+
84+
static void acpi_cmos_rtc_detach_handler(struct acpi_device *adev)
85+
{
86+
acpi_remove_cmos_rtc_space_handler(adev->handle);
87+
}
7788

7889
static struct acpi_scan_handler cmos_rtc_handler = {
7990
.ids = acpi_cmos_rtc_ids,
80-
.attach = acpi_install_cmos_rtc_space_handler,
81-
.detach = acpi_remove_cmos_rtc_space_handler,
91+
.attach = acpi_cmos_rtc_attach_handler,
92+
.detach = acpi_cmos_rtc_detach_handler,
8293
};
8394

8495
void __init acpi_cmos_rtc_init(void)

drivers/acpi/acpi_extlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
172172
fru_text = "";
173173
sec_type = (guid_t *)gdata->section_type;
174174
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
175-
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
175+
struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata);
176176

177177
if (gdata->error_data_length >= sizeof(*mem))
178178
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,

0 commit comments

Comments
 (0)