mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
misc: rockchip: pcie-rkep: Using BAR2 as device memory
1.Usually BAR2 can be used to map endpoint registers; 2.Using the noncache attribute can effectively avoid problems caused by improper use by users. Change-Id: I99a11c00d59079c080f6bd53291d970c60311430 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
@@ -610,8 +610,7 @@ static int pcie_rkep_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_BAR2 ||
|
||||
pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_USER_MEM)
|
||||
if (pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_USER_MEM)
|
||||
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||
else
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
|
||||
Reference in New Issue
Block a user