Page MenuHomeFreeBSD

D56812.id.diff
No OneTemporary

D56812.id.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;
};
@@ -488,8 +490,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);
@@ -536,7 +536,6 @@
constraint_package->Package.Elements[2].Integer.Value;
}
- sc->constraints_populated = true;
return (0);
}
@@ -549,8 +548,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.
@@ -596,7 +593,6 @@
constraint_obj->Package.Elements[3].Integer.Value;
}
- sc->constraints_populated = true;
return (0);
}
@@ -613,8 +609,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 doesn't have this function. */
is_amd = has_dsm(sc, DSM_AMD);
@@ -651,6 +647,10 @@
constraint->handle = NULL;
}
}
+
+#ifdef INVARIANTS
+ sc->get_constraints_succeeded = true;
+#endif
return (0);
}
@@ -661,7 +661,6 @@
bool violation = false;
#endif
- KASSERT(sc->constraints_populated, ("Constraints not populated"));
/*
* Avoid printing that constraints are respected when there are no
* constraints at all.

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 7:41 PM (14 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33015479
Default Alt Text
D56812.id.diff (1 KB)

Event Timeline