Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163319242
D56812.id177203.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56812.id177203.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D56812: acpi_spmc(4): INVARIANTS: Do not panic on getting constraints failure
Attached
Detach File
Event Timeline
Log In to Comment