]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpu: nova-core: falcon: use dma::Coherent
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 26 Mar 2026 15:22:10 +0000 (00:22 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Sat, 28 Mar 2026 13:20:08 +0000 (22:20 +0900)
Replace the nova-core local `DmaObject` with a `Coherent` that can
fulfill the same role.

Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260327-b4-nova-dma-removal-v2-4-616e1d0b5cb3@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/falcon.rs

index c49ec6ded9095cf9f281f8228260e298de1042ab..e0315fda576b8e994bbc4112758d52fd079ba8f7 100644 (file)
@@ -10,6 +10,7 @@ use kernel::{
         Device, //
     },
     dma::{
+        Coherent,
         DmaAddress,
         DmaMask, //
     },
@@ -28,7 +29,6 @@ use kernel::{
 
 use crate::{
     bounded_enum,
-    dma::DmaObject,
     driver::Bar0,
     falcon::hal::LoadMethod,
     gpu::Chipset,
@@ -504,7 +504,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
     fn dma_wr(
         &self,
         bar: &Bar0,
-        dma_obj: &DmaObject,
+        dma_obj: &Coherent<[u8]>,
         target_mem: FalconMem,
         load_offsets: FalconDmaLoadTarget,
     ) -> Result {
@@ -614,7 +614,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
         fw: &F,
     ) -> Result {
         // Create DMA object with firmware content as the source of the DMA engine.
-        let dma_obj = DmaObject::from_data(dev, fw.as_slice())?;
+        let dma_obj = Coherent::from_slice(dev, fw.as_slice(), GFP_KERNEL)?;
 
         self.dma_reset(bar);
         bar.update(regs::NV_PFALCON_FBIF_TRANSCFG::of::<E>().at(0), |v| {