Skip to content

Commit cf2a246

Browse files
committed
Merge: Update ACPI to match v6.10
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5014 JIRA: https://issues.redhat.com/browse/RHEL-54149 Omitted-fix: 7cc06e7 Omitted-fix: e075c3b both of these fixes to drivers/platform/x86 required multiple additional patches before they would apply semi-cleanly, and I did not want to take the additional commits into an already long series Omitted-fix: 4ce8f4c Omitted-fix: d80b83c These are both the same commit under two different hashes. They apply to drivers/platform/x86/x86-android-tablets.c, which is not present in centos-9. Omitted-fix: 0e6b6de This commit was reverted two months later by 779bac9. Simplify the history by not including either of them. Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com> Approved-by: Wander Lairson Costa <wander@redhat.com> Approved-by: Mark Salter <msalter@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: Chris von Recklinghausen <crecklin@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents a22755d + 46b2baa commit cf2a246

Some content is hidden

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

112 files changed

+3957
-1318
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4824,6 +4824,7 @@ M: Dan Williams <dan.j.williams@intel.com>
48244824
L: linux-cxl@vger.kernel.org
48254825
S: Maintained
48264826
F: drivers/cxl/
4827+
F: include/linux/cxl-einj.h
48274828
F: include/linux/cxl-event.h
48284829
F: include/uapi/linux/cxl_mem.h
48294830

arch/arm64/kernel/process.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ void machine_power_off(void)
111111
{
112112
local_irq_disable();
113113
smp_send_stop();
114-
if (pm_power_off)
115-
pm_power_off();
114+
do_kernel_power_off();
116115
}
117116

118117
/*

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ config X86
6060
#
6161
select ACPI_LEGACY_TABLES_LOOKUP if ACPI
6262
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
63+
select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
6364
select ARCH_32BIT_OFF_T if X86_32
6465
select ARCH_CLOCKSOURCE_INIT
6566
select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE

arch/x86/include/asm/sparsemem.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ extern int phys_to_target_node(phys_addr_t start);
3737
#define phys_to_target_node phys_to_target_node
3838
extern int memory_add_physaddr_to_nid(u64 start);
3939
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
40-
extern int numa_fill_memblks(u64 start, u64 end);
41-
#define numa_fill_memblks numa_fill_memblks
4240
#endif
4341
#endif /* __ASSEMBLY__ */
4442

arch/x86/kernel/acpi/cppc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bool cpc_supported_by_cpu(void)
2020
(boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f)))
2121
return true;
2222
else if (boot_cpu_data.x86 == 0x17 &&
23-
boot_cpu_data.x86_model >= 0x70 && boot_cpu_data.x86_model <= 0x7f)
23+
boot_cpu_data.x86_model >= 0x30 && boot_cpu_data.x86_model <= 0x7f)
2424
return true;
2525
return boot_cpu_has(X86_FEATURE_CPPC);
2626
}

arch/x86/kernel/acpi/wakeup_64.S

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Hooray, we are in Long 64-bit mode (but still running in low memory)
1818
*/
1919
SYM_FUNC_START(wakeup_long64)
20-
movq saved_magic, %rax
20+
movq saved_magic(%rip), %rax
2121
movq $0x123456789abcdef0, %rdx
2222
cmpq %rdx, %rax
2323
je 2f
@@ -33,14 +33,14 @@ SYM_FUNC_START(wakeup_long64)
3333
movw %ax, %es
3434
movw %ax, %fs
3535
movw %ax, %gs
36-
movq saved_rsp, %rsp
36+
movq saved_rsp(%rip), %rsp
3737

38-
movq saved_rbx, %rbx
39-
movq saved_rdi, %rdi
40-
movq saved_rsi, %rsi
41-
movq saved_rbp, %rbp
38+
movq saved_rbx(%rip), %rbx
39+
movq saved_rdi(%rip), %rdi
40+
movq saved_rsi(%rip), %rsi
41+
movq saved_rbp(%rip), %rbp
4242

43-
movq saved_rip, %rax
43+
movq saved_rip(%rip), %rax
4444
ANNOTATE_RETPOLINE_SAFE
4545
jmp *%rax
4646
SYM_FUNC_END(wakeup_long64)
@@ -72,11 +72,11 @@ SYM_FUNC_START(do_suspend_lowlevel)
7272

7373
movq $.Lresume_point, saved_rip(%rip)
7474

75-
movq %rsp, saved_rsp
76-
movq %rbp, saved_rbp
77-
movq %rbx, saved_rbx
78-
movq %rdi, saved_rdi
79-
movq %rsi, saved_rsi
75+
movq %rsp, saved_rsp(%rip)
76+
movq %rbp, saved_rbp(%rip)
77+
movq %rbx, saved_rbx(%rip)
78+
movq %rdi, saved_rdi(%rip)
79+
movq %rsi, saved_rsi(%rip)
8080

8181
addq $8, %rsp
8282
movl $3, %edi

arch/x86/mm/numa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ int memory_add_physaddr_to_nid(u64 start)
959959
}
960960
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
961961

962+
#endif
963+
962964
static int __init cmp_memblk(const void *a, const void *b)
963965
{
964966
const struct numa_memblk *ma = *(const struct numa_memblk **)a;
@@ -1031,5 +1033,3 @@ int __init numa_fill_memblks(u64 start, u64 end)
10311033
}
10321034
return 0;
10331035
}
1034-
1035-
#endif

drivers/acpi/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ config ACPI_HOTPLUG_CPU
314314
bool
315315
depends on ACPI_PROCESSOR && HOTPLUG_CPU
316316
select ACPI_CONTAINER
317-
default y
318317

319318
config ACPI_PROCESSOR_AGGREGATOR
320319
tristate "Processor Aggregator"
@@ -485,6 +484,9 @@ config ACPI_REDUCED_HARDWARE_ONLY
485484

486485
If you are unsure what to do, do not enable this option.
487486

487+
config ACPI_NHLT
488+
bool
489+
488490
source "drivers/acpi/nfit/Kconfig"
489491
source "drivers/acpi/numa/Kconfig"
490492
source "drivers/acpi/apei/Kconfig"

drivers/acpi/Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ tables.o: $(src)/../../include/$(subst $\",,$(CONFIG_ACPI_CUSTOM_DSDT_FILE)) ;
1414
endif
1515

1616
obj-$(CONFIG_ACPI) += tables.o
17-
obj-$(CONFIG_X86) += blacklist.o
1817

1918
#
2019
# ACPI Core Subsystem (Interpreter)
@@ -37,7 +36,7 @@ acpi-$(CONFIG_ACPI_SLEEP) += proc.o
3736
# ACPI Bus and Device Drivers
3837
#
3938
acpi-y += bus.o glue.o
40-
acpi-y += scan.o
39+
acpi-y += scan.o mipi-disco-img.o
4140
acpi-y += resource.o
4241
acpi-y += acpi_processor.o
4342
acpi-y += processor_core.o
@@ -46,7 +45,6 @@ acpi-y += ec.o
4645
acpi-$(CONFIG_ACPI_DOCK) += dock.o
4746
acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o
4847
obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o
49-
acpi-$(CONFIG_PCI) += acpi_lpss.o
5048
acpi-y += acpi_apd.o
5149
acpi-y += acpi_platform.o
5250
acpi-y += acpi_pnp.o
@@ -55,10 +53,6 @@ acpi-y += event.o
5553
acpi-y += evged.o
5654
acpi-y += sysfs.o
5755
acpi-y += property.o
58-
acpi-$(CONFIG_X86) += acpi_cmos_rtc.o
59-
acpi-$(CONFIG_X86) += x86/apple.o
60-
acpi-$(CONFIG_X86) += x86/utils.o
61-
acpi-$(CONFIG_X86) += x86/s2idle.o
6256
acpi-$(CONFIG_DEBUG_FS) += debugfs.o
6357
acpi-y += acpi_lpat.o
6458
acpi-$(CONFIG_ACPI_FPDT) += acpi_fpdt.o
@@ -93,6 +87,7 @@ obj-$(CONFIG_ACPI_THERMAL_LIB) += thermal_lib.o
9387
obj-$(CONFIG_ACPI_THERMAL) += thermal.o
9488
obj-$(CONFIG_ACPI_PLATFORM_PROFILE) += platform_profile.o
9589
obj-$(CONFIG_ACPI_NFIT) += nfit/
90+
obj-$(CONFIG_ACPI_NHLT) += nhlt.o
9691
obj-$(CONFIG_ACPI_NUMA) += numa/
9792
obj-$(CONFIG_ACPI) += acpi_memhotplug.o
9893
obj-$(CONFIG_ACPI_HOTPLUG_IOAPIC) += ioapic.o
@@ -131,3 +126,5 @@ obj-y += dptf/
131126
obj-$(CONFIG_ARM64) += arm64/
132127

133128
obj-$(CONFIG_ACPI_VIOT) += viot.o
129+
130+
obj-$(CONFIG_X86) += x86/

drivers/acpi/ac.c

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ MODULE_AUTHOR("Paul Diefenbaugh");
3333
MODULE_DESCRIPTION("ACPI AC Adapter Driver");
3434
MODULE_LICENSE("GPL");
3535

36-
static int acpi_ac_add(struct acpi_device *device);
37-
static void acpi_ac_remove(struct acpi_device *device);
36+
static int acpi_ac_probe(struct platform_device *pdev);
37+
static void acpi_ac_remove(struct platform_device *pdev);
38+
3839
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data);
3940

4041
static const struct acpi_device_id ac_device_ids[] = {
@@ -51,17 +52,6 @@ static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
5152
static int ac_sleep_before_get_state_ms;
5253
static int ac_only;
5354

54-
static struct acpi_driver acpi_ac_driver = {
55-
.name = "ac",
56-
.class = ACPI_AC_CLASS,
57-
.ids = ac_device_ids,
58-
.ops = {
59-
.add = acpi_ac_add,
60-
.remove = acpi_ac_remove,
61-
},
62-
.drv.pm = &acpi_ac_pm,
63-
};
64-
6555
struct acpi_ac {
6656
struct power_supply *charger;
6757
struct power_supply_desc charger_desc;
@@ -129,12 +119,12 @@ static enum power_supply_property ac_props[] = {
129119
/* Driver Model */
130120
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
131121
{
132-
struct acpi_device *device = data;
133-
struct acpi_ac *ac = acpi_driver_data(device);
122+
struct acpi_ac *ac = data;
123+
struct acpi_device *adev = ac->device;
134124

135125
switch (event) {
136126
default:
137-
acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n",
127+
acpi_handle_debug(adev->handle, "Unsupported event [0x%x]\n",
138128
event);
139129
fallthrough;
140130
case ACPI_AC_NOTIFY_STATUS:
@@ -151,11 +141,11 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
151141
msleep(ac_sleep_before_get_state_ms);
152142

153143
acpi_ac_get_state(ac);
154-
acpi_bus_generate_netlink_event(device->pnp.device_class,
155-
dev_name(&device->dev), event,
144+
acpi_bus_generate_netlink_event(adev->pnp.device_class,
145+
dev_name(&adev->dev), event,
156146
(u32) ac->state);
157-
acpi_notifier_call_chain(device, event, (u32) ac->state);
158-
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
147+
acpi_notifier_call_chain(adev, event, (u32) ac->state);
148+
power_supply_changed(ac->charger);
159149
}
160150
}
161151

@@ -211,8 +201,9 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = {
211201
{},
212202
};
213203

214-
static int acpi_ac_add(struct acpi_device *device)
204+
static int acpi_ac_probe(struct platform_device *pdev)
215205
{
206+
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
216207
struct power_supply_config psy_cfg = {};
217208
struct acpi_ac *ac;
218209
int result;
@@ -221,37 +212,38 @@ static int acpi_ac_add(struct acpi_device *device)
221212
if (!ac)
222213
return -ENOMEM;
223214

224-
ac->device = device;
225-
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
226-
strcpy(acpi_device_class(device), ACPI_AC_CLASS);
227-
device->driver_data = ac;
215+
ac->device = adev;
216+
strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME);
217+
strcpy(acpi_device_class(adev), ACPI_AC_CLASS);
218+
219+
platform_set_drvdata(pdev, ac);
228220

229221
result = acpi_ac_get_state(ac);
230222
if (result)
231223
goto err_release_ac;
232224

233225
psy_cfg.drv_data = ac;
234226

235-
ac->charger_desc.name = acpi_device_bid(device);
227+
ac->charger_desc.name = acpi_device_bid(adev);
236228
ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;
237229
ac->charger_desc.properties = ac_props;
238230
ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
239231
ac->charger_desc.get_property = get_ac_property;
240-
ac->charger = power_supply_register(&ac->device->dev,
232+
ac->charger = power_supply_register(&pdev->dev,
241233
&ac->charger_desc, &psy_cfg);
242234
if (IS_ERR(ac->charger)) {
243235
result = PTR_ERR(ac->charger);
244236
goto err_release_ac;
245237
}
246238

247-
pr_info("%s [%s] (%s-line)\n", acpi_device_name(device),
248-
acpi_device_bid(device), str_on_off(ac->state));
239+
pr_info("%s [%s] (%s-line)\n", acpi_device_name(adev),
240+
acpi_device_bid(adev), str_on_off(ac->state));
249241

250242
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
251243
register_acpi_notifier(&ac->battery_nb);
252244

253-
result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
254-
acpi_ac_notify, device);
245+
result = acpi_dev_install_notify_handler(adev, ACPI_ALL_NOTIFY,
246+
acpi_ac_notify, ac);
255247
if (result)
256248
goto err_unregister;
257249

@@ -269,33 +261,43 @@ static int acpi_ac_add(struct acpi_device *device)
269261
#ifdef CONFIG_PM_SLEEP
270262
static int acpi_ac_resume(struct device *dev)
271263
{
272-
struct acpi_ac *ac = acpi_driver_data(to_acpi_device(dev));
264+
struct acpi_ac *ac = dev_get_drvdata(dev);
273265
unsigned int old_state;
274266

275267
old_state = ac->state;
276268
if (acpi_ac_get_state(ac))
277269
return 0;
278270
if (old_state != ac->state)
279-
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
271+
power_supply_changed(ac->charger);
280272

281273
return 0;
282274
}
283275
#else
284276
#define acpi_ac_resume NULL
285277
#endif
286278

287-
static void acpi_ac_remove(struct acpi_device *device)
279+
static void acpi_ac_remove(struct platform_device *pdev)
288280
{
289-
struct acpi_ac *ac = acpi_driver_data(device);
281+
struct acpi_ac *ac = platform_get_drvdata(pdev);
290282

291-
acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY,
283+
acpi_dev_remove_notify_handler(ac->device, ACPI_ALL_NOTIFY,
292284
acpi_ac_notify);
293285
power_supply_unregister(ac->charger);
294286
unregister_acpi_notifier(&ac->battery_nb);
295287

296288
kfree(ac);
297289
}
298290

291+
static struct platform_driver acpi_ac_driver = {
292+
.probe = acpi_ac_probe,
293+
.remove_new = acpi_ac_remove,
294+
.driver = {
295+
.name = "ac",
296+
.acpi_match_table = ac_device_ids,
297+
.pm = &acpi_ac_pm,
298+
},
299+
};
300+
299301
static int __init acpi_ac_init(void)
300302
{
301303
int result;
@@ -308,7 +310,7 @@ static int __init acpi_ac_init(void)
308310

309311
dmi_check_system(ac_dmi_table);
310312

311-
result = acpi_bus_register_driver(&acpi_ac_driver);
313+
result = platform_driver_register(&acpi_ac_driver);
312314
if (result < 0)
313315
return -ENODEV;
314316

@@ -317,7 +319,7 @@ static int __init acpi_ac_init(void)
317319

318320
static void __exit acpi_ac_exit(void)
319321
{
320-
acpi_bus_unregister_driver(&acpi_ac_driver);
322+
platform_driver_unregister(&acpi_ac_driver);
321323
}
322324
module_init(acpi_ac_init);
323325
module_exit(acpi_ac_exit);

0 commit comments

Comments
 (0)