Commit 308eb645 authored by Alexandre Courbot's avatar Alexandre Courbot
Browse files

gpu: nova-core: firmware: riscv: use dma::Coherent



Replace the nova-core local `DmaObject` with a `Coherent` that can
fulfill the same role.

Reviewed-by: default avatarGary Guo <gary@garyguo.net>
Reviewed-by: default avatarDanilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260327-b4-nova-dma-removal-v2-2-616e1d0b5cb3@nvidia.com


Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
parent 816718c6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5,13 +5,13 @@

use kernel::{
    device,
    dma::Coherent,
    firmware::Firmware,
    prelude::*,
    transmute::FromBytes, //
};

use crate::{
    dma::DmaObject,
    firmware::BinFirmware,
    num::FromSafeCast, //
};
@@ -66,7 +66,7 @@ pub(crate) struct RiscvFirmware {
    /// Application version.
    pub(crate) app_version: u32,
    /// Device-mapped firmware image.
    pub(crate) ucode: DmaObject,
    pub(crate) ucode: Coherent<[u8]>,
}

impl RiscvFirmware {
@@ -81,7 +81,7 @@ pub(crate) fn new(dev: &device::Device<device::Bound>, fw: &Firmware) -> Result<
            let len = usize::from_safe_cast(bin_fw.hdr.data_size);
            let end = start.checked_add(len).ok_or(EINVAL)?;

            DmaObject::from_data(dev, fw.data().get(start..end).ok_or(EINVAL)?)?
            Coherent::from_slice(dev, fw.data().get(start..end).ok_or(EINVAL)?, GFP_KERNEL)?
        };

        Ok(Self {