acpi_spmc(4): Be less verbose by default

Do not print by default details of failures that are unlikely to help
a normal user and to have a crucial influence on whether suspension
works correctly.  Do so only on a verbose boot or if requested
explicitly by the user via 'debug.acpi.spmc.verbose'.

In particular:
- On an Intel Framework laptop, the Microsoft DSM only reports the
  SLEEP_ENTRY and SLEEP_EXIT functions.  That makes some sense since,
  according to its specification, all functions of a Microsoft DSM
  except these two are in fact redundant with Intel DSM's ones (also,
  that of AMD DSM's ones).  Those functions being missing are only
  a potential problem if there is no other DSM than Microsoft's (yet to
  be observed in the field).
- The details of malformed/unapplicable constraints or ones with a newer
  format the driver does not know about are not readily actionable
  pieces of information, but rather debug/developer-oriented ones.  When
  verbosity is not requested, only print the details of the first such
  failure to encourage reporting and at the same time avoid cluttering
  the output.
- Detecting and printing unknown DSM functions is not directly
  actionable either, and the driver not using these functions may not
  prevent suspending (but might, e.g., prevent reaching deeper sleep
  states).

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56876
This commit is contained in:
Olivier Certner
2026-05-05 14:36:57 +02:00
parent 37c59fdc3b
commit 6da01f06ef
+14 -7
View File
@@ -448,7 +448,7 @@ acpi_spmc_dsm_print_functions(const struct acpi_spmc_softc *const sc,
device_printf(sc->dev, "DSM %s: Supported functions: %#" PRIx64 "%s\n",
dsm->name, supported_functions, buf);
if (missing != 0) {
if (VERBOSE() && missing != 0) {
print_bit_field(buf, sizeof(buf), missing, "FUNC",
pbf_function_name, dsm);
device_printf(sc->dev, "DSM %s: Does not enumerate expected "
@@ -456,7 +456,7 @@ acpi_spmc_dsm_print_functions(const struct acpi_spmc_softc *const sc,
dsm->name, missing, buf);
}
if (unknown != 0) {
if (VERBOSE() && unknown != 0) {
print_bit_field(buf, sizeof(buf), unknown, "FUNC",
pbf_function_name, dsm);
device_printf(sc->dev, "DSM %s: Supports more functions than "
@@ -528,8 +528,13 @@ acpi_spmc_parse_constraints_intel(struct acpi_spmc_softc *sc, ACPI_OBJECT *objec
*/
revision = detail->Package.Elements[0].Integer.Value;
if (revision != 0) {
device_printf(sc->dev, "Intel: Unknown revision %d for "
"constraint %zu's detail package\n", revision, i);
/* Only print this error message once if not verbose. */
if (VERBOSE() || sc->constraint_count ==
object->Package.Count)
device_printf(sc->dev,
"Intel: Unknown revision %d for "
"constraint %zu's detail package\n",
revision, i);
sc->constraint_count--;
continue;
}
@@ -661,9 +666,11 @@ acpi_spmc_get_constraints(struct acpi_spmc_softc *const sc)
status = acpi_GetHandleInScope(sc->handle,
__DECONST(char *, constraint->name), &constraint->handle);
if (ACPI_FAILURE(status)) {
device_printf(sc->dev,
"Constraints: Cannot get handle for %s, ignoring\n",
constraint->name);
if (VERBOSE())
device_printf(sc->dev,
"Constraints: Cannot get handle for %s, "
"ignoring\n",
constraint->name);
constraint->handle = NULL;
}
}