Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163266127
D44032.id134866.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
D44032.id134866.diff
View Options
diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c
--- a/sys/arm64/arm64/gicv3_its.c
+++ b/sys/arm64/arm64/gicv3_its.c
@@ -291,8 +291,6 @@
vm_page_t ma; /* fake msi page */
};
-static void *conf_base;
-
typedef void (its_quirk_func_t)(device_t);
static its_quirk_func_t its_quirk_cavium_22375;
@@ -680,20 +678,29 @@
static void
gicv3_its_conftable_init(struct gicv3_its_softc *sc)
{
- void *conf_table;
-
- conf_table = atomic_load_ptr(&conf_base);
- if (conf_table == NULL) {
- conf_table = contigmalloc(LPI_CONFTAB_SIZE,
- M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR,
- LPI_CONFTAB_ALIGN, 0);
+ /* note: we assume the ITS children are serialized by the parent */
+ static void *conf_table;
+ int unit;
- if (atomic_cmpset_ptr((uintptr_t *)&conf_base,
- (uintptr_t)NULL, (uintptr_t)conf_table) == 0) {
- contigfree(conf_table, LPI_CONFTAB_SIZE, M_GICV3_ITS);
- conf_table = atomic_load_ptr(&conf_base);
- }
+ /*
+ * The PROPBASER is a singleton in our parent, so only unit 0 will set
+ * it up. Skip all the other units, but make a note of where it was done
+ * and how we set it up.
+ */
+ unit = device_get_unit(sc->dev);
+ if (unit != 0) {
+ KASSERT(conf_table != NULL, ("Conf table null for unit %d", unit));
+ sc->sc_conf_base = conf_table;
+ return;
}
+
+ /*
+ * Just allocate contiguous pages. We'll configure the PROPBASER
+ * register later in its_init_cpu_lpi().
+ */
+ conf_table = contigmalloc(LPI_CONFTAB_SIZE,
+ M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR,
+ LPI_CONFTAB_ALIGN, 0);
sc->sc_conf_base = conf_table;
/* Set the default configuration */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 2:20 PM (7 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35366936
Default Alt Text
D44032.id134866.diff (1 KB)
Attached To
Mode
D44032: gicv3: Change how we initialize its children.
Attached
Detach File
Event Timeline
Log In to Comment