From patchwork Thu Feb 11 11:32:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 61729 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp132884lbl; Thu, 11 Feb 2016 03:32:20 -0800 (PST) X-Received: by 10.66.139.166 with SMTP id qz6mr66000227pab.148.1455190340260; Thu, 11 Feb 2016 03:32:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 86si12123042pfl.78.2016.02.11.03.32.20; Thu, 11 Feb 2016 03:32:20 -0800 (PST) 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 S1751240AbcBKLcT (ORCPT + 4 others); Thu, 11 Feb 2016 06:32:19 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:60802 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbcBKLcT (ORCPT ); Thu, 11 Feb 2016 06:32:19 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2D004V2S1SWO20@mailout3.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 11 Feb 2016 11:32:16 +0000 (GMT) X-AuditID: cbfec7f4-f79026d00000418a-f9-56bc7140f6bb Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 36.2D.16778.0417CB65; Thu, 11 Feb 2016 11:32:16 +0000 (GMT) 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 <0O2D00F1AS1NK280@eusync1.samsung.com>; Thu, 11 Feb 2016 11:32:16 +0000 (GMT) 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] drm/exynos: fix incorrect cpu address for dma_mmap_attrs() Date: Thu, 11 Feb 2016 12:32:07 +0100 Message-id: <1455190327-25648-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsVy+t/xy7oOhXvCDC485rO4te4cq8XGGetZ La58fc9mMen+BBaLF/cusli8fmFoMeP8PiaLtUfuslvMmPySzYHT4373cSaPvi2rGD0+b5IL YI7isklJzcksSy3St0vgyjh25hdbwV+eiu4fX5gbGBu5uxg5OSQETCRuPzrHBmGLSVy4tx7I 5uIQEljKKLHn7VtGCKeJSeL4kSWsIFVsAoYSXW+7wDpEBNwkmg7PZAUpYhbYwiTRvmsjE0hC WMBb4sfcpSwgNouAqsSNvfsYQWxeAQ+Jf+e6oNbJSfx/uYJpAiP3AkaGVYyiqaXJBcVJ6bmG esWJucWleel6yfm5mxghYfJlB+PiY1aHGAU4GJV4eAPqd4cJsSaWFVfmHmKU4GBWEuE1zNkT JsSbklhZlVqUH19UmpNafIhRmoNFSZx37q73IUIC6YklqdmpqQWpRTBZJg5OqQZGfcOlyU8t Plysvf5EPYFRS/JblxaXbFBm1CHVH9W+7Wz10Y/zXdbPyjnl9M/JYfrhZY+n6ASyTTwdpL99 5wKdX98np8Vtyblw8pHH5Bc3DI4wCsXLb5U8/PP7+owC3sDPO7b3njybJ+3leP1ndjvXC5Uj 8mu3yGrOjto207ttnkjukyT3b33/lFiKMxINtZiLihMBSxl7Gg8CAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org dma_mmap_attrs() should be called with cpu address returned by dma_alloc_attrs(). Existing code however passed pages array base as cpu address. This worked only by a pure luck on ARM architecture. This patch fixes this issue. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 1.9.2 -- 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_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index f6118ba..8baabd8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -50,7 +50,7 @@ static int exynos_drm_fb_mmap(struct fb_info *info, if (vm_size > exynos_gem->size) return -EINVAL; - ret = dma_mmap_attrs(helper->dev->dev, vma, exynos_gem->pages, + ret = dma_mmap_attrs(helper->dev->dev, vma, exynos_gem->cookie, exynos_gem->dma_addr, exynos_gem->size, &exynos_gem->dma_attrs); if (ret < 0) { diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 47d126a..26b5e4b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -335,7 +335,7 @@ static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, if (vm_size > exynos_gem->size) return -EINVAL; - ret = dma_mmap_attrs(drm_dev->dev, vma, exynos_gem->pages, + ret = dma_mmap_attrs(drm_dev->dev, vma, exynos_gem->cookie, exynos_gem->dma_addr, exynos_gem->size, &exynos_gem->dma_attrs); if (ret < 0) {