Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] Removal of `dma_read!` and `dma_write!` breaks compilation for 
`drivers/gpu/nova-core`.
--

commit 144cedc7de039fdec7f07bf6a514886b83913697
Author: Gary Guo <[email protected]>

rust: dma: remove dma_read! and dma_write!

The primitive read/write use case is covered by the io_read! and
io_write! macro. The non-primitive use case was finicky; they should
either be achieved using CoherentBox or as_ref()/as_mut() to assert the
lack of concurrent access, or should be using memcpy-like APIs to express
the non-atomic and tearable nature.

> diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs
> index ab6504910e4f..0ff4cce8e809 100644
> --- a/rust/kernel/dma.rs
> +++ b/rust/kernel/dma.rs

[ ... ]

> @@ -1265,85 +1219,3 @@ fn as_view(self) -> CoherentView<'a, Self::Target> {
>          }
>      }
>  }
> -
> -/// Reads a field of an item from an allocated region of structs.

[Severity: Low]
Does removing these macros break the build for drivers/gpu/nova-core?

Looking at drivers/gpu/nova-core/gsp/cmdq.rs:DmaGspMem::new(), it appears to
still rely on dma_write!:

    dma_write!(gsp_mem, .ptes.0[build: i], PteArray::<0>::entry(start, i)?);

Similarly, in drivers/gpu/nova-core/gsp/fw.rs:gsp_write_ptr():

    dma_read!(qs, .gspq.tx.0.writePtr) % MSGQ_NUM_PAGES

Could these users in nova-core be migrated to io_read! and io_write! in this
patch to prevent bisect breakage?

> -///
> -/// The syntax is of the form `kernel::dma_read!(dma, proj)` where `dma` is 
> an expression evaluating
> -/// to a [`Coherent`] and `proj` is a [projection 
> specification](kernel::ptr::project!).
> -///
> -/// # Examples
> -///

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=18

Reply via email to