All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans-Christian Egtvedt <hcegtvedt@norway.atmel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: bad page when freeing preallocated pages
Date: Thu, 27 Apr 2006 13:02:07 +0200	[thread overview]
Message-ID: <4450A4AF.1000501@norway.atmel.com> (raw)
In-Reply-To: <s5hr73jxpu6.wl%tiwai@suse.de>

Takashi Iwai wrote:
> 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:

<snip>

>> 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().

I tried that, but the result is the same. I have stored the platform
device in chip->pdev and passed this to preallocation of pages:

snd_pcm_lib_preallocate_pages_for_all(chip->pcm, SNDRV_DMA_TYPE_DEV,
			&chip->pdev->dev, 64 * 1024, 64 * 1024);

I've looked into the library and it all seems to be correct in the
deeper layers.

Thank you for you feedback. Any tips or hints to where start debugging
would be greatly appreciated.

> (Yeah, the function is messy and the clean-up is on my test tree for
> long time.)

:)

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

  reply	other threads:[~2006-04-27 11:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2006-04-27 11:10         ` Takashi Iwai
2006-04-28 12:42           ` Hans-Christian Egtvedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4450A4AF.1000501@norway.atmel.com \
    --to=hcegtvedt@norway.atmel.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.