Skip to content

Commit 02e9542

Browse files
committed
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
6 parents 6173176 + 3f6b537 + 7a9490a + f144bc2 + 4aac453 + 311942c commit 02e9542

File tree

5 files changed

+34
-22
lines changed

5 files changed

+34
-22
lines changed

drivers/acpi/acpi_tad.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,9 @@ static void acpi_tad_remove(struct platform_device *pdev)
565565

566566
pm_runtime_get_sync(dev);
567567

568+
if (dd->capabilities & ACPI_TAD_RT)
569+
sysfs_remove_group(&dev->kobj, &acpi_tad_time_attr_group);
570+
568571
if (dd->capabilities & ACPI_TAD_DC_WAKE)
569572
sysfs_remove_group(&dev->kobj, &acpi_tad_dc_attr_group);
570573

drivers/acpi/fan_core.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,6 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = {
203203
* --------------------------------------------------------------------------
204204
*/
205205

206-
static bool acpi_fan_has_fst(struct acpi_device *device)
207-
{
208-
return acpi_has_method(device->handle, "_FST");
209-
}
210-
211-
static bool acpi_fan_is_acpi4(struct acpi_device *device)
212-
{
213-
return acpi_has_method(device->handle, "_FIF") &&
214-
acpi_has_method(device->handle, "_FPS") &&
215-
acpi_has_method(device->handle, "_FSL");
216-
}
217-
218206
static int acpi_fan_get_fif(struct acpi_device *device)
219207
{
220208
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -331,9 +319,11 @@ static int acpi_fan_probe(struct platform_device *pdev)
331319
device->driver_data = fan;
332320
platform_set_drvdata(pdev, fan);
333321

334-
if (acpi_fan_has_fst(device)) {
322+
if (acpi_has_method(device->handle, "_FST")) {
335323
fan->has_fst = true;
336-
fan->acpi4 = acpi_fan_is_acpi4(device);
324+
fan->acpi4 = acpi_has_method(device->handle, "_FIF") &&
325+
acpi_has_method(device->handle, "_FPS") &&
326+
acpi_has_method(device->handle, "_FSL");
337327
}
338328

339329
if (fan->acpi4) {

drivers/acpi/prmt.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,28 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end)
150150
th = &tm->handlers[cur_handler];
151151

152152
guid_copy(&th->guid, (guid_t *)handler_info->handler_guid);
153+
154+
/*
155+
* Print an error message if handler_address is NULL, the parse of VA also
156+
* can be skipped.
157+
*/
158+
if (unlikely(!handler_info->handler_address)) {
159+
pr_info("Skipping handler with NULL address for GUID: %pUL",
160+
(guid_t *)handler_info->handler_guid);
161+
continue;
162+
}
163+
153164
th->handler_addr =
154165
(void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
155166
/*
156-
* Print a warning message if handler_addr is zero which is not expected to
157-
* ever happen.
167+
* Print a warning message and skip the parse of VA if handler_addr is zero
168+
* which is not expected to ever happen.
158169
*/
159-
if (unlikely(!th->handler_addr))
170+
if (unlikely(!th->handler_addr)) {
160171
pr_warn("Failed to find VA of handler for GUID: %pUL, PA: 0x%llx",
161172
&th->guid, handler_info->handler_address);
173+
continue;
174+
}
162175

163176
th->static_data_buffer_addr =
164177
efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address);

drivers/acpi/thermal.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ static int acpi_thermal_suspend(struct device *dev)
924924
static int acpi_thermal_resume(struct device *dev)
925925
{
926926
struct acpi_thermal *tz;
927-
int i, j, power_state;
927+
int i, j;
928928

929929
if (!dev)
930930
return -EINVAL;
@@ -939,10 +939,8 @@ static int acpi_thermal_resume(struct device *dev)
939939
if (!acpi_thermal_trip_valid(acpi_trip))
940940
break;
941941

942-
for (j = 0; j < acpi_trip->devices.count; j++) {
943-
acpi_bus_update_power(acpi_trip->devices.handles[j],
944-
&power_state);
945-
}
942+
for (j = 0; j < acpi_trip->devices.count; j++)
943+
acpi_bus_update_power(acpi_trip->devices.handles[j], NULL);
946944
}
947945

948946
acpi_queue_thermal_check(tz);

drivers/acpi/video_detect.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
948948
DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
949949
},
950950
},
951+
/* https://gitlab.freedesktop.org/drm/amd/-/issues/4512 */
952+
{
953+
.callback = video_detect_force_native,
954+
.matches = {
955+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
956+
DMI_MATCH(DMI_PRODUCT_NAME, "82K8"),
957+
},
958+
},
951959
{ },
952960
};
953961

0 commit comments

Comments
 (0)