From: Jeonghee Kim Date: Thu, 24 May 2018 00:31:03 +0000 (+0900) Subject: [COMMON] media: mfc: parse sysmmu info for checking sysmmu fault. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=328c2f74d869e8e2552146b24e9e36b728c11bb4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] media: mfc: parse sysmmu info for checking sysmmu fault. If sysmmu is used with other IPs, it should be checked whether it's an MFC fault. Change-Id: Ibc886b774a247d434a10db092d195f2039690e49 Signed-off-by: Jeonghee Kim --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc.c b/drivers/media/platform/exynos/mfc/s5p_mfc.c index 3d0c87ff47ab..8ee4cb6d761f 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc.c @@ -905,6 +905,15 @@ int s5p_mfc_sysmmu_fault_handler(struct iommu_domain *iodmn, struct device *devi } } + /* If sysmmu is used with other IPs, it should be checked whether it's an MFC fault */ + if (dev->pdata->share_sysmmu) { + if ((MFC_MMU0_READL(MFC_MMU_FAULT_TRANS_INFO) & dev->pdata->axid_mask) + != dev->pdata->mfc_fault_num) { + mfc_err_dev("This is not a MFC page fault\n"); + return 0; + } + } + if (MFC_MMU0_READL(MFC_MMU_INTERRUPT_STATUS)) { if (MFC_MMU0_READL(MFC_MMU_FAULT_TRANS_INFO) & MFC_MMU_FAULT_TRANS_INFO_RW_MASK) dev->logging_data->cause |= (1 << MFC_CAUSE_0WRITE_PAGE_FAULT); @@ -944,6 +953,9 @@ static void mfc_parse_dt(struct device_node *np, struct s5p_mfc_dev *mfc) of_property_read_u32(np, "ip_ver", &pdata->ip_ver); of_property_read_u32(np, "debug_mode", &pdata->debug_mode); + of_property_read_u32(np, "share_sysmmu", &pdata->share_sysmmu); + of_property_read_u32(np, "axid_mask", &pdata->axid_mask); + of_property_read_u32(np, "mfc_fault_num", &pdata->mfc_fault_num); of_property_read_u32(np, "nal_q", &pdata->nal_q); of_property_read_u32(np, "skype", &pdata->skype); of_property_read_u32(np, "black_bar", &pdata->black_bar); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h index e04fb56904f8..fbbed9cc03dc 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h @@ -372,6 +372,9 @@ struct s5p_mfc_qos { struct s5p_mfc_platdata { int ip_ver; int debug_mode; + int share_sysmmu; + int axid_mask; + int mfc_fault_num; int nal_q; int skype; int black_bar;