From patchwork Thu Jun 30 08:25:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9206875 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 4688460752 for ; Thu, 30 Jun 2016 08:27:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38142285B7 for ; Thu, 30 Jun 2016 08:27:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CD3C2865A; Thu, 30 Jun 2016 08:27:20 +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 E288E285B7 for ; Thu, 30 Jun 2016 08:27:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0178F6E839; Thu, 30 Jun 2016 08:27:11 +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 369C96E832; Thu, 30 Jun 2016 08:27:09 +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 <0O9K000IFST6LX80@mailout2.w1.samsung.com>; Thu, 30 Jun 2016 09:27:06 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-56-5774d7da3b59 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 8A.F3.04866.AD7D4775; Thu, 30 Jun 2016 09:27:06 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9K00F5WSS0I050@eusync2.samsung.com>; Thu, 30 Jun 2016 09:27:06 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v5 14/44] drm/nouveau: dma-mapping: Use unsigned long for dma_attrs Date: Thu, 30 Jun 2016 10:25:41 +0200 Message-id: <1467275171-6298-14-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1467275171-6298-1-git-send-email-k.kozlowski@samsung.com> References: <1467275019-30789-1-git-send-email-k.kozlowski@samsung.com> <1467275171-6298-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCLMWRmVeSWpSXmKPExsVy+t/xK7q3rpeEGzy6KGHRe+4kk8Wc9WvY LDbOWM9q8XJ5B6PFla/v2SxOT1jEZPH6haHF5V1z2Cy+9/WxOnB6bF6h5XFixm8Wj+3fHrB6 3O8+zuTxft9VNo++LasYPT5vkgtgj+KySUnNySxLLdK3S+DK+LTuMEvBKv6KGdsvsjUwXuHp YuTgkBAwkVh9SrSLkRPIFJO4cG89WxcjF4eQwFJGiZbpTUwQTiOTxOFd9xlBqtgEjCU2L1/C BmKLCOhKrHq+ixnEZhZYxCTxvjcGxBYWCJVYsX49WJxFQFXi0MZHbCDLeAXcJTYvEodYJidx 8thkVpAwJ1B49nd/iFUtjBLH9k1insDIu4CRYRWjaGppckFxUnqukV5xYm5xaV66XnJ+7iZG SNh93cG49JjVIUYBDkYlHl4H5pJwIdbEsuLK3EOMEhzMSiK8268AhXhTEiurUovy44tKc1KL DzFKc7AoifPO3PU+REggPbEkNTs1tSC1CCbLxMEp1cAoKODOzPIg99zRVVcqtwUa1jZLt7rr J0jde736nsOSv1UqE+rUD7zIWFms8ME27/HL9i62zMPTXpqqnVF9+pjnjrP3D/8IC+mdulud nDtLdfdZ83NekOSPnyeWNb3voHXl5RThxSFV2/j3vvhjyC4aXlz1RfPFYtFNjH32N7+f8rdM uTolsE+JpTgj0VCLuag4EQCffrY8NwIAAA== Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, Ben Skeggs 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"); }