Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152935612
D48762.id150258.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
858 B
Referenced Files
None
Subscribers
None
D48762.id150258.diff
View Options
Index: sys/compat/linuxkpi/common/src/linux_xarray.c
===================================================================
--- sys/compat/linuxkpi/common/src/linux_xarray.c
+++ sys/compat/linuxkpi/common/src/linux_xarray.c
@@ -362,9 +362,19 @@
struct radix_tree_iter iter;
void **ppslot;
+ xa_lock(xa);
radix_tree_for_each_slot(ppslot, &xa->xa_head, &iter, 0)
radix_tree_iter_delete(&xa->xa_head, &iter, ppslot);
- mtx_destroy(&xa->xa_lock);
+ xa_unlock(xa);
+
+ /*
+ * The mutex initialized in `xa_init_flags()` is not destroyed here on
+ * purpose. The reason is that on Linux, the xarray remains usable
+ * after a call to `xa_destroy()`. For instance the i915 DRM driver
+ * relies on that during the initialixation of its GuC. Basically,
+ * `xa_destroy()` "resets" the structure to zero but doesn't really
+ * destroy it.
+ */
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 4:34 AM (15 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31735992
Default Alt Text
D48762.id150258.diff (858 B)
Attached To
Mode
D48762: linuxkpi: Don't destroy the mutex in `xa_destroy()`
Attached
Detach File
Event Timeline
Log In to Comment