Skip to content

rust: add support for port io

Andrew Ballance dri-devel linux-pci lkml nouveau rust-for-linux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 2 repliesIn review
  2. v111 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- remove PortIo
- typo fixes
- squash "fixup" patches so that patches will not introduce build fails
- move some changes across patches so that build will not fail
- changes macro define in rust/helpers/io.c to use full rust name
- specialize io_backend for the x86 case
- do not modify lib/iomap.c
- rebased on v6.15-rc6

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6rust: helpers: io: use macro to generate io accessor functionsrust/helpers/io.c+29 -760 replies
2/6rust: io: make Io use IoAccess traitdrivers/gpu/nova-core/regs.rs rust/kernel/devres.rs rust/kernel/io.rs +2 more+263 -1860 replies
3/6rust: io: add new Io typerust/helpers/io.c rust/kernel/io.rs+98 -60 replies
4/6rust: io: implement Debug for IoRaw and add some doctestsrust/kernel/io.rs+63 -00 replies
5/6rust: io: add from_raw_cookie functionsrust/kernel/io.rs+73 -00 replies
6/6rust: pci: make Bar generic over Iodrivers/gpu/nova-core/driver.rs rust/kernel/pci.rs samples/rust/rust_driver_pci.rs+83 -240 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/6] rust: add support for port io

currently the rust Io type maps to the c read{b, w, l, q}/write{b, w, l, q} functions and have no support for port io. this can be a problem for pci::Bar because the pointer returned by pci_iomap can be either PIO or MMIO [0].

this patch series splits the Io type into Io, and MMIo. Io can be used to access PIO or MMIO. MMIo can only access memory mapped IO but might, depending on the arch, be faster than Io. and updates pci::Bar, so that it is generic over Io and, a user can optionally give a compile time hint about the type of io.

changes in v2:
- remove PortIo
- typo fixes
- squash "fixup" patches so that patches will not introduce build fails
- move some changes across patches so that build will not fail
- changes macro define in rust/helpers/io.c to use full rust name
- specialize io_backend for the x86 case
- do not modify lib/iomap.c
- rebased on v6.15-rc6

Link to v1: https://lore.kernel.org/rust-for-linux/[email protected]/

Andrew Ballance (3):
rust: io: add new Io type
rust: io: add from_raw_cookie functions
rust: pci: make Bar generic over Io

Fiona Behrens (3):
rust: helpers: io: use macro to generate io accessor functions
rust: io: make Io use IoAccess trait
rust: io: implement Debug for IoRaw and add some doctests

 drivers/gpu/nova-core/driver.rs |   4 +-
 drivers/gpu/nova-core/regs.rs   |   1 +
 rust/helpers/io.c               | 112 ++----
 rust/kernel/devres.rs           |   4 +-
 rust/kernel/io.rs               | 645 +++++++++++++++++++++++---------
 rust/kernel/pci.rs              | 101 +++--
 samples/rust/rust_driver_pci.rs |   6 +-
 7 files changed, 595 insertions(+), 278 deletions(-)

base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3

Signature · 1 line
2.49.0