From patchwork Fri Jun 10 10:11:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9169259 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 B52EB604DB for ; Fri, 10 Jun 2016 10:13:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5B0F281FE for ; Fri, 10 Jun 2016 10:13:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A6F52833F; Fri, 10 Jun 2016 10:13:12 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50BCB28328 for ; Fri, 10 Jun 2016 10:13:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90F5A6ECE0; Fri, 10 Jun 2016 10:13:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF8706ECD6; Fri, 10 Jun 2016 10:12:53 +0000 (UTC) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8J009M7WDEFB70@mailout2.w1.samsung.com>; Fri, 10 Jun 2016 11:12:50 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-e5-575a92a29364 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 48.63.04866.2A29A575; Fri, 10 Jun 2016 11:12:50 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8J00MI3WC5KUB0@eusync4.samsung.com>; Fri, 10 Jun 2016 11:12:50 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v4 14/44] drm/nouveau: dma-mapping: Use unsigned long for dma_attrs Date: Fri, 10 Jun 2016 12:11:31 +0200 Message-id: <1465553521-27303-15-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1465553521-27303-1-git-send-email-k.kozlowski@samsung.com> References: <1465553521-27303-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKLMWRmVeSWpSXmKPExsVy+t/xa7qLJkWFGzTOVLf4/vAUq0XvuZNM FldvLWCymLN+DZvFxhnrWS1eLu9gtLjy9T2bxekJi5gsXr8wtLi8aw6bxfe+PlYHbo/NK7Q8 Tsz4zeKx/dsDVo/73ceZPHqb37F5vN93lc2jb8sqRo/Pm+QCOKK4bFJSczLLUov07RK4Mj6t O8xSsIq/Ysb2i2wNjFd4uhg5OSQETCSunWxnhbDFJC7cW88GYgsJLGWUuPyZq4uRC8huZJK4 N/syWIJNwFhi8/IlYLaIgK7Eque7mEGKmAXeM0k8ndYMlhAWCJV4e3AymM0ioCrxv+8SC4jN K+Ah8aNpKzPENjmJk8cmg23mBIp3353JArHZXWL7k1dMExh5FzAyrGIUTS1NLihOSs810itO zC0uzUvXS87P3cQICcyvOxiXHrM6xCjAwajEwxuxKzJciDWxrLgy9xCjBAezkgivRV9UuBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHembvehwgJpCeWpGanphakFsFkmTg4pRoYtd3ldMVqC1S2 T9z6x4l3K+v6DWwPY64IyzuZci/b37Ru6/oXd6w8ju2p6lfnfDpH8uBP1YCb2Vl1kjxv2B0D lu8XL3B5M/WzauLz3qw+iVl//Pqrfqmp1Ur2eUv0FE8z/3u56kjwkjk6L/f0lU/9cdhkWa26 8syJrGJM7oWXr3NN3iBRceCvEktxRqKhFnNRcSIAoVbbGEgCAAA= Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, Ben Skeggs , Dave Airlie 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-Virus-Scanned: ClamAV using ClamSMTP Split out subsystem specific changes for easier reviews. This will be squashed with main commit. Signed-off-by: Krzysztof Kozlowski --- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c index 6b8f2a19b2d9..a6a7fa0d7679 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c @@ -109,7 +109,7 @@ struct gk20a_instmem { u16 iommu_bit; /* Only used by DMA API */ - struct dma_attrs attrs; + unsigned long attrs; }; #define gk20a_instmem(p) container_of((p), struct gk20a_instmem, base) @@ -293,7 +293,7 @@ gk20a_instobj_dtor_dma(struct nvkm_memory *memory) goto out; dma_free_attrs(dev, node->base.mem.size << PAGE_SHIFT, node->base.vaddr, - node->handle, &imem->attrs); + node->handle, imem->attrs); out: return node; @@ -386,7 +386,7 @@ gk20a_instobj_ctor_dma(struct gk20a_instmem *imem, u32 npages, u32 align, node->base.vaddr = dma_alloc_attrs(dev, npages << PAGE_SHIFT, &node->handle, GFP_KERNEL, - &imem->attrs); + imem->attrs); if (!node->base.vaddr) { nvkm_error(subdev, "cannot allocate DMA memory\n"); return -ENOMEM; @@ -597,10 +597,9 @@ gk20a_instmem_new(struct nvkm_device *device, int index, nvkm_info(&imem->base.subdev, "using IOMMU\n"); } else { - init_dma_attrs(&imem->attrs); - dma_set_attr(DMA_ATTR_NON_CONSISTENT, &imem->attrs); - dma_set_attr(DMA_ATTR_WEAK_ORDERING, &imem->attrs); - dma_set_attr(DMA_ATTR_WRITE_COMBINE, &imem->attrs); + imem->attrs = DMA_ATTR_NON_CONSISTENT | + DMA_ATTR_WEAK_ORDERING | + DMA_ATTR_WRITE_COMBINE; nvkm_info(&imem->base.subdev, "using DMA API\n"); }