Skip to content

Commit 308eb64

Browse files
committed
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: Gary Guo <gary@garyguo.net> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260327-b4-nova-dma-removal-v2-2-616e1d0b5cb3@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
1 parent 816718c commit 308eb64

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/nova-core/firmware/riscv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
66
use kernel::{
77
device,
8+
dma::Coherent,
89
firmware::Firmware,
910
prelude::*,
1011
transmute::FromBytes, //
1112
};
1213

1314
use crate::{
14-
dma::DmaObject,
1515
firmware::BinFirmware,
1616
num::FromSafeCast, //
1717
};
@@ -66,7 +66,7 @@ pub(crate) struct RiscvFirmware {
6666
/// Application version.
6767
pub(crate) app_version: u32,
6868
/// Device-mapped firmware image.
69-
pub(crate) ucode: DmaObject,
69+
pub(crate) ucode: Coherent<[u8]>,
7070
}
7171

7272
impl RiscvFirmware {
@@ -81,7 +81,7 @@ impl RiscvFirmware {
8181
let len = usize::from_safe_cast(bin_fw.hdr.data_size);
8282
let end = start.checked_add(len).ok_or(EINVAL)?;
8383

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

8787
Ok(Self {

0 commit comments

Comments
 (0)