From: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-kernel@vger.kernel.org, maciej.sosnowski@intel.com,
dan.j.williams@intel.com
Subject: Re: dw_dmac driver questions
Date: Mon, 5 Jan 2009 16:48:47 +0100 [thread overview]
Message-ID: <20090105164847.6fbca375@hskinnemoen-d830> (raw)
In-Reply-To: <20090106.003558.115932572.anemo@mba.ocn.ne.jp>
Atsushi Nemoto wrote:
> On Mon, 5 Jan 2009 15:30:24 +0100, Haavard Skinnemoen <haavard.skinnemoen@atmel.com> wrote:
>
> > > 1. map/unmap DMA buffers for slave transfer
> > >
> > > For slave-DMA, it seems dmac driver is responsible for mapping DMA
> > > buffers, and client is responsible for unmapping them. Is it right?
> >
> > No, it's the other way around, unless DMA_COMPL_SKIP_*_UNMAP is set.
> > But I think the dw_dmac driver wrongly maps the buffers before queuing
> > them.
>
> Well, I'm confused... I reference atmel-mci for client and dw_dmac
> for dma engine. Currently, dw_dmac calls dma_map_sg() and atmel-mci
> calls dma_unmap_sg(). Do you mean atmel-mci will be changed to call
> dma_map_sg()?
Yes, I think it should.
Preferably, I'd like the client to do both mapping and unmapping in all
cases since it knows best what's actually needed. For example, some
drivers may be using DMA-coherent buffers, which don't need to be
mapped at all.
> > > 4. This is a comment on head of dwc_handle_error().
> > >
> > > /*
> > > * The descriptor currently at the head of the active list is
> > > * borked. Since we don't have any way to report errors, we'll
> > > * just have to scream loudly and try to carry on.
> > > */
> > >
> > > But, the bad descriptor can be at any place of the active list, no ?
> > > For example, if the active list contained two descriptor and latter
> > > was broken and tasklet was delayed by some reason, the head of the
> > > list should be good.
> >
> > Since dwc_scan_descriptors() was just called, all descriptors that were
> > completed successfully have been removed from the active list. So the
> > first entry must be the broken one.
>
> But the removal from the active list is done in tasklet too. If the
> CPU was slow and DMA engine was fast enough, DMA engine will process
> multiple descriptors before the tasklet called, no ?
The DMA engine stops if it encounters a bad address.
Haavard
next prev parent reply other threads:[~2009-01-05 15:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 14:39 Atsushi Nemoto
2009-01-05 14:02 ` Atsushi Nemoto
2009-01-09 14:06 ` Atsushi Nemoto
2009-01-05 14:30 ` Haavard Skinnemoen
2009-01-05 15:35 ` Atsushi Nemoto
2009-01-05 15:48 ` Haavard Skinnemoen [this message]
2009-01-06 1:33 ` Atsushi Nemoto
2009-01-06 10:14 ` Haavard Skinnemoen
2009-01-06 14:31 ` Atsushi Nemoto
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=20090105164847.6fbca375@hskinnemoen-d830 \
--to=haavard.skinnemoen@atmel.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.sosnowski@intel.com \
/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
all inboxes | Powered by JetHome®