Page MenuHomeFreeBSD

Fixing
ClosedPublic

Authored by olivier on Tue, Mar 3, 8:47 PM.

Details

Summary

my Intel Core Ultra 7 165U is displaying those message during boot:

acpi_spmc0: <Low Power S0 Idle (DSM sets 0x3)> on acpi0
acpi_spmc0: Unknown revision -47608928 for device constraint detail package
acpi_spmc0: Unknown revision -47608728 for device constraint detail package
acpi_spmc0: Unknown revision -47608528 for device constraint detail package
acpi_spmc0: Unknown revision -47608328 for device constraint detail package
acpi_spmc0: Unknown revision -47608128 for device constraint detail package
acpi_spmc0: Unknown revision -47607928 for device constraint detail package
acpi_spmc0: Unknown revision -47607728 for device constraint detail package
acpi_spmc0: Unknown revision -47607528 for device constraint detail package
acpi_spmc0: Unknown revision -47607328 for device constraint detail package
acpi_spmc0: Unknown revision -47607128 for device constraint detail package
acpi_spmc0: Unknown revision -47606928 for device constraint detail package
acpi_spmc0: Unknown revision -47606744 for device constraint detail package
acpi_spmc0: Unknown revision -47606560 for device constraint detail package
acpi_spmc0: Unknown revision -47606376 for device constraint detail package
acpi_spmc0: Unknown revision -47606192 for device constraint detail package
acpi_spmc0: Unknown revision -47606008 for device constraint detail package
acpi_spmc0: Unknown revision -47605800 for device constraint detail package
acpi_spmc0: Unknown revision -47605616 for device constraint detail package
acpi_spmc0: Unknown revision -47605432 for device constraint detail package

Seems due to a bug:
it reads the SAME Elements[0] as an Integer, but the comment says "device constraint detail package" but the code reads from the constraint object, not the detail sub-package.
So the value -47608928 is just the raw bits of the string pointer being interpreted as an integer.

Fixing it by using Elements[2] (the detail sub-package), computed before the check.

Proposed commit message:

acpi_spmc: fix revision check reading name as integer

In acpi_spmc_get_constraints_spec(), the revision of the device
constraint detail package was mistakenly read from
constraint_obj->Package.Elements[0], which is the device name
(a String), instead of from the detail sub-package's first element.

Move the initialisation of `detail' before the revision check and
read the revision from detail->Package.Elements[0] as the comment
already states
Test Plan

Once applied, the dmesg is now:

acpi_spmc0: <Low Power S0 Idle (DSM sets 0x3)> on acpi0
acpi_spmc0: failed to get handle for \134_SB.PC00.I2C6
acpi_spmc0: failed to get handle for \134_SB.PC00.I2C7
acpi_spmc0: failed to get handle for \134_SB.PC00.PEMC
acpi_spmc0: failed to get handle for \134_SB.PC00.PSDC
acpi_spmc0: failed to get handle for \134_SB.PC00.GLAN
acpi_spmc0: failed to get handle for \134_SB.PC00.VMD0
acpi_spmc0: failed to get handle for \134_SB.PC00.PUF0
acpi_spmc0: failed to get handle for \134_SB.PC00.PUF1
acpi_spmc0: failed to get handle for \134_SB.PC00.TXDC
acpi_spmc0: failed to get handle for \134_SB.PC01.TRP0
acpi_spmc0: failed to get handle for \134_SB.PC01.TRP1
acpi_spmc0: failed to get handle for \134_SB.PC01.TRP2
acpi_spmc0: failed to get handle for \134_SB.PC01.TRP3

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

olivier created this revision.
olivier added a reviewer: olce.

looks good, thanks for finding/fixing this!

(spec for reference: https://uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf, see tables 7 & 8)

dev/acpica/acpi_spmc.c
325–329

nit but it would make more sense to have this above the comment

This revision is now accepted and ready to land.Tue, Mar 3, 10:02 PM
This revision now requires review to proceed.Tue, Mar 3, 11:02 PM
This revision is now accepted and ready to land.Tue, Mar 3, 11:03 PM