Skip to content

RFC rust: pci: Introduce PCIe error handler support and sample usage

Guangbo Cui linux-pci rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rust: pci: add PCIe bus error handler supportrust/kernel/pci.rs rust/kernel/pci/err.rs samples/rust/rust_dma.rs +2 more+289 -00 replies
2/2sample: rust: pci: implement dummy error handlers to demonstrate usagesamples/rust/rust_driver_pci.rs+45 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH v1 0/2] rust: pci: Introduce PCIe error handler support and sample usage

Hi all,

This RFC patchset introduces basic PCIe Advanced Error Reporting (AER) support for Rust PCI drivers and provides a simple example to demonstrate it's usage.

The first patch adds the necessary infrastructure in the Rust PCI layer to support device-specific PCI error handlers, mirroring the existing C struct pci_error_handlers callbacks.

The second patch updates the Rust PCI sample driver to implement a set of dummy error handlers. These callbacks simply print messages and return predefined results, serving as a guide for future Rust PCI driver authors who want to handle PCIe AER events safely.

This series is an RFC for discussion and not intended for merging yet.

---

Guangbo Cui (2):
rust: pci: add PCIe bus error handler support
sample: rust: pci: implement dummy error handlers to demonstrate usage

 rust/kernel/pci.rs                    |  11 ++
 rust/kernel/pci/err.rs                | 273 ++++++++++++++++++++++++++
 samples/rust/rust_dma.rs              |   1 +
 samples/rust/rust_driver_auxiliary.rs |   2 +
 samples/rust/rust_driver_pci.rs       |  47 ++++-
 5 files changed, 333 insertions(+), 1 deletion(-)
 create mode 100644 rust/kernel/pci/err.rs
Signature · 1 line
2.43.0