From: Takashi Iwai Subject: Re: Sudden ISA DMA problems Date: Mon, 18 Feb 2002 10:37:39 +0100 Message-ID: References: <20020216153742.84853.qmail@web13106.mail.yahoo.com> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Received: from Cantor.suse.de (ns.suse.de [213.95.15.193]) by alsa.alsa-project.org (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id KAA27123 for ; Mon, 18 Feb 2002 10:37:44 +0100 In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Jaroslav Kysela Cc: Chris Rankin , "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org At Sun, 17 Feb 2002 10:29:20 +0100 (CET), Jaroslav wrote: > > On Sat, 16 Feb 2002, [iso-8859-1] Chris Rankin wrote: > > > Hi, > > > > I saw from the CVS ChangeLog that ALSA is moving away > > from the deprecated virt_to_bus() to the new > > pci_allocate_consistent() system calls. Unfortunately, > > this is causing problems for my ISA DMA sound driver > > (CS4231 / MPU401 based). I have currently "fixed" > > things by #undef-ing the ISA_USE_PCI_ALLOC in > > core/pcm_memory.c. Once I do this, I get sound out of > > my speakers again. > > > > My soundcard also needs a DMA-able buffer so that it > > can upload its firmware. Previously, I used > > snd_malloc_pages(), and I tried changing this to > > snd_malloc_isa_pages(). However, you don't export this > > function, and even when I cut-and-pasted it into the > > source file, the firmware wouldn't upload until I used > > the virt_to_bus()-based compatibility version. > > > > It would probably be a good idea to export the > > following functions: > > > > snd_malloc_pci_pages() > > snd_malloc_isa_pages() > > snd_free_pci_pages() > > snd_free_isa_pages() > > > > Does anyone have any idea why > > pci_allocate_consistent() isn't working here, please? > > Using pci_allocate_consistent() for ISA DMA allocation routines is > definitely a bad idea. I added snd_malloc_isa_pages() code as you > suggested to snd.o (it seems that it's good to abstract such bus specific > allocation routines). I don't think it's so bad to use pci_allocate_consistent(). It gives the only generic way to get DMA buffer allocation over all architectures without virt_to_bus. If it doesn't work well, it should be a bug of this function.. Anyway, yes, it would be better to use a generic function until the kernel function is fixed. Thanks. BTW, use of GFP_KERNEL for a large DMA buffer is safe on 2.4 too? For PCI buffers, when a module tries to allocate large memory areas with GFP_KERNEL, it stays blocking (and waiting for the enough space) and even more badly it cannot be killed. Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-devel