From patchwork Tue Mar 27 13:42:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7487 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A917423E01 for ; Tue, 27 Mar 2012 14:19:53 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5D5FCA18AD1 for ; Tue, 27 Mar 2012 14:19:53 +0000 (UTC) Received: by ghbz12 with SMTP id z12so5711194ghb.11 for ; Tue, 27 Mar 2012 07:19:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :in-reply-to:to:message-id:mime-version:x-mailer:references :x-mailman-approved-at:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:content-type:content-transfer-encoding :sender:errors-to:x-gm-message-state; bh=8wQePpHEC0mq+d/xM4/Tsklrmd9/I8v1McuO2cCGABo=; b=Lwmog6WbwuYtlI+IyzY2XCyXQsOaXTWr8MtMOEN1YIc6Vkrlh0PBqv62Hu79GiO+54 3TQ+HsBezOWzZRyGQr5hODNo+XIm6V0uuQ9dTzqGKHAHgBoor3TT6Jvdp3q3JL9gjMD7 OLP+EQjMYa526A06SK7+EzkSEJdO9I9nnf7sqvq/L4ClN5avOmOTXodpYNcSfOFDa+MJ JtR38aU8mmfGYJ36mT8KfA/dcCJjl+feSbbCYry4+7lbtdclc22ryTbuYudv9XupvV64 I9zl+WzZzfsrxu0I0tx//IB87j/U3si+UHLlRSeK/qocUR62gYXaaJjpsX47Xc4xYwiv 1wjQ== Received: by 10.50.186.161 with SMTP id fl1mr8636327igc.44.1332857992491; Tue, 27 Mar 2012 07:19:52 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.5.205 with SMTP id 13csp18926ibw; Tue, 27 Mar 2012 07:19:51 -0700 (PDT) Received: by 10.180.81.135 with SMTP id a7mr28233629wiy.16.1332857986181; Tue, 27 Mar 2012 07:19:46 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id y8si19526842wiy.13.2012.03.27.07.19.44; Tue, 27 Mar 2012 07:19:46 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SCXFO-0006o4-5w; Tue, 27 Mar 2012 14:19:42 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SCWgH-000125-KD for linaro-mm-sig@lists.linaro.org; Tue, 27 Mar 2012 13:43:25 +0000 Received: from euspt2 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M1J00BN2Q3FJR@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 27 Mar 2012 14:42:51 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M1J00217Q471V@spt2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 27 Mar 2012 14:43:21 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 3280327004B; Tue, 27 Mar 2012 15:46:11 +0200 (CEST) Date: Tue, 27 Mar 2012 15:42:35 +0200 From: Marek Szyprowski In-reply-to: <1332855768-32583-1-git-send-email-m.szyprowski@samsung.com> To: linux-kernel@vger.kernel.org Message-id: <1332855768-32583-2-git-send-email-m.szyprowski@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.9.1 References: <1332855768-32583-1-git-send-email-m.szyprowski@samsung.com> X-Mailman-Approved-At: Tue, 27 Mar 2012 14:19:37 +0000 Cc: linux-mips@linux-mips.org, Kevin Cernekee , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Benjamin Herrenschmidt , linux-mm@kvack.org, sparclinux@vger.kernel.org, Guan Xuetao , linux-arch@vger.kernel.org, Stephen Rothwell , Jonathan Corbet , x86@kernel.org, Matt Turner , Dezhong Diao , Fenghua Yu , Arnd Bergmann , microblaze-uclinux@itee.uq.edu.au, linaro-mm-sig@lists.linaro.org, Ivan Kokshaysky , Andrzej Pietrasiewicz , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Richard Henderson , discuss@x86-64.org, Michal Simek , Tony Luck , Richard Kuo , FUJITA Tomonori , Kyungmin Park , Paul Mundt , linux-alpha@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Subject: [Linaro-mm-sig] [PATCHv2 01/14] common: dma-mapping: introduce alloc_attrs and free_attrs methods X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQkZCD2FBTRx86CxokIxMMSJj72fTzjnrOduAWmZHIRRnm1UjEeuKg0Icp6QdqGkC1PjktAN Introduce new generic alloc and free methods with attributes argument. Existing alloc_coherent and free_coherent can be implemented on top of the new calls with NULL attributes argument. Later also dma_alloc_non_coherent can be implemented using DMA_ATTR_NONCOHERENT attribute as well as dma_alloc_writecombine with separate DMA_ATTR_WRITECOMBINE attribute. This way the drivers will get more generic, platform independent way of allocating dma buffers with specific parameters. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Reviewed-by: David Gibson Reviewed-by: Arnd Bergmann --- include/linux/dma-mapping.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index e13117c..8cc7f95 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -13,6 +13,12 @@ struct dma_map_ops { dma_addr_t *dma_handle, gfp_t gfp); void (*free_coherent)(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); + void* (*alloc)(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t gfp, + struct dma_attrs *attrs); + void (*free)(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_handle, + struct dma_attrs *attrs); dma_addr_t (*map_page)(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir,