Return-Path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx2.suse.de", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTP id 6B7C167B35 for ; Wed, 7 Jun 2006 22:58:39 +1000 (EST) Date: Wed, 07 Jun 2006 14:58:34 +0200 Message-ID: From: Takashi Iwai To: Johannes Berg Subject: Re: [Alsa-devel] [RFC 4/8] snd-aoa: add i2sbus In-Reply-To: <1149684747.3999.24.camel@johannes> References: <20060601115844.343214000@sipsolutions.net> <20060601115847.420788000@sipsolutions.net> <1149592647.5928.49.camel@johannes.berg> <1149680421.3999.4.camel@johannes> <1149684301.3999.21.camel@johannes> <1149684747.3999.24.camel@johannes> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: linuxppc-dev@ozlabs.org, alsa-devel@alsa-project.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , At Wed, 07 Jun 2006 14:52:25 +0200, Johannes Berg wrote: > > On Wed, 2006-06-07 at 14:49 +0200, Takashi Iwai wrote: > > > Sorry, s/pci_to_dev/snd_dma_pci_data/ > > So then you're saying that indeed, snd_pcm_lib_preallocate_pages_for_all > has the side effect of setting a pointer somewhere else? Well, I don't understand what you mean "side-effect" here. The device pointer is passed to the memory allocator, so if you pass a bogus value there, it'll cause surely oops. > I just don't understand why it all blows up when I leave off the > preallocate call. From the function name that says 'preallocate pages' > it seemed to me that I should be allowed to just leave it off, risking > that later an open() or prepare() fails because no pages could be > allocated. IIF you use snd_pcm_lib_malloc_pages(), the pre-allocation is mandatory. That's the definition. (And, as mentioned, snd_pcm_lib_malloc_pages() checks the pre-allocation when debug option is set. If you don't set the debug option, it assumes that the pre-allocation was already executed.) You're free to use dma_alloc_coherent() or whatever in hw_params callback. Takashi