All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] rust: io: add read-only and write-only views and registers
@ 2026-10-15 12:39 Daniel Almeida
  2026-10-15 12:39 ` [PATCH 1/7] rust: io: split IoCapable into IoReadable and IoWritable Daniel Almeida
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Daniel Almeida @ 2026-10-15 12:39 UTC (permalink / raw)
  To: Danilo Krummrich, Abdiel Janulgue, Robin Murphy, Andreas Hindborg,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Alice Ryhl, Trevor Gross, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan, Bjorn Helgaas,
	Krzysztof Wilczyński, David Airlie, Simona Vetter
  Cc: driver-core, rust-for-linux, linux-kernel, linux-pci, dri-devel,
	Daniel Almeida

This series adds read-only and write-only I/O views, and the #[ro]
and #[wo] attributes to register!. An access in the wrong direction
then does not compile.

This is needed by Tyr, where the doorbell registers are write-only and
the CSF control and output blocks shared with the firmware must only be
read by the driver. Laura's CSF interface series [1] will be the second
user.

Patches 1 and 2 split IoCapable into IoReadable and IoWritable, and
IoCopyable into IoCopyReadable and IoCopyWritable.

Patch 3 adds the ReadOnly and WriteOnly views, returned by
Io::read_only() and Io::write_only(). They wrap any view, and the views
projected from them keep the restriction.

Patch 4 makes the primitive accessors (read32() and friends) project the
view directly instead of going through the generic read and write
methods.

Patch 5 lets an IoLoc carry an access mode, which is applied to the view
projected through it.

Patch 6 adds the #[ro] and #[wo] attributes to register!.

Patch 7 marks the read-only and write-only registers in Tyr. Where
regs.rs does not document a mode, it follows the register permissions
for v10 GPUs in Arm's kbase driver (r54p1).

This is based on drm-rust-next.

[1] https://lore.kernel.org/r/20260915-tyr-interfaces-v1-6-5d28f1f75aca@collabora.com

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
---
Daniel Almeida (7):
      rust: io: split IoCapable into IoReadable and IoWritable
      rust: io: split IoCopyable into IoCopyReadable and IoCopyWritable
      rust: io: add read-only and write-only views
      rust: io: project primitive accessors directly
      rust: io: let I/O locations carry an access mode
      rust: io: register: add `#[ro]` and `#[wo]` attributes
      drm/tyr: mark read-only and write-only registers

 drivers/gpu/drm/tyr/regs.rs |  77 ++++++++
 rust/kernel/dma.rs          |  29 +--
 rust/kernel/io.rs           | 416 +++++++++++++++++++++++++++++++++-----------
 rust/kernel/io/access.rs    |  76 ++++++++
 rust/kernel/io/register.rs  |  71 +++++++-
 rust/kernel/pci/io.rs       |  10 +-
 rust/macros/io/register.rs  |  34 +++-
 7 files changed, 595 insertions(+), 118 deletions(-)
---
base-commit: 5a1b7121a6c4db6c0239d3ac3fd1c2bb33a40025
change-id: 20261015-io-access-modes-19ac2b0aa238

Best regards,
--  
Daniel Almeida <daniel.almeida@collabora.com>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-10-15 12:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 12:39 [PATCH 0/7] rust: io: add read-only and write-only views and registers Daniel Almeida
2026-10-15 12:39 ` [PATCH 1/7] rust: io: split IoCapable into IoReadable and IoWritable Daniel Almeida
2026-10-15 12:46   ` sashiko-bot
2026-10-15 12:39 ` [PATCH 2/7] rust: io: split IoCopyable into IoCopyReadable and IoCopyWritable Daniel Almeida
2026-10-15 12:44   ` sashiko-bot
2026-10-15 12:39 ` [PATCH 3/7] rust: io: add read-only and write-only views Daniel Almeida
2026-10-15 12:44   ` sashiko-bot
2026-10-15 12:39 ` [PATCH 4/7] rust: io: project primitive accessors directly Daniel Almeida
2026-10-15 12:44   ` sashiko-bot
2026-10-15 12:39 ` [PATCH 5/7] rust: io: let I/O locations carry an access mode Daniel Almeida
2026-10-15 12:50   ` sashiko-bot
2026-10-15 12:39 ` [PATCH 6/7] rust: io: register: add `#[ro]` and `#[wo]` attributes Daniel Almeida
2026-10-15 12:47   ` sashiko-bot
2026-10-15 12:39 ` [PATCH 7/7] drm/tyr: mark read-only and write-only registers Daniel Almeida
2026-10-15 12:43   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.