Skip to content

Commit 9434467

Browse files
committed
Merge tag 'acpi-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These modify the ACPI device events and processor enumeration code to take the 'enabled' _STA bit into account as mandated by the ACPI specification, convert several platform drivers to using a remove callback that returns void, add some new quirks for ACPI IRQ override and other things, address assorted issues and clean up code. Specifics: - Rearrange Device Check and Bus Check notification handling in the ACPI device hotplug code to make it get the "enabled" _STA bit into account (Rafael Wysocki) - Modify acpi_processor_add() to skip processors with the "enabled" _STA bit clear, as per the specification (Rafael Wysocki) - Stop failing Device Check notification handling without a valid reason (Rafael Wysocki) - Defer enumeration of devices that depend on a device with an ACPI device ID equalt to INTC10CF to address probe ordering issues on some platforms (Wentong Wu) - Constify acpi_bus_type (Ricardo Marliere) - Make the ACPI-specific suspend-to-idle code take the Low-Power S0 Idle MSFT UUID into account on non-AMD systems (Rafael Wysocki) - Add ACPI IRQ override quirks for some new platforms (Sergey Kalinichev, Maxim Kudinov, Alexey Froloff, Sviatoslav Harasymchuk, Nicolas Haye) - Make the NFIT parsing code use acpi_evaluate_dsm_typed() (Andy Shevchenko) - Fix a memory leak in acpi_processor_power_exit() (Armin Wolf) - Make it possible to quirk the CSI-2 and MIPI DisCo for Imaging properties parsing and add a quirk for Dell XPS 9315 (Sakari Ailus) - Prevent false-positive static checker warnings from triggering by intializing some variables in the ACPI thermal code to zero (Colin Ian King) - Add DELL0501 handling to acpi_quirk_skip_serdev_enumeration() and make that function generic (Hans de Goede) - Make the ACPI backlight code handle fetching EDID that is longer than 256 bytes (Mario Limonciello) - Skip initialization of GHES_ASSIST structures for Machine Check Architecture in APEI (Avadhut Naik) - Convert several plaform drivers in the ACPI subsystem to using a remove callback that returns void (Uwe Kleine-König) - Drop the long-deprecated custom_method debugfs interface that is problematic from the security standpoint (Rafael Wysocki) - Use %pe in a couple of places in the ACPI code for easier error decoding (Onkarnath) - Fix register width information handling during system memory accesses in the ACPI CPPC library (Jarred White) - Add AMD CPPC V2 support for family 17h processors to the ACPI CPPC library (Perry Yuan)" * tag 'acpi-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (35 commits) ACPI: resource: Use IRQ override on Maibenben X565 ACPI: CPPC: Use access_width over bit_width for system memory accesses ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors ACPI: APEI: Skip initialization of GHES_ASSIST structures for Machine Check Architecture ACPI: scan: Consolidate Device Check and Bus Check notification handling ACPI: scan: Rework Device Check and Bus Check notification handling ACPI: scan: Make acpi_processor_add() check the device enabled bit ACPI: scan: Relocate acpi_bus_trim_one() ACPI: scan: Fix device check notification handling ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override ACPI: pfr_update: Convert to platform remove callback returning void ACPI: pfr_telemetry: Convert to platform remove callback returning void ACPI: fan: Convert to platform remove callback returning void ACPI: GED: Convert to platform remove callback returning void ACPI: DPTF: Convert to platform remove callback returning void ACPI: AGDI: Convert to platform remove callback returning void ACPI: TAD: Convert to platform remove callback returning void ACPI: APEI: GHES: Convert to platform remove callback returning void ACPI: property: Polish ignoring bad data nodes ACPI: thermal_lib: Initialize temp_decik to zero ...
2 parents 07abb19 + 817d237 commit 9434467

35 files changed

+414
-381
lines changed

Documentation/firmware-guide/acpi/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ACPI Support
1414
dsd/phy
1515
enumeration
1616
osi
17-
method-customizing
1817
method-tracing
1918
DSD-properties-rules
2019
debug

Documentation/firmware-guide/acpi/method-customizing.rst

Lines changed: 0 additions & 89 deletions
This file was deleted.

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
}

drivers/acpi/Kconfig

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -449,20 +449,6 @@ config ACPI_HED
449449
which is used to report some hardware errors notified via
450450
SCI, mainly the corrected errors.
451451

452-
config ACPI_CUSTOM_METHOD
453-
tristate "Allow ACPI methods to be inserted/replaced at run time"
454-
depends on DEBUG_FS
455-
help
456-
This debug facility allows ACPI AML methods to be inserted and/or
457-
replaced without rebooting the system. For details refer to:
458-
Documentation/firmware-guide/acpi/method-customizing.rst.
459-
460-
NOTE: This option is security sensitive, because it allows arbitrary
461-
kernel memory to be written to by root (uid=0) users, allowing them
462-
to bypass certain security measures (e.g. if root is not allowed to
463-
load additional kernel modules after boot, this feature may be used
464-
to override that restriction).
465-
466452
config ACPI_BGRT
467453
bool "Boottime Graphics Resource Table support"
468454
depends on EFI && (X86 || ARM64)

drivers/acpi/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ obj-$(CONFIG_ACPI_SBS) += sbshc.o
101101
obj-$(CONFIG_ACPI_SBS) += sbs.o
102102
obj-$(CONFIG_ACPI_HED) += hed.o
103103
obj-$(CONFIG_ACPI_EC_DEBUGFS) += ec_sys.o
104-
obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
105104
obj-$(CONFIG_ACPI_BGRT) += bgrt.o
106105
obj-$(CONFIG_ACPI_CPPC_LIB) += cppc_acpi.o
107106
obj-$(CONFIG_ACPI_SPCR_TABLE) += spcr.o

drivers/acpi/acpi_processor.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void cpufreq_add_device(const char *name)
161161

162162
pdev = platform_device_register_simple(name, PLATFORM_DEVID_NONE, NULL, 0);
163163
if (IS_ERR(pdev))
164-
pr_info("%s device creation failed: %ld\n", name, PTR_ERR(pdev));
164+
pr_info("%s device creation failed: %pe\n", name, pdev);
165165
}
166166

167167
#ifdef CONFIG_X86
@@ -381,6 +381,9 @@ static int acpi_processor_add(struct acpi_device *device,
381381
struct device *dev;
382382
int result = 0;
383383

384+
if (!acpi_device_is_enabled(device))
385+
return -ENODEV;
386+
384387
pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
385388
if (!pr)
386389
return -ENOMEM;

drivers/acpi/acpi_tad.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id)
554554
return acpi_tad_wake_set(dev, "_STV", timer_id, ACPI_TAD_WAKE_DISABLED);
555555
}
556556

557-
static int acpi_tad_remove(struct platform_device *pdev)
557+
static void acpi_tad_remove(struct platform_device *pdev)
558558
{
559559
struct device *dev = &pdev->dev;
560560
acpi_handle handle = ACPI_HANDLE(dev);
@@ -579,7 +579,6 @@ static int acpi_tad_remove(struct platform_device *pdev)
579579
pm_runtime_put_sync(dev);
580580
pm_runtime_disable(dev);
581581
acpi_remove_cmos_rtc_space_handler(handle);
582-
return 0;
583582
}
584583

585584
static int acpi_tad_probe(struct platform_device *pdev)
@@ -684,7 +683,7 @@ static struct platform_driver acpi_tad_driver = {
684683
.acpi_match_table = acpi_tad_ids,
685684
},
686685
.probe = acpi_tad_probe,
687-
.remove = acpi_tad_remove,
686+
.remove_new = acpi_tad_remove,
688687
};
689688
MODULE_DEVICE_TABLE(acpi, acpi_tad_ids);
690689

drivers/acpi/acpi_video.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
612612

613613
static int
614614
acpi_video_device_EDID(struct acpi_video_device *device,
615-
union acpi_object **edid, ssize_t length)
615+
union acpi_object **edid, int length)
616616
{
617617
int status;
618618
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -625,13 +625,11 @@ acpi_video_device_EDID(struct acpi_video_device *device,
625625

626626
if (!device)
627627
return -ENODEV;
628-
if (length == 128)
629-
arg0.integer.value = 1;
630-
else if (length == 256)
631-
arg0.integer.value = 2;
632-
else
628+
if (!length || (length % 128))
633629
return -EINVAL;
634630

631+
arg0.integer.value = length / 128;
632+
635633
status = acpi_evaluate_object(device->dev->handle, "_DDC", &args, &buffer);
636634
if (ACPI_FAILURE(status))
637635
return -ENODEV;
@@ -641,7 +639,8 @@ acpi_video_device_EDID(struct acpi_video_device *device,
641639
if (obj && obj->type == ACPI_TYPE_BUFFER)
642640
*edid = obj;
643641
else {
644-
acpi_handle_info(device->dev->handle, "Invalid _DDC data\n");
642+
acpi_handle_debug(device->dev->handle,
643+
"Invalid _DDC data for length %d\n", length);
645644
status = -EFAULT;
646645
kfree(obj);
647646
}
@@ -1447,7 +1446,6 @@ int acpi_video_get_edid(struct acpi_device *device, int type, int device_id,
14471446

14481447
for (i = 0; i < video->attached_count; i++) {
14491448
video_device = video->attached_array[i].bind_info;
1450-
length = 256;
14511449

14521450
if (!video_device)
14531451
continue;
@@ -1478,18 +1476,14 @@ int acpi_video_get_edid(struct acpi_device *device, int type, int device_id,
14781476
continue;
14791477
}
14801478

1481-
status = acpi_video_device_EDID(video_device, &buffer, length);
1482-
1483-
if (ACPI_FAILURE(status) || !buffer ||
1484-
buffer->type != ACPI_TYPE_BUFFER) {
1485-
length = 128;
1479+
for (length = 512; length > 0; length -= 128) {
14861480
status = acpi_video_device_EDID(video_device, &buffer,
14871481
length);
1488-
if (ACPI_FAILURE(status) || !buffer ||
1489-
buffer->type != ACPI_TYPE_BUFFER) {
1490-
continue;
1491-
}
1482+
if (ACPI_SUCCESS(status))
1483+
break;
14921484
}
1485+
if (!length)
1486+
continue;
14931487

14941488
*edid = buffer->buffer.pointer;
14951489
return length;

drivers/acpi/acpi_watchdog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void __init acpi_watchdog_init(void)
179179
pdev = platform_device_register_simple("wdat_wdt", PLATFORM_DEVID_NONE,
180180
resources, nresources);
181181
if (IS_ERR(pdev))
182-
pr_err("Device creation failed: %ld\n", PTR_ERR(pdev));
182+
pr_err("Device creation failed: %pe\n", pdev);
183183

184184
kfree(resources);
185185

drivers/acpi/apei/ghes.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ static int ghes_probe(struct platform_device *ghes_dev)
14551455
return rc;
14561456
}
14571457

1458-
static int ghes_remove(struct platform_device *ghes_dev)
1458+
static void ghes_remove(struct platform_device *ghes_dev)
14591459
{
14601460
int rc;
14611461
struct ghes *ghes;
@@ -1492,8 +1492,15 @@ static int ghes_remove(struct platform_device *ghes_dev)
14921492
break;
14931493
case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
14941494
rc = apei_sdei_unregister_ghes(ghes);
1495-
if (rc)
1496-
return rc;
1495+
if (rc) {
1496+
/*
1497+
* Returning early results in a resource leak, but we're
1498+
* only here if stopping the hardware failed.
1499+
*/
1500+
dev_err(&ghes_dev->dev, "Failed to unregister ghes (%pe)\n",
1501+
ERR_PTR(rc));
1502+
return;
1503+
}
14971504
break;
14981505
default:
14991506
BUG();
@@ -1507,16 +1514,14 @@ static int ghes_remove(struct platform_device *ghes_dev)
15071514
mutex_unlock(&ghes_devs_mutex);
15081515

15091516
kfree(ghes);
1510-
1511-
return 0;
15121517
}
15131518

15141519
static struct platform_driver ghes_platform_driver = {
15151520
.driver = {
15161521
.name = "GHES",
15171522
},
15181523
.probe = ghes_probe,
1519-
.remove = ghes_remove,
1524+
.remove_new = ghes_remove,
15201525
};
15211526

15221527
void __init acpi_ghes_init(void)

0 commit comments

Comments
 (0)