From patchwork Fri Jun 17 07:54:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 70288 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp153621qgy; Fri, 17 Jun 2016 00:54:59 -0700 (PDT) X-Received: by 10.66.27.136 with SMTP id t8mr1026439pag.108.1466150086167; Fri, 17 Jun 2016 00:54:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id un5si42494297pab.174.2016.06.17.00.54.45; Fri, 17 Jun 2016 00:54:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755044AbcFQHyp (ORCPT + 4 others); Fri, 17 Jun 2016 03:54:45 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:59119 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755253AbcFQHyo (ORCPT ); Fri, 17 Jun 2016 03:54:44 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8W00KHVON5H900@mailout4.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 17 Jun 2016 08:54:41 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-3b-5763acc04e2f Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 27.FF.05254.0CCA3675; Fri, 17 Jun 2016 08:54:40 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8W00AVTOMWCT10@eusync1.samsung.com>; Fri, 17 Jun 2016 08:54:40 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 2/5] drm/exynos: iommu: add a check if all sub-devices have iommu controller Date: Fri, 17 Jun 2016 09:54:24 +0200 Message-id: <1466150067-8065-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1466150067-8065-1-git-send-email-m.szyprowski@samsung.com> References: <1466150067-8065-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMLMWRmVeSWpSXmKPExsVy+t/xy7oH1iSHG8yaqG9xa905VouNM9az Wlz5+p7NYtL9CSwWL+5dZLF4/cLQYsb5fUwWa4/cZbeYMfklmwOnx/3u40wefVtWMXp83iQX wBzFZZOSmpNZllqkb5fAlfHx3CrWginsFctXPWZuYGxl62Lk5JAQMJHo//iIFcIWk7hwbz1Q nItDSGApo8TJG+dZIJwmJon/l5Ywg1SxCRhKdL3tAusWEXCTaDo8kxWkiFlgC5NE+66NTF2M HBzCAokSR1abg9SwCKhKnPy1AmwDr4C7xP53kxkhtslJnDw2GSzOKeAh8XB/D1hcCKhm7vml LBMYeRcwMqxiFE0tTS4oTkrPNdQrTswtLs1L10vOz93ECAmqLzsYFx+zOsQowMGoxMO7QjQ5 XIg1say4MvcQowQHs5IIL+MqoBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeubvehwgJpCeWpGan phakFsFkmTg4pRoY7fbs2G4V9yo4YV+cf+Kr73MZP19dfDSS285l9g836yvsrWXhr91mn2Vm idUo2brjg6DrogdeK//dslvN6dgRK2QnnG01S+zEouMKB966Pz4X0CEpEZRnNm133fwdMyNS I4JF2w99q/2+IHfD9WM/T0h9eMQ+9cDC6+e5755K6j+cZnj9ZMWxh0osxRmJhlrMRcWJALZR ca0mAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds a check if all devices belonging to Exynos DRM have the same dma_map_ops set. This is required to enable operation with IOMMU enabled. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_iommu.c | 5 +++++ 1 file changed, 5 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index 1e82529e0c41..36dde9691274 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c +++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c @@ -97,6 +97,11 @@ int drm_iommu_attach_device(struct drm_device *drm_dev, if (!priv->mapping) return 0; + if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) { + DRM_ERROR("Device %s lacks support for IOMMU\n", + dev_name(subdrv_dev)); + return -EINVAL; + } ret = configure_dma_max_seg_size(subdrv_dev); if (ret)