From patchwork Thu Mar 12 04:36:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 5990621 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D03799F318 for ; Thu, 12 Mar 2015 04:36:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4AB320396 for ; Thu, 12 Mar 2015 04:36:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 745EE2038F for ; Thu, 12 Mar 2015 04:36:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA3EF6E111; Wed, 11 Mar 2015 21:36:08 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id A98E86E111 for ; Wed, 11 Mar 2015 21:36:07 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NL300I6Z0S6KE40@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 12 Mar 2015 13:36:06 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id DD.56.11124.6B711055; Thu, 12 Mar 2015 13:36:06 +0900 (KST) X-AuditID: cbfee68e-f79b46d000002b74-60-550117b68f22 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E2.87.20081.5B711055; Thu, 12 Mar 2015 13:36:06 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NL30084W0S34LJ0@mmp2.samsung.com>; Thu, 12 Mar 2015 13:36:05 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos: add more condition to check iommu support Date: Thu, 12 Mar 2015 13:36:01 +0900 Message-id: <1426134962-12357-1-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPLMWRmVeSWpSXmKPExsWyRsSkWHebOGOowbdLXBZXvr5ns1g6o4/V YtL9CSwOzB73u48zefRtWcUYwBTFZZOSmpNZllqkb5fAlbHy/i3mguMWFevXVDUw7tfvYuTk kBAwkbg29z0jhC0mceHeerYuRi4OIYGljBK/d25jhilquPaDESIxnVHiV+NadpCEkEAbk8Te 1ZogNpuAnsSCaz/A4iICyhJ/J64Cm8os4CtxcPZTVhBbWMBLor9hCZDNwcEioCqxapspSJhX wF1i39Gr7BC75CROHpvMCrJLQuAEm8SiH/vBEiwCAhLfJh9iAemVEJCV2HQA6jZJiYMrbrBM YBRcwMiwilE0tSC5oDgpvchIrzgxt7g0L10vOT93EyMw3E7/e9a3g/HmAetDjAIcjEo8vBVf GUKFWBPLiitzDzGaAm2YyCwlmpwPDOq8knhDYzMjC1MTU2Mjc0szJXHeBKmfwUIC6Yklqdmp qQWpRfFFpTmpxYcYmTg4pRoYN6n/ZvSRr2bb/7VKZbXHHPai2UyLb7Lp+/grp4WcWiHX0Gxz Mqrl6OYOpc1al2XN18xMWn+yq7cqOmTNBOe2nLsfNm+azm1Wd+xuYL9GpK/TrNf1/48qf530 rvvMnVh399DlmouexOn2sHvveyPC7+v6bmLEpzvTVpbpFObLpdtVhK1ubuJRYinOSDTUYi4q TgQAnDl9jDICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsVy+t9jQd1t4oyhBnvnMFlc+fqezWLpjD5W i0n3J7A4MHvc7z7O5NG3ZRVjAFNUA6NNRmpiSmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWF uZJCXmJuqq2Si0+ArltmDtAWJYWyxJxSoFBAYnGxkr4dpgmhIW66FjCNEbq+IUFwPUYGaCBh DWPGyvu3mAuOW1SsX1PVwLhfv4uRk0NCwESi4doPRghbTOLCvfVsXYxcHEIC0xklfjWuZQdJ CAm0MUnsXa0JYrMJ6EksuPYDLC4ioCzxd+IqsGZmAV+Jg7OfsoLYwgJeEv0NS4BsDg4WAVWJ VdtMQcK8Au4S+45eZYfYJSdx8thk1gmM3AsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525i BAfzM6kdjCsbLA4xCnAwKvHwVnxlCBViTSwrrsw9xCjBwawkwuv3CyjEm5JYWZValB9fVJqT WnyI0RRo+URmKdHkfGCk5ZXEGxqbmBlZGpkbWhgZmyuJ8yrZt4UICaQnlqRmp6YWpBbB9DFx cEo1MBqYv7gUsLbK5eyMV5/2n3R/4W8g3CGtk/txVtcWwRsHqguY/nAu+LdgpmfP1I4KuytH paXmbzP15TPlPi+5/HttlOPik3PXWHQvF3G5v97wiESMi3VN/sXyyScOdrr8frfxuSaTzebV 7ZEp6p5Zrrtm1U9VUrl6pPp1iFh5UvpJGy3n3894o5RYijMSDbWYi4oTASrA/hd8AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: Hyungwon Hwang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Checking whether the iommu mapping allocated is not enough to determine whether iommu is supported properly or not. Even though there is mapping, the kernel is going to be panicked without the iommu being allocated. So this patch adds the additional condition to check whether iommu is really supported or not. [ 0.960859] [drm] Initialized drm 1.1.0 20060810 [ 1.016344] ------------[ cut here ]------------ [ 1.016453] kernel BUG at drivers/iommu/exynos-iommu.c:481! [ 1.020877] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [ 1.026693] Modules linked in: [ 1.029736] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.0.0-rc1-00089-gb7abcc2-dirty #13 [ 1.037802] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [ 1.043880] task: db0c0000 ti: db0a6000 task.ti: db0a6000 [ 1.049268] PC is at __exynos_sysmmu_enable+0x188/0x214 [ 1.054470] LR is at exynos_iommu_attach_device+0x44/0x118 [ 1.059940] pc : [] lr : [] psr: 60000193 [ 1.059940] sp : db0a7cd8 ip : 00000000 fp : 00000000 [ 1.071394] r10: a0000113 r9 : 00000000 r8 : db355f90 [ 1.076603] r7 : db25b210 r6 : db355640 r5 : 00000000 r4 : 00000000 [ 1.083113] r3 : 00000000 r2 : db355640 r1 : 5b244000 r0 : db25b210 [ 1.089624] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel [ 1.097001] Control: 10c5387d Table: 4000406a DAC: 00000015 [ 1.102729] Process swapper/0 (pid: 1, stack limit = 0xdb0a6210) [ 1.108719] Stack: (0xdb0a7cd8 to 0xdb0a8000) [ 1.113060] 7cc0: 00000000 db355f80 [ 1.121223] 7ce0: 00000000 db355640 db25b210 db355f90 00000000 a0000113 00000000 c02bf1a0 [ 1.129383] 7d00: a0000113 c0115974 00200200 5b244000 db25b210 db25b210 da822c10 db157800 [ 1.137542] 7d20: c0846540 00000000 c07ea3f4 c02bc8e8 db25b210 db278b40 da822c10 c001eb48 [ 1.145701] 7d40: da822e10 db25b210 da822c10 c02ef444 da822e10 00000001 00000001 c02f0af4 [ 1.153860] 7d60: da822e10 db2b0640 db2b25c0 db2b0640 00000000 c02f3850 db157800 00000000 [ 1.162019] 7d80: db157800 00000000 00000000 db278900 00000000 c02eb7d8 db157800 00000000 [ 1.170179] 7da0: 00000000 c08267b8 00000000 c02d4a44 c08e69f4 da822c00 db157800 c02d62c4 [ 1.178337] 7dc0: 00000000 c07ea3f4 00000000 c02faf6c db2b07e0 db2b07e0 00000002 db2b0640 [ 1.186497] 7de0: db2b07d0 c02f33f0 db2b0640 00000000 c0827130 c05a5230 da822c10 c02f34dc [ 1.194656] 7e00: c08268c8 da822c10 00000001 c08268c8 c0826774 c02eb97c da822c10 da8c0cd0 [ 1.202815] 7e20: 00000000 c08e6ab0 da822c10 c0826774 fffffdfb c02f9acc c08e6ab0 da822c10 [ 1.210974] 7e40: c08466d8 00000000 c0826774 c02f7ea4 db2b8f80 c02491a0 db2b7a80 da822c10 [ 1.219134] 7e60: c0826774 da822c44 c0827458 db2b7a80 0000007d c02f81cc 00000000 c0826774 [ 1.227293] 7e80: c02f8140 c02f61b0 db11205c db2b93b4 c0826774 db2b8f80 00000000 c02f7540 [ 1.235452] 7ea0: c070a3ac 00000000 c08e6a84 c0826774 00000000 c08e6a84 00000000 c02f8a48 [ 1.243611] 7ec0: 00000000 00000000 c08e6a84 c02eb6f0 00000000 c070a3ac ffffffff 00000000 [ 1.251770] 7ee0: 00000000 00000000 00000000 00000000 00000000 00000000 c08095a0 c08095a0 [ 1.259930] 7f00: c02eb628 c0008a3c c0584ad4 c078395c 0000007d dfeff9b0 00000000 dfeff9af [ 1.268089] 7f20: 00000000 db0a7f38 dfeffb46 dfeffb37 c0584ad4 c0040f40 0000395c 00000000 [ 1.276248] 7f40: c0716918 dfeffb57 00000006 00000006 c080d618 dfeff980 c07fee24 00000006 [ 1.284408] 7f60: c07ea3ec c0851c80 c0851c80 0000007d c07ea3f4 c07aee28 00000006 00000006 [ 1.292566] 7f80: c07ae5ac c0047e88 00001c80 c055553c 00000000 00000000 00000000 00000000 [ 1.300725] 7fa0: 00000000 c0555548 00000000 c000f390 00000000 00000000 00000000 00000000 [ 1.308884] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.317044] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffdf [ 1.325220] [] (__exynos_sysmmu_enable) from [] (exynos_iommu_attach_device+0x44/0x118) [ 1.334928] [] (exynos_iommu_attach_device) from [] (iommu_attach_device+0x1c/0xc8) [ 1.344305] [] (iommu_attach_device) from [] (arm_iommu_attach_device+0x18/0x50) [ 1.353420] [] (arm_iommu_attach_device) from [] (drm_iommu_attach_device+0x4c/0xcc) [ 1.362880] [] (drm_iommu_attach_device) from [] (fimd_bind+0x124/0x198) [ 1.371298] [] (fimd_bind) from [] (component_bind_all+0xc4/0x228) [ 1.379195] [] (component_bind_all) from [] (exynos_drm_load+0xa0/0x148) [ 1.387618] [] (exynos_drm_load) from [] (drm_dev_register+0xa8/0x104) [ 1.395864] [] (drm_dev_register) from [] (drm_platform_init+0x44/0xdc) [ 1.404195] [] (drm_platform_init) from [] (try_to_bring_up_master.part.2+0xc8/0x108) [ 1.413741] [] (try_to_bring_up_master.part.2) from [] (component_master_add_with_match+0xac/0x124) [ 1.424505] [] (component_master_add_with_match) from [] (exynos_drm_platform_probe+0xfc/0x128) [ 1.434925] [] (exynos_drm_platform_probe) from [] (platform_drv_probe+0x44/0xa4) [ 1.444124] [] (platform_drv_probe) from [] (driver_probe_device+0x13c/0x394) [ 1.452977] [] (driver_probe_device) from [] (__driver_attach+0x8c/0x90) [ 1.461395] [] (__driver_attach) from [] (bus_for_each_dev+0x68/0x9c) [ 1.469555] [] (bus_for_each_dev) from [] (bus_add_driver+0x160/0x21c) [ 1.477801] [] (bus_add_driver) from [] (driver_register+0x78/0xf8) [ 1.485786] [] (driver_register) from [] (exynos_drm_init+0xc8/0x110) [ 1.493946] [] (exynos_drm_init) from [] (do_one_initcall+0xb8/0x1f0) [ 1.502108] [] (do_one_initcall) from [] (kernel_init_freeable+0x1d4/0x278) [ 1.510787] [] (kernel_init_freeable) from [] (kernel_init+0xc/0xe8) [ 1.518859] [] (kernel_init) from [] (ret_from_fork+0x14/0x24) [ 1.526406] Code: e3130004 1a00001e e3a06000 eaffffcf (e7f001f2) [ 1.532505] ---[ end trace 03b1b443463b1342 ]--- [ 1.537077] Kernel panic - not syncing: Fatal exception Signed-off-by: Hyungwon Hwang Cc: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.h b/drivers/gpu/drm/exynos/exynos_drm_iommu.h index 35d2588..597bf70 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_iommu.h +++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.h @@ -32,7 +32,7 @@ static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) #ifdef CONFIG_ARM_DMA_USE_IOMMU struct device *dev = drm_dev->dev; - return dev->archdata.mapping ? true : false; + return dev->archdata.mapping && dev->archdata.iommu; #else return false; #endif