Page MenuHomeFreeBSD

Add a wrapper for evaluating _OSC methods.
ClosedPublic

Authored by jhb on Apr 20 2016, 2:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 10:23 AM
Unknown Object (File)
Sep 26 2024, 12:44 AM
Unknown Object (File)
Sep 25 2024, 10:56 AM
Unknown Object (File)
Sep 24 2024, 8:31 PM
Unknown Object (File)
Sep 22 2024, 2:02 AM
Unknown Object (File)
Sep 18 2024, 11:22 AM
Unknown Object (File)
Sep 15 2024, 7:20 AM
Unknown Object (File)
Sep 15 2024, 7:19 AM
Subscribers

Details

Summary

Add a wrapper for evaluating _OSC methods.

This wrapper does not translate errors in the first word to ACPI
error status returns. Use this wrapper in the acpi_cpu(4) driver in
place of the existing _OSC code. While here, fix a bug where the wrong
count of words was passed when invoking _OSC.

Test Plan
  • booted on my laptop (x220) as part of testing a larget patchset of PCI-e hotplug support from which this was extracted.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Add a wrapper for evaluating _OSC methods..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: jkim.
jkim edited edge metadata.
This revision is now accepted and ready to land.Apr 20 2016, 6:04 PM
jkim requested changes to this revision.Apr 20 2016, 6:18 PM
jkim edited edge metadata.
This comment was removed by jkim.
This revision now requires changes to proceed.Apr 20 2016, 6:18 PM

I need to read the specs more thoroughly.

http://www.intel.com/content/www/us/en/standards/processor-vendor-specific-acpi-specification.html

Technically, the count should be 2. However, the _PDC shim in Page 9 shows SIZE does NOT include the STS0 buffer. :-(

jkim edited edge metadata.

https://sourceforge.net/p/tianocore/edk2/ci/master/tree/Vlv2DeviceRefCodePkg/ValleyView2Soc/CPU/PowerManagement/AcpiTables/Ssdt/CpuPm.asl

TianoCore EDK II does the same thing, i.e., count does not include the status buffer. However, I believe it will not matter in reality because most implementations seem to ignore the count any way.

This revision is now accepted and ready to land.Apr 20 2016, 7:11 PM

The TianaoCore code appears to just be a blind copy and paste of the code from Intel's spec.

Linux's code is more obscure, but it appears to use 2 for the Intel CPU _OSC:

http://lxr.free-electrons.com/source/drivers/cpufreq/pcc-cpufreq.c?v=3.14#L320

The places it runs _OSC on the PCI root it also uses a count including the first DWORD.

This revision was automatically updated to reflect the committed changes.
In D6022#128457, @jhb wrote:

Linux's code is more obscure, but it appears to use 2 for the Intel CPU _OSC:

http://lxr.free-electrons.com/source/drivers/cpufreq/pcc-cpufreq.c?v=3.14#L320

It is for PCC, not the Intel-specific one.

https://acpica.org/sites/acpica/files/Processor-Clocking-Control-v1p0.pdf

The places it runs _OSC on the PCI root it also uses a count including the first DWORD.

Yes, that's the one.

http://lxr.free-electrons.com/source/drivers/acpi/bus.c?v=3.14#L204