From patchwork Wed Jul 13 08:41:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9227093 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 D95F46075D for ; Wed, 13 Jul 2016 08:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA8E9272AA for ; Wed, 13 Jul 2016 08:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF26827813; Wed, 13 Jul 2016 08:42:17 +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 7F9E1272AA for ; Wed, 13 Jul 2016 08:42:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 517E66E6B5; Wed, 13 Jul 2016 08:42: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 54C8F6E6B5; Wed, 13 Jul 2016 08:42:09 +0000 (UTC) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OA8007BDW67VE30@mailout2.w1.samsung.com>; Wed, 13 Jul 2016 09:42:07 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-62-5785fedf2290 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id E0.A0.05254.FDEF5875; Wed, 13 Jul 2016 09:42:07 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OA800KINW5J0E10@eusync3.samsung.com>; Wed, 13 Jul 2016 09:42:07 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v6 15/46] drm/nouveau: dma-mapping: Use unsigned long for dma_attrs Date: Wed, 13 Jul 2016 10:41:06 +0200 Message-id: <1468399300-5399-15-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1468399300-5399-14-git-send-email-k.kozlowski@samsung.com> References: <1468399167-28083-1-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-1-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-2-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-3-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-4-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-5-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-6-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-7-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-8-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-9-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-10-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-11-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-12-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-13-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-14-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVy+t/xq7r3/7WGG1zebGTRe+4kk8Wc9WvY LDbOWM9q8XJ5B6PFla/v2SxOT1jEZPH6haHF5V1z2Cy+9/WxOnB6bF6h5XFixm8Wj+3fHrB6 3O8+zuTxft9VNo++LasYPT5vkgtgj+KySUnNySxLLdK3S+DKmDDhO1vBc/6KvddKGxg7ebsY OTkkBEwkFv/uZ4WwxSQu3FvP1sXIxSEksJRR4uzjNYwQTiOTxPldl5lBqtgEjCU2L1/CBmKL COhKrHq+CyzOLLCISeJ9bwyILSwQKvFowhMmEJtFQFVi7YFtQDUcHLwC7hIvZxlDLJOTOHls MthiTgEPietXv0ItXsQucWDLaqYJjLwLGBlWMYqmliYXFCel5xrqFSfmFpfmpesl5+duYoQE 3pcdjIuPWR1iFOBgVOLhZRRpDRdiTSwrrsw9xCjBwawkwvv0L1CINyWxsiq1KD++qDQntfgQ ozQHi5I479xd70OEBNITS1KzU1MLUotgskwcnFINjO3T1B40vUr5rizebpTAX9fxXS+8I01Y 6v46BclHW2fLTOTTvCi5eLNOiylLQMkqp7wOsxSDbco+LfrFm5Zvz8hImXOb4cqiMzPLxf7n vai8wSs9m106TG17dbPN9DkKJy48y45WzE7RFo+fJOOzbFo6M1tcfEdmqE2s6u/ZJd/eaT+V 0TFWYinOSDTUYi4qTgQAd52LyzgCAAA= 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 [for drm] Acked-by: Daniel Vetter --- 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"); }