Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757835Ab3DZFlg (ORCPT ); Fri, 26 Apr 2013 01:41:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34892 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752769Ab3DZFlf (ORCPT ); Fri, 26 Apr 2013 01:41:35 -0400 Date: Fri, 26 Apr 2013 07:41:33 +0200 Message-ID: From: Takashi Iwai To: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jaroslav Kysela , alsa-devel@alsa-project.org Subject: Re: [PATCH 07/21] oss/dmabuf: use dma_map_single In-Reply-To: <1366910944-3033663-8-git-send-email-arnd@arndb.de> References: <1366910944-3033663-1-git-send-email-arnd@arndb.de> <1366910944-3033663-8-git-send-email-arnd@arndb.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2120 Lines: 61 At Thu, 25 Apr 2013 19:28:50 +0200, Arnd Bergmann wrote: > > The virt_to_bus/bus_to_virt functions have been deprecated > for as long as I can remember, and they are used in very > few remaining instances, usually in obscure ISA device > drivers. The OSS sound drivers are the only ones that are > still used on the ARM architecture, and only on some of > the earliest StrongARM machines. > > The problem for converting the OSS subsystem to use > dma_map_single instead is that the caller of virt_to_bus > does not have a device pointer, since the subsystem has > never been ported to use the common device infrastructure. > > Signed-off-by: Arnd Bergmann > Cc: Jaroslav Kysela > Cc: Takashi Iwai > Cc: alsa-devel@alsa-project.org Applied now, but the only problem is that it's difficult to test it :) Let's see. Thanks! Takashi > --- > sound/oss/dmabuf.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c > index bcc3e8e..a59c888 100644 > --- a/sound/oss/dmabuf.c > +++ b/sound/oss/dmabuf.c > @@ -114,7 +114,7 @@ static int sound_alloc_dmap(struct dma_buffparms *dmap) > } > } > dmap->raw_buf = start_addr; > - dmap->raw_buf_phys = virt_to_bus(start_addr); > + dmap->raw_buf_phys = dma_map_single(NULL, start_addr, dmap->buffsize, DMA_BIDIRECTIONAL); > > for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++) > SetPageReserved(page); > @@ -139,6 +139,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap) > for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++) > ClearPageReserved(page); > > + dma_unmap_single(NULL, dmap->raw_buf_phys, dmap->buffsize, DMA_BIDIRECTIONAL); > free_pages((unsigned long) dmap->raw_buf, sz); > dmap->raw_buf = NULL; > } > -- > 1.8.1.2 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/