diff options
| author | Olivier Certner <olce@FreeBSD.org> | 2026-05-04 12:00:39 +0000 |
|---|---|---|
| committer | Olivier Certner <olce@FreeBSD.org> | 2026-05-13 12:38:21 +0000 |
| commit | a78c9a2a47f2209328bd25e527bd20cfab6d3665 (patch) | |
| tree | 42046e511dcdbdaf43c5d7750c425f003820cdcc | |
| parent | 98ad729f3e98b75ae79cd4b539fe2767f8a6f89e (diff) | |
acpi_spmc(4): Constraints: Clearer message on handle retrieve error
Currently, the "failed to get handle for ..." log messages on attach are
a bit alarming and no context is provided. Print out that these are
retrieved when trying to match constraints and that such failures are
ignored, which should make administrators worry less.
While here, remove duplicated handle retrieving code in
acpi_spmc_check_constraints() because:
1. As is, it is dead code: We 'continue' if the handle is NULL, i.e.,
not already resolved, before trying to resolve it again.
2. This code is called after device suspension, which might make some
objects disappear from the ACPI namespace. In any case, it seems
unlikely that, suddenly, new objects would appear.
Reviewed by: imp, obiwac
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56808
| -rw-r--r-- | sys/dev/acpica/acpi_spmc.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c index 530d719fd66e..15b97347e8eb 100644 --- a/sys/dev/acpica/acpi_spmc.c +++ b/sys/dev/acpica/acpi_spmc.c @@ -643,7 +643,8 @@ acpi_spmc_get_constraints(device_t dev) status = acpi_GetHandleInScope(sc->handle, __DECONST(char *, constraint->name), &constraint->handle); if (ACPI_FAILURE(status)) { - device_printf(dev, "failed to get handle for %s\n", + device_printf(dev, + "Constraints: Cannot get handle for %s, ignoring\n", constraint->name); constraint->handle = NULL; } @@ -665,16 +666,6 @@ acpi_spmc_check_constraints(struct acpi_spmc_softc *sc) if (constraint->handle == NULL) continue; - ACPI_STATUS status = acpi_GetHandleInScope(sc->handle, - __DECONST(char *, constraint->name), &constraint->handle); - if (ACPI_FAILURE(status)) { - device_printf(sc->dev, "failed to get handle for %s\n", - constraint->name); - constraint->handle = NULL; - } - if (constraint->handle == NULL) - continue; - #ifdef notyet int d_state; if (ACPI_FAILURE(acpi_pwr_get_state(constraint->handle, &d_state))) |
