From: Takashi Iwai Subject: Re: trouble on ppc32? Date: Fri, 24 Feb 2006 19:52:04 +0100 Message-ID: References: <20060220231240.GB6186@celes> <20060222170201.GA2262@celes> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20060222170201.GA2262@celes> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Falko Schmidt Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 22 Feb 2006 18:02:01 +0100, Falko Schmidt wrote: > > On Tue, Feb 21, 2006 at 04:17:48PM +0100, Takashi Iwai wrote: > > > ------------- > > > Soundblaster Live 512 (PCI): > > > ------------- > > > > > > Feb 20 21:54:43 cyan kernel: PCI: Enabling device 0000:01:03.0 (0104 -> 0105) > > > Feb 20 21:54:43 cyan kernel: max memory size is 0x7fffffff (addr = 0x8ba3f000)!! > > > Feb 20 21:54:59 cyan kernel: max memory size is 0x7fffffff (addr = 0x8ba21000)!! > > > Feb 20 21:54:59 cyan kernel: emu: failure page = 0 > > > Feb 20 21:54:59 cyan kernel: max memory size is 0x7fffffff (addr = 0x8ba21000)!! > > > Feb 20 21:54:59 cyan kernel: emu: failure page = 0 > > > Feb 20 21:55:13 cyan kernel: max memory size is 0x7fffffff (addr = 0x8ba21000)!! > > > Feb 20 21:55:13 cyan kernel: emu: failure page = 0 > > > Feb 20 21:55:13 cyan kernel: max memory size is 0x7fffffff (addr = 0x8ba21000)!! > > > Feb 20 21:55:13 cyan kernel: emu: failure page = 0 > > > Feb 20 21:55:13 cyan kernel: max memory size is 0x7fffffff (addr = 0x8baa1000)!! > > > Feb 20 21:55:13 cyan kernel: emu: failure page = 0 > > > Feb 20 21:55:13 cyan kernel: max memory size is 0x7fffffff (addr = 0x8baa1000)!! > > > Feb 20 21:55:13 cyan kernel: emu: failure page = 0 > > > > It's not the fault of driver but because of ppc's dma_alloc_coherent(). > > It doesn't allocate memories in the given coherent_dma_mask. > > That sounds interesting. Thanks for pointing it out. Does the patch below have any influence? It's a blind-shot, though... Takashi diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 946f321..b77caa7 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -546,6 +546,7 @@ void *iommu_alloc_coherent(struct iommu_ return NULL; /* Alloc enough pages (and possibly more) */ + again: ret = (void *)__get_free_pages(flag, order); if (!ret) return NULL; @@ -556,6 +557,15 @@ void *iommu_alloc_coherent(struct iommu_ if (mapping == DMA_ERROR_CODE) { free_pages((unsigned long)ret, order); ret = NULL; + } else if (dev->coherent_dma_mask && + mapping >= dev->coherent_dma_mask) { + iommu_free(tbl, mapping, npages); + free_pages((unsigned long)ret, order); + if (! (flag & __GFP_DMA)) { + flag |= __GFP_DMA; + goto again; + } + ret = NULL; } else *dma_handle = mapping; return ret; ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642