BoF: Object Life-Time Handling in Driver Subsystems
summary
Device driver subsystems frequently crash when provider drivers free their per-driver memory while consumers still hold references; the concrete fix here is to have the subsystem allocate the reference-counted device while drivers allocate only an implementation blob, protect the implementation pointer with SRCU-protected implementation pointer, and coordinate unbind with SRCU synchronisation. This split responsibility approach lands in mainline for the GPIO subsystem and stops dangling-pointer crashes; alternatives discussed are handoff allocation and deep-copy config registration.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:50Driver resource handling problems
- 3:17Logical vs physical devices
- 4:24GPIO crash fix
- 5:31Provider-consumer approaches
- 9:26Critique of provider structures
- 12:46Read-only config structures
- 14:12Device tree overlays impact
- 15:01Device links limitations
- 17:31Unbind scenarios discussion
- 20:04GPIO interrupt handling
- 21:55NFC flawed solution
- 23:40Power sequencing solution
- 25:47Why SRCU for GPIO
- 27:12Device tree removal fixes
- 29:41Provider driver API changes
- 31:32Removable hardware use case
- 33:19Device tree overlays dynamic
- 35:06Unified provider-consumer framework
- 37:13Module unloading safety
- 39:00Final remarks & Q&A
related talks
53mImproving resource ownership and life-time in linux device drivers
41mObject Lifetime Issues - a Threat for Safety?
47mSubsystems with Object Lifetime Issues (in the Embedded Case)
44mWhy is devm_kzalloc() harmful and what can we do about it
35mCompound Interest - Dealing with Two Decades of Technical Debt in Embedded...
45mBOF: Corporate Use of Embedded Linux
50mHow Not to Write X86 Platform Drivers
44mBoF: Devicetree
