On Fri Jan 16, 2026 at 5:52 PM CET, Jason Gunthorpe wrote: > The C code doesn't really work like that, it works on sync teardown > flows. If you want to write correct C code you need to think about all > the concurrency the driver has and ensure that removal undoes it
Again, it depends: Sometimes a synchronized teardown is not possible. Iff a synchronized teardown is not possible by design, this is where revocable is useful instead. However, a synchronized teardown should of course always be preferred. And just to clarify, since you said "the C code": The Rust code follows exactly the the same principle, prefer synchronized teardown whenever possible. (The only difference with Rust is that we can always guard device resources and iff synchronized teardown is ensured through the type system the guard becomes zero-cost for accesses.)
