From: Takashi Iwai Subject: Re: bad page when freeing preallocated pages Date: Thu, 27 Apr 2006 12:41:53 +0200 Message-ID: References: <444F2FA6.7010305@atmel.com> <4450622C.80802@norway.atmel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <4450622C.80802@norway.atmel.com> 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: Hans-Christian Egtvedt Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Thu, 27 Apr 2006 08:18:20 +0200, Hans-Christian Egtvedt wrote: > > Takashi Iwai wrote: > > At Wed, 26 Apr 2006 10:30:30 +0200, > > Hans-Christian Egtvedt wrote: > > > > >> Example: > >> [ 141.380000] Bad page state in process 'rmmod' > >> [17179650.992000] page:90200600 flags:0x00004000 mapping:00000000 > >> mapcount:0 count:0 > >> > >> Sorry if my email is lacking information, I'll gladly provide more > >> information. > > > > It's a new bug I haven't seen yet. > > > > Could you give more detail on your system - the architecture, the > > linux kernel version, and the ALSA version? > > ~ # uname -a > Linux (none) 2.6.16.11 #3 Wed Apr 26 11:21:06 CEST 2006 avr32 unknown > > ~ # cat /proc/asound/version > Advanced Linux Sound Architecture Driver Version 1.0.11rc2 (Wed Jan 04 > 08:57:20 2006 UTC). > > The architecture is the AVR32 processor family from Atmel running on the > ATSTK1000 development board. > > The interessting part is that if I preallocate a small area (4kB), then > the bad pages go away on rmmod. It could maybe be that we have some > undiscovered bug in dma_alloc_coherent() or dma_free_coherent(), but we > use there function calls in other drivers, so i doubt it (but keeping > the option open;) ). Ah, that enlighted me. According to your first post, snd_pcm_preallocate_pages*() is called like below: snd_pcm_lib_preallocate_pages_for_all(chip->pcm, SNDRV_DMA_TYPE_DEV, snd_dma_continuous_data(GFP_KERNEL), 64 * 1024, 64 * 1024); The third argument is wrong in this case. You have to pass struct device pointer there instead of snd_dma_continuous_data(). (Yeah, the function is messy and the clean-up is on my test tree for long time.) Takashi ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642