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

Beata Michalska posted 3 patches 4 weeks ago
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
[RFC PATCH 0/3] Rust: add runtime PM support
Posted by Beata Michalska 4 weeks ago
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
Re: [RFC PATCH 0/3] Rust: add runtime PM support
Posted by Miguel Ojeda 3 weeks, 5 days ago
On Thu, May 14, 2026 at 5:10 PM Beata Michalska <beata.michalska@arm.com> wrote:
>
> This series adds initial runtime PM support for Rust drivers.

Cc'ing the linux-pm list as well.

Cheers,
Miguel