From mboxrd@z Thu Jan 1 00:00:00 1970 From: KyongHo Cho Subject: Re: [PATCH 7/8] common: dma-mapping: change alloc/free_coherent method to more generic alloc/free_attrs Date: Mon, 20 Jun 2011 23:45:41 +0900 Message-ID: References: <1308556213-24970-1-git-send-email-m.szyprowski@samsung.com> <1308556213-24970-8-git-send-email-m.szyprowski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:36273 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755007Ab1FTOpl convert rfc822-to-8bit (ORCPT ); Mon, 20 Jun 2011 10:45:41 -0400 Received: by gyh3 with SMTP id 3so1414992gyh.19 for ; Mon, 20 Jun 2011 07:45:41 -0700 (PDT) In-Reply-To: <1308556213-24970-8-git-send-email-m.szyprowski@samsung.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Marek Szyprowski Cc: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Kyungmin Park , Arnd Bergmann , Joerg Roedel , Russell King - ARM Linux Hi. On Mon, Jun 20, 2011 at 4:50 PM, Marek Szyprowski wrote: > =A0struct dma_map_ops { > - =A0 =A0 =A0 void* (*alloc_coherent)(struct device *dev, size_t size= , > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dma_add= r_t *dma_handle, gfp_t gfp); > - =A0 =A0 =A0 void (*free_coherent)(struct device *dev, size_t size, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *vaddr= , dma_addr_t dma_handle); > + =A0 =A0 =A0 void* (*alloc)(struct device *dev, size_t size, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dma_add= r_t *dma_handle, gfp_t gfp, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct = dma_attrs *attrs); > + =A0 =A0 =A0 void (*free)(struct device *dev, size_t size, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *vaddr= , dma_addr_t dma_handle, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct dma_= attrs *attrs); > + =A0 =A0 =A0 int (*mmap)(struct device *, struct vm_area_struct *, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *, dma_addr_t,= size_t, struct dma_attrs *attrs); > + > =A0 =A0 =A0 =A0dma_addr_t (*map_page)(struct device *dev, struct page= *page, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned = long offset, size_t size, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 enum dma_= data_direction dir, I still don't agree with your idea that change alloc_coherent() with al= loc(). As I said before, we actually do not need dma_alloc_writecombine() anym= ore because it is not different from dma_alloc_coherent() in ARM. Most of other architectures do not have dma_alloc_writecombine(). If you want dma_alloc_coherent() to allocate user virtual address, I believe that it is also available with mmap() you introduced. Regards, Cho KyongHo. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with ESMTP id 9D53D9000BD for ; Mon, 20 Jun 2011 10:45:43 -0400 (EDT) Received: by gxk23 with SMTP id 23so593998gxk.14 for ; Mon, 20 Jun 2011 07:45:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1308556213-24970-8-git-send-email-m.szyprowski@samsung.com> References: <1308556213-24970-1-git-send-email-m.szyprowski@samsung.com> <1308556213-24970-8-git-send-email-m.szyprowski@samsung.com> Date: Mon, 20 Jun 2011 23:45:41 +0900 Message-ID: Subject: Re: [PATCH 7/8] common: dma-mapping: change alloc/free_coherent method to more generic alloc/free_attrs From: KyongHo Cho Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Marek Szyprowski Cc: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Kyungmin Park , Arnd Bergmann , Joerg Roedel , Russell King - ARM Linux Hi. On Mon, Jun 20, 2011 at 4:50 PM, Marek Szyprowski wrote: > =A0struct dma_map_ops { > - =A0 =A0 =A0 void* (*alloc_coherent)(struct device *dev, size_t size, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dma_addr_t = *dma_handle, gfp_t gfp); > - =A0 =A0 =A0 void (*free_coherent)(struct device *dev, size_t size, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *vaddr, dm= a_addr_t dma_handle); > + =A0 =A0 =A0 void* (*alloc)(struct device *dev, size_t size, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dma_addr_t = *dma_handle, gfp_t gfp, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct dma_= attrs *attrs); > + =A0 =A0 =A0 void (*free)(struct device *dev, size_t size, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *vaddr, dm= a_addr_t dma_handle, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct dma_attr= s *attrs); > + =A0 =A0 =A0 int (*mmap)(struct device *, struct vm_area_struct *, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *, dma_addr_t, siz= e_t, struct dma_attrs *attrs); > + > =A0 =A0 =A0 =A0dma_addr_t (*map_page)(struct device *dev, struct page *pa= ge, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long= offset, size_t size, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 enum dma_data= _direction dir, I still don't agree with your idea that change alloc_coherent() with alloc(= ). As I said before, we actually do not need dma_alloc_writecombine() anymore because it is not different from dma_alloc_coherent() in ARM. Most of other architectures do not have dma_alloc_writecombine(). If you want dma_alloc_coherent() to allocate user virtual address, I believe that it is also available with mmap() you introduced. Regards, Cho KyongHo. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: pullip.cho@samsung.com (KyongHo Cho) Date: Mon, 20 Jun 2011 23:45:41 +0900 Subject: [PATCH 7/8] common: dma-mapping: change alloc/free_coherent method to more generic alloc/free_attrs In-Reply-To: <1308556213-24970-8-git-send-email-m.szyprowski@samsung.com> References: <1308556213-24970-1-git-send-email-m.szyprowski@samsung.com> <1308556213-24970-8-git-send-email-m.szyprowski@samsung.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi. On Mon, Jun 20, 2011 at 4:50 PM, Marek Szyprowski wrote: > ?struct dma_map_ops { > - ? ? ? void* (*alloc_coherent)(struct device *dev, size_t size, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 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); > + ? ? ? int (*mmap)(struct device *, struct vm_area_struct *, > + ? ? ? ? ? ? ? ? ? ? ? ? void *, dma_addr_t, size_t, 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, I still don't agree with your idea that change alloc_coherent() with alloc(). As I said before, we actually do not need dma_alloc_writecombine() anymore because it is not different from dma_alloc_coherent() in ARM. Most of other architectures do not have dma_alloc_writecombine(). If you want dma_alloc_coherent() to allocate user virtual address, I believe that it is also available with mmap() you introduced. Regards, Cho KyongHo.