Skip to content

Navigation Menu

Sign in
Sign up

soc: apple: sep: unmap the firmware IOVA, not the physical address #592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
brentkearney wants to merge 1 commit into AsahiLinux:asahi-wip
base: asahi-wip
Choose a base branch
Loading
from brentkearney:sep-unmap-iova
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion drivers/soc/apple/sep.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ struct SepData {
shmem: ShMem,
region_params: FwRegionParams,
fw_mapped: Atomic<bool>,
fw_iova: Atomic<u64>,
}

impl SepData {
Expand All @@ -191,6 +192,7 @@ impl SepData {
mbox <- new_mutex!(None),
region_params,
fw_mapped: Atomic::new(false),
fw_iova: Atomic::new(0),
}),
GFP_KERNEL,
)
Expand All @@ -217,6 +219,7 @@ impl SepData {
dev_err!(self.dev, "Failed to map firmware");
return Err(ENOMEM);
}
self.fw_iova.store(res, Relaxed);
self.fw_mapped.store(true, Relaxed);
res >> IOVA_SHIFT
};
Expand Down Expand Up @@ -287,7 +290,7 @@ impl SepData {
unsafe {
bindings::dma_unmap_resource(
self.dev.as_raw(),
self.region_params.addr,
self.fw_iova.load(Relaxed),
self.region_params.size,
bindings::dma_data_direction_DMA_TO_DEVICE,
0,
Expand Down

AltStyle によって変換されたページ (->オリジナル) /