All of lore.kernel.org
 help / color / mirror / Atom feed
* bad page when freeing preallocated pages
@ 2006-04-26  8:30 Hans-Christian Egtvedt
  2006-04-26 15:57 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Hans-Christian Egtvedt @ 2006-04-26  8:30 UTC (permalink / raw)
  To: alsa-devel

Hello

I'm currently developing an alsa driver for an audio DAC used on an
embedded platform. I have come upon an issue when I try to free my
preallocated pages.

Some code snips from the driver I assume is most relevant:

static void snd_at73c213_pcm_free(snd_pcm_t *pcm)
{
	struct snd_at73c213 *chip = snd_pcm_chip(pcm);
	if (chip->pcm != 0 ) {
		snd_pcm_lib_preallocate_free_for_all(chip->pcm);
		chip->pcm = NULL;
	}
}

static int __devinit snd_at73c213_new_pcm(struct snd_at73c213 *chip, int
device)
{
	snd_pcm_t *pcm;
	int retval;

	retval = snd_pcm_new(chip->card, "AT73C213 on STK1000", device, 1, 0,
&pcm);
	if (retval < 0)
		return retval;

	pcm->private_data = chip;
	pcm->private_free = snd_at73c213_pcm_free;
	pcm->info_flags = SNDRV_PCM_INFO_BLOCK_TRANSFER;
	strcpy(pcm->name, "AT73C213 on STK1000");
	chip->pcm = pcm;

	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &at73c213_playback_ops);

	snd_pcm_lib_preallocate_pages_for_all(chip->pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_continuous_data(GFP_KERNEL), 64 * 1024, 64 * 1024);

	return 0;
}

When removing the module from the kernel with rmmod I get alot of bad
pages, because the page is mapped when it's freed. The weird thing is
that the pages are mapped to address 0x00000000.

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.

-- 
With kind regards,
Med vennlig hilsen,

Hans-Christian Egtvedt
Applications Engineer - AVR Applications Lab
Atmel Norway


-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-04-28 12:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-26  8:30 bad page when freeing preallocated pages Hans-Christian Egtvedt
2006-04-26 15:57 ` Takashi Iwai
2006-04-27  6:18   ` Hans-Christian Egtvedt
2006-04-27 10:41     ` Takashi Iwai
2006-04-27 11:02       ` Hans-Christian Egtvedt
2006-04-27 11:10         ` Takashi Iwai
2006-04-28 12:42           ` Hans-Christian Egtvedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.