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)
May 22 2024, 3:14 PM
Unknown Object (File)
May 21 2024, 2:37 PM
Unknown Object (File)
May 21 2024, 8:31 AM
Unknown Object (File)
Feb 9 2024, 6:51 AM
Unknown Object (File)
Dec 22 2023, 9:27 PM
Unknown Object (File)
Oct 20 2023, 11:16 AM
Unknown Object (File)
Oct 17 2023, 3:41 PM
Unknown Object (File)
Aug 27 2023, 2:59 PM
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