From: Jaroslav Kysela <perex@suse.cz>
To: Arjan van de Ven <arjanv@fenrus.demon.nl>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ALSA update [6/10] - 2002/07/20
Date: Sun, 29 Sep 2002 21:28:48 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.33.0209292120171.591-100000@pnote.perex-int.cz> (raw)
In-Reply-To: <1033326744.2419.9.camel@localhost.localdomain>
On 29 Sep 2002, Arjan van de Ven wrote:
> On Sun, 2002-09-29 at 20:51, Jaroslav Kysela wrote:
> > + sgbuf = snd_magic_cast(snd_pcm_sgbuf_t, substream->dma_private, return -EINVAL);
>
> hummmm magic casts?? why ?
We are trying to check if 'void *' pointers in structures are used
correctly. It's our tool for debugging.
> > + ptr = snd_malloc_pci_pages(sgbuf->pci, PAGE_SIZE, &addr);
>
> what is wrong with the PCI DMA API that makes ALSA wants a private
> interface/implementation ?
These lines (i386 arch):
if (hwdev == NULL || ((u32)hwdev->dma_mask != 0xffffffff))
gfp |= GFP_DMA;
ret = (void *)__get_free_pages(gfp, get_order(size));
Note that some of soundcards have various PCI DMA transfer limits
(dma_mask is not set to use full 32-bits). In this case, restricting this
hardware to allocate these buffers in first 16MB is not a very good idea.
Thus, we have own hacks to allocate memory in whole hardware area.
> > EXPORT_SYMBOL(snd_wrapper_kmalloc);
> > EXPORT_SYMBOL(snd_wrapper_kfree);
> > +EXPORT_SYMBOL(snd_wrapper_vmalloc);
> > +EXPORT_SYMBOL(snd_wrapper_vfree);
>
> why do you need a wrapper for vfree?
Debugging. We enumerate all allocations, so we can check for memory leaks.
I'm happy to say, that our code is very well debugged in this regard.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com
next prev parent reply other threads:[~2002-09-29 19:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-29 18:51 [PATCH] ALSA update [6/10] - 2002/07/20 Jaroslav Kysela
2002-09-29 19:12 ` Arjan van de Ven
2002-09-29 19:28 ` Jaroslav Kysela [this message]
2002-09-29 19:52 ` Jeff Garzik
2002-09-29 20:34 ` Jaroslav Kysela
2002-09-29 21:19 ` Alan Cox
2002-09-30 0:53 ` David S. Miller
2002-09-30 12:54 ` Alan Cox
2002-09-30 16:17 ` Jaroslav Kysela
2002-09-30 20:33 ` David S. Miller
2002-09-30 0:22 ` David S. Miller
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=Pine.LNX.4.33.0209292120171.591-100000@pnote.perex-int.cz \
--to=perex@suse.cz \
--cc=arjanv@fenrus.demon.nl \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).