From: Adrian McMenamin <adrian@mcmen.demon.co.uk>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Alsa-devel <alsa-devel@lists.sourceforge.net>,
linux-sh <linuxsh-dev@lists.sourceforge.net>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Alsa-devel] Re: [linuxsh-dev] [PATCH] ALSA driver for Yamaa AICA on Sega Dreamcast
Date: Mon, 17 Apr 2006 10:44:56 +0100 [thread overview]
Message-ID: <1145267096.9238.6.camel@localhost.localdomain> (raw)
In-Reply-To: <20060417012913.GA16821@linux-sh.org>
On Mon, 2006-04-17 at 04:29 +0300, Paul Mundt wrote:
> A few quick comments.. though looking at the earlier thread, most of
> these were already pointed out..
>
>
> You can't be serious, you're trying to setup, transfer, and wait for
> completion for a DMA transfer while holding a spinlock? The fact this
> hasn't blown up on you is sheer luck. Use dma_wait_for_completion(), it
> does the right thing.
>
> Additionaly you need a timeout here if you were for some reason intent on
> doing this while working against the DMA subsystem, if your DMA gets
> stuck this will blow up.
>
As I wrote last week dma_wait_for_completion won't hack G2 DMA:
147 void dma_wait_for_completion(unsigned int chan)
148 {
149 struct dma_info *info = get_dma_info(chan);
150 struct dma_channel *channel = &info->channels[chan];
151
152 if (channel->flags & DMA_TEI_CAPABLE) {
153 wait_event(channel->wait_queue,
154 (info->ops->get_residue(channel) == 0));
155 return;
156 }
157
158 while (info->ops->get_residue(channel))
159 cpu_relax();
160 }
get_residue never returns 0 for G2 DMA. When the dma is complete get_residue returns the size of the total transfer. Therefore I've no choice but to write my own handler (spinlocks question aside).
next prev parent reply other threads:[~2006-04-17 9:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1145232784.12804.2.camel@localhost.localdomain>
2006-04-17 1:29 ` [linuxsh-dev] [PATCH] ALSA driver for Yamaa AICA on Sega Dreamcast Paul Mundt
2006-04-17 9:44 ` Adrian McMenamin [this message]
2006-04-17 20:00 ` Adrian McMenamin
2006-04-17 21:47 ` [Alsa-devel] " Lee Revell
2006-04-17 22:05 ` Christoph Hellwig
2006-04-17 22:15 ` Lee Revell
2006-04-18 10:17 ` Takashi Iwai
2006-04-18 11:52 ` Christoph Hellwig
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=1145267096.9238.6.camel@localhost.localdomain \
--to=adrian@mcmen.demon.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxsh-dev@lists.sourceforge.net \
/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