From: Cho KyongHo Date: Mon, 8 May 2017 04:36:09 +0000 (+0900) Subject: [COMMON] g2d: add System MMU fault handler X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=471bd3fe188dd2721ebea43639fd32f05717cab8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] g2d: add System MMU fault handler System MMU fault handler is registers to show the status of H/W and the driver when unexpected fault is occurred in System MMU for debugging purpose.. Change-Id: Ibe58a3a8f1b7e90c1a41875be20a18708075c5ad Signed-off-by: Cho KyongHo --- diff --git a/drivers/gpu/exynos/g2d/g2d_drv.c b/drivers/gpu/exynos/g2d/g2d_drv.c index 9a5261f8c0ad..cceafb50ede9 100644 --- a/drivers/gpu/exynos/g2d/g2d_drv.c +++ b/drivers/gpu/exynos/g2d/g2d_drv.c @@ -150,6 +150,20 @@ static irqreturn_t g2d_irq_handler(int irq, void *priv) return IRQ_HANDLED; } +#ifdef CONFIG_EXYNOS_IOVMM +static int g2d_iommu_fault_handler(struct iommu_domain *domain, + struct device *dev, unsigned long fault_addr, + int fault_flags, void *token) +{ + struct g2d_device *g2d_dev = token; + int job_id = g2d_hw_get_current_task(g2d_dev); + + g2d_dump_task(g2d_dev, job_id); + + return 0; +} +#endif + static __u32 get_hw_version(struct g2d_device *g2d_dev, __u32 *version) { int ret; @@ -320,6 +334,8 @@ static int g2d_probe(struct platform_device *pdev) return PTR_ERR(g2d_dev->clock); } + iovmm_set_fault_handler(&pdev->dev, g2d_iommu_fault_handler, g2d_dev); + ret = iovmm_activate(&pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "Failed to activate iommu\n");