From patchwork Mon May 23 10:50:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9131449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1821660761 for ; Mon, 23 May 2016 10:51:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09B3F28221 for ; Mon, 23 May 2016 10:51:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2BC02822F; Mon, 23 May 2016 10:51:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BB4928231 for ; Mon, 23 May 2016 10:51:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbcEWKvA (ORCPT ); Mon, 23 May 2016 06:51:00 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:17128 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbcEWKu7 (ORCPT ); Mon, 23 May 2016 06:50:59 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O7M00F7WM4VNS60@mailout1.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Mon, 23 May 2016 11:50:55 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-18-5742e08fb73b Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id E4.72.05254.F80E2475; Mon, 23 May 2016 11:50:55 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O7M00JPJM4ORQ10@eusync1.samsung.com>; Mon, 23 May 2016 11:50:55 +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 2/5] drm/exynos: iommu: add a check if all sub-devices have iommu controller Date: Mon, 23 May 2016 12:50:41 +0200 Message-id: <1464000644-12227-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1464000644-12227-1-git-send-email-m.szyprowski@samsung.com> References: <1464000644-12227-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t/xy7r9D5zCDS6eVLa4te4cq8XGGetZ La58fc9mMen+BBaLF/cusli8fmFoMeP8PiaLtUfuslvMmPySzYHT4373cSaPvi2rGD0+b5IL YI7isklJzcksSy3St0vgypjwYRNzQRd7xaLpZg2Mv1m7GDk5JARMJBofzWGEsMUkLtxbz9bF yMUhJLCUUaJz+jt2CKeJSeLqwi4WkCo2AUOJrrddbCC2iICbRNPhmawgRcwCW5gk2ndtZAJJ CAvESexa85IdxGYRUJWYMXc22ApeAQ+JO/13mCDWyUn8f7kCzOYU8JR4PWce0FAOoG0eEr9e xExg5F3AyLCKUTS1NLmgOCk911CvODG3uDQvXS85P3cTIySkvuxgXHzM6hCjAAejEg/vBkan cCHWxLLiytxDjBIczEoivIb3gUK8KYmVValF+fFFpTmpxYcYpTlYlMR55+56HyIkkJ5Ykpqd mlqQWgSTZeLglGpgXOtW0Xnxzr7E9Zb/uJofL7iudi06y5blzNno5TWTcx2nTPqcsO5u6oli 0UO8Nkda5Va/CZaRXtgZ7BcuPt/3wrWF9/7x/JziWGlY+nC3wZHJE7h7H8zoDpNLMA2P8y4P mn9G2+OyzCIn49IPTddX80WZbncNfOgirPxS+Ytvj8mSs1UZWjsYlViKMxINtZiLihMBAIgL ISUCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index 1e82529..36dde96 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)