Page MenuHomeFreeBSD

D55505.diff
No OneTemporary

D55505.diff

diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c
--- a/sys/dev/acpica/acpi_perf.c
+++ b/sys/dev/acpica/acpi_perf.c
@@ -191,9 +191,14 @@
pkg = (ACPI_OBJECT *)buf.Pointer;
if (ACPI_PKG_VALID(pkg, 2)) {
rid = 0;
- error = acpi_PkgGas(dev, pkg, 0, &type, rid, &res, 0);
+ error = acpi_PkgGas(dev, pkg, 0, &type, rid, &res,
+ RF_SHAREABLE);
switch (error) {
case 0:
+#ifdef SYS_RES_FFH
+ if (type == SYS_RES_FFH)
+ device_quiet(dev);
+#endif
bus_release_resource(dev, type, rid, res);
bus_delete_resource(dev, type, rid);
device_set_desc(dev, "ACPI CPU Frequency Control");
@@ -325,14 +330,24 @@
device_printf(dev, "invalid perf register package\n");
goto out;
}
-
error = acpi_PkgGas(sc->dev, pkg, 0, &sc->perf_ctrl_type, sc->px_rid,
- &sc->perf_ctrl, 0);
- if (error) {
+ &sc->perf_ctrl, RF_SHAREABLE);
+#ifdef SYS_RES_FFH
+ if (sc->perf_ctrl_type == SYS_RES_FFH) {
/*
- * If the register is of type FFixedHW, we can only return
- * info, we can't get or set new settings.
+ * FFH control is handled by the per-CPU hwpstate driver; we
+ * only export the _PSS info and never touch the register, so
+ * release it.
*/
+ bus_release_resource(sc->dev, sc->perf_ctrl_type, sc->px_rid,
+ sc->perf_ctrl);
+ bus_delete_resource(sc->dev, sc->perf_ctrl_type, sc->px_rid);
+ sc->perf_ctrl = NULL;
+ sc->info_only = TRUE;
+ goto out;
+ }
+#endif
+ if (error) {
if (error == EOPNOTSUPP) {
sc->info_only = TRUE;
error = 0;
@@ -343,7 +358,17 @@
sc->px_rid++;
error = acpi_PkgGas(sc->dev, pkg, 1, &sc->perf_sts_type, sc->px_rid,
- &sc->perf_status, 0);
+ &sc->perf_status, RF_SHAREABLE);
+#ifdef SYS_RES_FFH
+ if (sc->perf_sts_type == SYS_RES_FFH) {
+ bus_release_resource(sc->dev, sc->perf_sts_type, sc->px_rid,
+ sc->perf_status);
+ bus_delete_resource(sc->dev, sc->perf_sts_type, sc->px_rid);
+ sc->perf_status = NULL;
+ sc->info_only = TRUE;
+ goto out;
+ }
+#endif
if (error) {
if (error == EOPNOTSUPP) {
sc->info_only = TRUE;

File Metadata

Mime Type
text/plain
Expires
Mon, Jul 6, 3:54 PM (11 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34358480
Default Alt Text
D55505.diff (2 KB)

Event Timeline