Sep 18 – 20, 2024
Europe/Vienna timezone

Runtime hotplug on non-discoverable busses with device tree overlays

Sep 20, 2024, 5:45 PM
25m
"Room 1.15 - 1.16" (Austria Center)

"Room 1.15 - 1.16"

Austria Center

106
Internet of Things & Embedded MC Internet of Things & Embedded MC

Speakers

Luca Ceresoli (Bootlin) Hervé Codina

Description

New embedded products are being developed by the industry having add-on boards that can be hot-plugged to the main board to extend features, and do so using busses not natively hot-pluggable and discoverable such as USB or PCI. Instead they use busses that are traditionally not removable such as I²C, SPI, and even more complex ones such as MIPI DSI.

Currently Linux is unable to handle such situations. This session aims at discussing how to solve the main blocker issues.


What needs to be supported for such products is add-ons that:

  • can be plugged and removed at runtime at any moment without notice
  • add devices on non discoverable busses, where fixed devices can be already present on the main board
  • use a non-standard (product-specific) connector
  • provide a way to detect which add-on model gets attached among several available

The most suitable tool to handle this use case appears to be device tree overlays, which already provide most of the required functionality. However using overlays exposes a number of problems.

This topic has been discussed informally during an unconference session at ELC 2024 and a series with a proposed implementation [Ceresoli 2024 v4].

Other related but different use cases include:

Topics to discuss:

  • Any other new similar use cases from the audience?
  • How to describe in the device tree the hotplug connector and the relationship between the components on the removable add-on and the busses on the main board they attach to
  • Runtime dependency between devices: add-on devices have to be removed in the correct order, and devlink is there to ensure this; however currently devlink does not work correctly when DT overlays are loaded
  • Proper instantiation and removal of add-on devices for the involved subsystems: I²C, platform, DRM, interrupts

Other topics that might be discussed:

  • fixing issues with various subsystems and drivers that don't react well on device removal
  • fixing memory leaks on overlay removal

Primary authors

Presentation materials