]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: bus: Rework printing debug messages on _OSC errors
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Dec 2025 19:11:08 +0000 (20:11 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 23 Dec 2025 16:12:00 +0000 (17:12 +0100)
commit06bf78f82f45514416b1d2193f7a45b6c6c1995e
tree1678d1149b746f79a506d36611bd05062303113f
parentbb203a649c26bbcb39c1d93d020cad77e87c518e
ACPI: bus: Rework printing debug messages on _OSC errors

Instead of using one function, acpi_print_osc_error(), for printing a
debug message and dumping the _OSC request data in one go, use
acpi_handle_debug() directly for printing messages and a separate
function called acpi_dump_osc_data() for dumping the _OSC request data
before printing one or more of them.

This avoids
 * dumping _OSC request data multiple times when there are
   multiple error bits set in the return buffer,
 * wrapping message lines on terminals with 80 character line width,
 * mixing up unrelated messages by printing full lines only,
and generally helps to make the messages easier to parse.

Also, use %pUL for UUID printing instead of printing UUIDs as strings
and include the revision number into the dumped _OSC request data.

This is how the debug printout looks like when the
OSC_REQUEST_ERROR and OSC_INVALID_REVISION_ERROR bits
are set in the return buffer before the change:

 ACPI: \_SB_: ACPI: (0811B06E-4A27-44F9-8D60-3CBBC22E7B48): _OSC request failed
 ACPI: _OSC request data:
 ACPI:  1
 ACPI:  2e7eff
 ACPI:
 ACPI: \_SB_: ACPI: (0811B06E-4A27-44F9-8D60-3CBBC22E7B48): _OSC invalid revision
 ACPI: _OSC request data:
 ACPI:  1
 ACPI:  2e7eff
 ACPI:

and this is how it is going to look like afterward:

 ACPI: \_SB_: ACPI: _OSC: UUID: 0811B06E-4A27-44F9-8D60-3CBBC22E7B48, rev: 1
 ACPI: \_SB_: ACPI: _OSC: capabilities DWORD 0: [00000001]
 ACPI: \_SB_: ACPI: _OSC: capabilities DWORD 1: [002e7eff]
 ACPI: \_SB_: ACPI: _OSC: request failed
 ACPI: \_SB_: ACPI: _OSC: invalid revision

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/10794028.nUPlyArG6x@rafael.j.wysocki
drivers/acpi/bus.c