public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] rust, nova-core: add SizeConstants trait for SZ_* constants
@ 2026-04-04  2:12 John Hubbard
  2026-04-04  2:12 ` [PATCH v5 1/3] rust: sizes: add SizeConstants trait for device address space constants John Hubbard
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: John Hubbard @ 2026-04-04  2:12 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot
  Cc: Joel Fernandes, Timur Tabi, Alistair Popple, Eliot Courtney,
	Shashank Sharma, Zhi Wang, David Airlie, Simona Vetter,
	Bjorn Helgaas, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, LKML, John Hubbard

Changes in v5:
  * Changed the subject line of this cover letter to not use the old
    DeviceSize name.

  * Collected Reviewed-by tags from Alexandre Courbot and Joel
    Fernandes, and Acked-by from Gary Guo.

  * Added a new patch 3/3 with a todo.rst entry for device address
    type wrappers and a marker trait, as discussed with Danilo.

  * Rebased onto latest drm-rust-next.

Changes in v4:
  * Renamed the trait from DeviceSize to SizeConstants.

  * Added backticks and trailing periods to all hex-value doc comments
    on the SZ_* constants.

  * Removed redundant type annotations from doc-test examples.

  * Used a `use` import for PAGE_SIZE in the module-level doc-test
    instead of a fully qualified path.

  * Rewrote doc-test comments to clarify the distinction between
    module-level constants (no type qualifier) and trait associated
    constants (type qualifier required).

  * Added Reviewed-by from Eliot Courtney.

Changes in v3:
  * Dropped the Alignment::from_u64() patch.

  * Reworked define_sizes! macro to accept target types as arguments
    (define_sizes!(u32, u64, usize)) using recursive macro arms,
    instead of hardcoding impls for u32 and u64. Overflow checking
    uses u128 casts so the same assert works for any ("reasonable")
    target type.

  * Added usize to the DeviceSize implementations, so the trait
    covers u32, u64, and usize.

  * Hex values for each constant are now proper doc-comments
    (forwarded via macro meta), instead of inline comments.

  * Rebased onto latest drm-rust-next.

Changes in v2:
  * Replaced flat SZ_*_U64 constants with a DeviceSize trait that
    provides SZ_* as associated constants on u32 and u64.

  * A define_sizes! macro generates everything from one list of names.

  * Added Alignment::from_u64() so alignment values can be constructed
    from DeviceSize constants without falling back to usize variants.

  * Rebased onto drm-rust-next. No longer depends on the Blackwell
    patchset.

v1 is here:
    https://lore.kernel.org/20260310023145.120037-1-jhubbard@nvidia.com

John Hubbard (3):
  rust: sizes: add SizeConstants trait for device address space
    constants
  gpu: nova-core: use SizeConstants trait for u64 size constants
  gpu: nova-core: add task for device address type wrappers

 Documentation/gpu/nova/core/todo.rst |  13 +++
 drivers/gpu/nova-core/fb.rs          |  21 ++--
 drivers/gpu/nova-core/gsp/fw.rs      |  15 ++-
 drivers/gpu/nova-core/regs.rs        |   7 +-
 rust/kernel/sizes.rs                 | 167 ++++++++++++++++++++-------
 5 files changed, 155 insertions(+), 68 deletions(-)


base-commit: 7c50d748b4a635bc39802ea3f6b120e66b1b9067
-- 
2.53.0


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

end of thread, other threads:[~2026-04-04  4:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-04  2:12 [PATCH v5 0/3] rust, nova-core: add SizeConstants trait for SZ_* constants John Hubbard
2026-04-04  2:12 ` [PATCH v5 1/3] rust: sizes: add SizeConstants trait for device address space constants John Hubbard
2026-04-04  2:33   ` Miguel Ojeda
2026-04-04  4:20     ` Alexandre Courbot
2026-04-04  2:12 ` [PATCH v5 2/3] gpu: nova-core: use SizeConstants trait for u64 size constants John Hubbard
2026-04-04  2:12 ` [PATCH v5 3/3] gpu: nova-core: add task for device address type wrappers John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox