Merge branches 'acpi-thermal', 'acpi-fan', 'acpi-video', 'acpi-tad' and 'acpi-prm'

Merge an ACPI thermal zone driver update, an ACPI fan driver update, an
ACPI backlight (video) driver update, an ACPI TAD (time and alarm
device) driver update, and an ACPI PRM (platform runtime mechanism)
driver update for 6.18-rc1:

 - Eliminate a dummy local variable from the ACPI thermal driver (Rafael
   Wysocki)

 - Fold two simple functions into their only caller in the ACPI fan
   driver (Rafael Wysocki)

 - Force native backlight on Lenovo 82K8 in the ACPI backlight (video)
   driver (Mario Limonciello)

 - Add missing sysfs_remove_group() for ACPI_TAD_RT (Daniel Tang)

 - Skip PRM handlers with NULL handler_address or NULL VA in the ACPI
   PRM driver (Shang song)

* acpi-thermal:
  ACPI: thermal: Get rid of a dummy local variable

* acpi-fan:
  ACPI: fan: Fold two simple functions into their only caller

* acpi-video:
  ACPI: video: force native for Lenovo 82K8

* acpi-tad:
  ACPI: TAD: Add missing sysfs_remove_group() for ACPI_TAD_RT

* acpi-prm:
  ACPI: PRM: Skip handlers with NULL handler_address or NULL VA
This commit is contained in:
Rafael J. Wysocki
2025-09-29 15:23:52 +02:00
5 changed files with 34 additions and 22 deletions

View File

@@ -565,6 +565,9 @@ static void acpi_tad_remove(struct platform_device *pdev)
pm_runtime_get_sync(dev);
if (dd->capabilities & ACPI_TAD_RT)
sysfs_remove_group(&dev->kobj, &acpi_tad_time_attr_group);
if (dd->capabilities & ACPI_TAD_DC_WAKE)
sysfs_remove_group(&dev->kobj, &acpi_tad_dc_attr_group);

View File

@@ -203,18 +203,6 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = {
* --------------------------------------------------------------------------
*/
static bool acpi_fan_has_fst(struct acpi_device *device)
{
return acpi_has_method(device->handle, "_FST");
}
static bool acpi_fan_is_acpi4(struct acpi_device *device)
{
return acpi_has_method(device->handle, "_FIF") &&
acpi_has_method(device->handle, "_FPS") &&
acpi_has_method(device->handle, "_FSL");
}
static int acpi_fan_get_fif(struct acpi_device *device)
{
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -331,9 +319,11 @@ static int acpi_fan_probe(struct platform_device *pdev)
device->driver_data = fan;
platform_set_drvdata(pdev, fan);
if (acpi_fan_has_fst(device)) {
if (acpi_has_method(device->handle, "_FST")) {
fan->has_fst = true;
fan->acpi4 = acpi_fan_is_acpi4(device);
fan->acpi4 = acpi_has_method(device->handle, "_FIF") &&
acpi_has_method(device->handle, "_FPS") &&
acpi_has_method(device->handle, "_FSL");
}
if (fan->acpi4) {

View File

@@ -150,15 +150,28 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end)
th = &tm->handlers[cur_handler];
guid_copy(&th->guid, (guid_t *)handler_info->handler_guid);
/*
* Print an error message if handler_address is NULL, the parse of VA also
* can be skipped.
*/
if (unlikely(!handler_info->handler_address)) {
pr_info("Skipping handler with NULL address for GUID: %pUL",
(guid_t *)handler_info->handler_guid);
continue;
}
th->handler_addr =
(void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
/*
* Print a warning message if handler_addr is zero which is not expected to
* ever happen.
* Print a warning message and skip the parse of VA if handler_addr is zero
* which is not expected to ever happen.
*/
if (unlikely(!th->handler_addr))
if (unlikely(!th->handler_addr)) {
pr_warn("Failed to find VA of handler for GUID: %pUL, PA: 0x%llx",
&th->guid, handler_info->handler_address);
continue;
}
th->static_data_buffer_addr =
efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address);

View File

@@ -924,7 +924,7 @@ static int acpi_thermal_suspend(struct device *dev)
static int acpi_thermal_resume(struct device *dev)
{
struct acpi_thermal *tz;
int i, j, power_state;
int i, j;
if (!dev)
return -EINVAL;
@@ -939,10 +939,8 @@ static int acpi_thermal_resume(struct device *dev)
if (!acpi_thermal_trip_valid(acpi_trip))
break;
for (j = 0; j < acpi_trip->devices.count; j++) {
acpi_bus_update_power(acpi_trip->devices.handles[j],
&power_state);
}
for (j = 0; j < acpi_trip->devices.count; j++)
acpi_bus_update_power(acpi_trip->devices.handles[j], NULL);
}
acpi_queue_thermal_check(tz);

View File

@@ -948,6 +948,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
},
},
/* https://gitlab.freedesktop.org/drm/amd/-/issues/4512 */
{
.callback = video_detect_force_native,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "82K8"),
},
},
{ },
};