Skip to content

DMA: implement a dma::Range type #1248

Open

Description

@dakr

Currently the dma::Coherent API provides the DmaAddress type as a typedef (type DmaAddress = bindings::dma_addr_t) only. The base address is handed out as a bare integer, so any offset arithmetic a driver does on it is unchecked.

Add a dma::Range type that couples a base dma::Address with a length and only hands out addresses and sub-ranges provably within [base, base + len). All arithmetic must be checked against both the length and overflow of the underlying dma_addr_t.


This requires submitting a proper patch to the corresponding Linux kernel mailing lists. Please remember to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), use a proper title for the commit, sign your commit under the Developer's Certificate of Origin and add a Suggested-by: and Link: tags to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.

Activity

  1. added
    device resourcesRelated to device resources, such as MMIO, IRQs, DMA, etc.
    easyExpected to be an easy issue to resolve.
    on Jul 25, 2026
  2. blitzRahul commented on Jul 25, 2026

    @blitzRahul

    Sounds like a fun first issue to me, working on it.

  3. vasilisalmpanis commented on Aug 6, 2026

    @vasilisalmpanis
  4. vasilisalmpanis commented on Aug 7, 2026

    @vasilisalmpanis

    Hi @dakr, after reading recent messages in the list, its unclear to me if this issue should remain open.
    I'm talking about Gary's comment about IO projections in https://lore.kernel.org/rust-for-linux/20260806212503.3119449-1-dakr@kernel.org/T/#m6cae4bc52ce9f502905464e763ac7490c166c54c
    Should I continue working on it and send v2 or its not necessary anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    device resourcesRelated to device resources, such as MMIO, IRQs, DMA, etc.easyExpected to be an easy issue to resolve.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions