Page MenuHomeFreeBSD

D56812.id177203.diff
No OneTemporary

D56812.id177203.diff

diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c
--- a/sys/dev/acpica/acpi_spmc.c
+++ b/sys/dev/acpica/acpi_spmc.c
@@ -223,7 +223,9 @@
struct eventhandler_entry *eh_suspend;
struct eventhandler_entry *eh_resume;
- bool constraints_populated;
+#ifdef INVARIANTS
+ bool get_constraints_succeeded;
+#endif
size_t constraint_count;
struct acpi_spmc_constraint *constraints;
};
@@ -484,8 +486,6 @@
ACPI_OBJECT *detail;
ACPI_OBJECT *constraint_package;
- KASSERT(!sc->constraints_populated, ("Constraints already populated"));
-
sc->constraint_count = object->Package.Count;
sc->constraints = malloc(sc->constraint_count * sizeof *sc->constraints,
M_TEMP, M_WAITOK | M_ZERO);
@@ -532,7 +532,6 @@
constraint_package->Package.Elements[2].Integer.Value;
}
- sc->constraints_populated = true;
return (0);
}
@@ -545,8 +544,6 @@
struct acpi_spmc_constraint *constraint;
ACPI_OBJECT *name_obj;
- KASSERT(!sc->constraints_populated, ("Constraints already populated"));
-
/*
* First element in the package is unknown.
* Second element is the number of device constraints.
@@ -592,7 +589,6 @@
constraint_obj->Package.Elements[3].Integer.Value;
}
- sc->constraints_populated = true;
return (0);
}
@@ -609,8 +605,8 @@
struct acpi_spmc_constraint *constraint;
sc = device_get_softc(dev);
- if (sc->constraints_populated)
- return (0);
+
+ MPASS(!sc->get_constraints_succeeded);
/* The Microsoft DSM set doesn't have this DSM. */
is_amd = has_dsm(sc, DSM_AMD);
@@ -647,6 +643,10 @@
constraint->handle = NULL;
}
}
+
+#ifdef INVARIANTS
+ sc->get_constraints_succeeded = true;
+#endif
return (0);
}
@@ -657,7 +657,6 @@
bool violation = false;
#endif
- KASSERT(sc->constraints_populated, ("Constraints not populated"));
for (size_t i = 0; i < sc->constraint_count; i++) {
struct acpi_spmc_constraint *constraint = &sc->constraints[i];

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 23, 1:54 AM (10 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32707806
Default Alt Text
D56812.id177203.diff (1 KB)

Event Timeline