[RFC PATCH 0/3] Rust: add runtime PM support

From: Beata Michalska

Date: Thu May 14 2026 - 12:20:05 EST


This series adds initial runtime PM support for Rust drivers.

The concept for Rust abstraction gets introduced in the first patch
in this series. It provides generated dev_pm_ops callbacks for runtime
suspend/resume, tracking runtime PM state, and allowing drivers to carry
custom state across transitions. It also introduces helper types for
common usage patterns and basic PM configuration.

Second one integrates dev_pm_ops into the Rust platform driver abstraction,
enabling drivers to register PM callbacks with the core.

The last in the series is provided for demonstrative purposes
(not intended to be an actual merge material).

This has been lightly tested with the Tyr driver.


Beata Michalska (3):
rust: Add runtime PM support
rust/platform: Add support for runtime PM
drm/tyr: wire runtime PM hooks

drivers/gpu/drm/tyr/driver.rs | 123 ++++-
drivers/gpu/drm/tyr/file.rs | 3 +
rust/bindings/bindings_helper.h | 1 +
rust/helpers/helpers.c | 1 +
rust/helpers/pm_runtime.c | 38 ++
rust/kernel/lib.rs | 1 +
rust/kernel/platform.rs | 18 +
rust/kernel/pm.rs | 924 ++++++++++++++++++++++++++++++++
8 files changed, 1086 insertions(+), 23 deletions(-)
create mode 100644 rust/helpers/pm_runtime.c
create mode 100644 rust/kernel/pm.rs

--
2.43.0