Page MenuHomeFreeBSD

Summary: acpi: Add an interface to obtain DSM information
ClosedPublic

Authored by bwidawsk on Sep 11 2018, 6:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 25, 1:58 PM
Unknown Object (File)
Tue, Oct 22, 6:57 PM
Unknown Object (File)
Sep 13 2024, 1:26 AM
Unknown Object (File)
Sep 12 2024, 4:58 AM
Unknown Object (File)
Sep 11 2024, 8:33 PM
Unknown Object (File)
Sep 11 2024, 5:09 AM
Unknown Object (File)
Sep 7 2024, 9:36 PM
Unknown Object (File)
Sep 7 2024, 12:37 AM
Subscribers

Details

Summary

The Device Specific Method (_DSM) is on optional object that defines
device specific controls. This will be useful for our power management
controller in upcoming patches. More information can be found in ACPI
spec 6.2 section 9.1.1

https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf


I've had this sitting in my branch for emulated S3 for quite a while. It works
well there and upcoming devices such as NVDIMM may need this before I am ready
to submit my branch for review.

Test Plan

Tested in my s0ix branch

Diff Detail

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

Event Timeline

Here is some sample usage from the SPMC driver which will later be up for review:

	dsm_bits = acpi_DSMQuery(acpi_get_handle(dev), lps0_uuid, SPMC_REVISION);
	if ((dsm_bits & 1) == 0) {
		device_printf(dev, "Useless device without _DSM\n");
		return (ENODEV);
	}
	status = acpi_EvaluateDSM(handle, lps0_uuid, SPMC_REVISION,
	    LPS0_DEVICE_CONSTRAINTS, &buf);
 	if (ACPI_FAILURE(status))
		return (ENXIO);
sys/dev/acpica/acpi.c
2577 ↗(On Diff #47920)

9.1.1 ?

2587 ↗(On Diff #47920)

Style(9) prefers to avoid initialization in declaration.

2593 ↗(On Diff #47920)

return (0);

2638 ↗(On Diff #47920)

Might be, pass PACKAGE as an arg to acpi_EvaluateDSM() ?

2644 ↗(On Diff #47920)

to use ?

2659 ↗(On Diff #47920)

I do not quite understand this comparision.

bwidawsk marked 5 inline comments as done.
bwidawsk added inline comments.
sys/dev/acpica/acpi.c
2577 ↗(On Diff #47920)

It was the correct section for the wrong version of the spec :-)

2638 ↗(On Diff #47920)

That's fine with me. I was planning to wait until there was actually a user of it. For my usage, it's always just empty, and I just looked now and saw NVDIMM does have some uses for it.

2659 ↗(On Diff #47920)

I can't remember what I was trying to do here but it doesn't make sense in its current form. I also don't ever expect out_buf to be NULL, so I've changed that as well.

bwidawsk marked 2 inline comments as done.

Addressed kib's comments.

kib added inline comments.
sys/dev/acpica/acpi.c
2616 ↗(On Diff #48013)

One more return ();

2662 ↗(On Diff #48013)

And there.

2577 ↗(On Diff #47920)

Perhaps mention the version in the comment then ?

This revision is now accepted and ready to land.Sep 13 2018, 7:47 PM

Approved assuming @kib's updates are included.

This revision was automatically updated to reflect the committed changes.