]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpu: nova-core: firmware: fwsec: use dma::Coherent
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 26 Mar 2026 15:22:09 +0000 (00:22 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Sat, 28 Mar 2026 13:20:07 +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-3-616e1d0b5cb3@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/firmware/fwsec/bootloader.rs

index 3b12d90d94126e637053cc18b2ad55c78a9dd501..bcb713a868e2cc0c1bf45f5007c4ce3e9c2a805a 100644 (file)
@@ -12,6 +12,7 @@ use kernel::{
         self,
         Device, //
     },
+    dma::Coherent,
     io::{
         register::WithBase, //
         Io,
@@ -29,7 +30,6 @@ use kernel::{
 };
 
 use crate::{
-    dma::DmaObject,
     driver::Bar0,
     falcon::{
         self,
@@ -129,7 +129,7 @@ unsafe impl AsBytes for BootloaderDmemDescV2 {}
 /// operation.
 pub(crate) struct FwsecFirmwareWithBl {
     /// DMA object the bootloader will copy the firmware from.
-    _firmware_dma: DmaObject,
+    _firmware_dma: Coherent<[u8]>,
     /// Code of the bootloader to be loaded into non-secure IMEM.
     ucode: KVec<u8>,
     /// Descriptor to be loaded into DMEM for the bootloader to read.
@@ -211,7 +211,7 @@ impl FwsecFirmwareWithBl {
 
             (
                 align_padding,
-                DmaObject::from_data(dev, firmware_obj.as_slice())?,
+                Coherent::from_slice(dev, firmware_obj.as_slice(), GFP_KERNEL)?,
             )
         };