From 6d6a8fc3df4c765393a39b61c86858315bab418e Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Tue, 22 Jul 2025 22:34:34 +0800 Subject: [PATCH] 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 --- drivers/misc/rockchip/pcie-rkep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/rockchip/pcie-rkep.c b/drivers/misc/rockchip/pcie-rkep.c index f448513101fc..1d5b4c51fcde 100644 --- a/drivers/misc/rockchip/pcie-rkep.c +++ b/drivers/misc/rockchip/pcie-rkep.c @@ -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);