From: "Dan Williams" <dan.j.williams@intel.com>
To: "Olof Johansson" <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org, pasemi-linux@ozlabs.org,
shannon.nelson@intel.com, linux-kernel@vger.kernel.org,
hskinnemoen@atmel.com
Subject: Re: [PATCH v2] pasemi_dma: Driver for PA Semi PWRficient on-chip DMA engine
Date: Mon, 17 Mar 2008 11:46:39 -0700 [thread overview]
Message-ID: <e9c3a7c20803171146m5a7f0e11m31e074634de22b42@mail.gmail.com> (raw)
In-Reply-To: <20080316213002.GA2589@lixom.net>
On Sun, Mar 16, 2008 at 2:30 PM, Olof Johansson <olof@lixom.net> wrote:
> pasemi_dma: Driver for PA Semi PWRficient on-chip DMA engine
>
> DMA copy offload driver for PA Semi PWRficient. It uses the
>
> platform-specific functions to allocate channels, etc.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
>
> ---
>
> Changes since last post:
>
> * Add DMA_INTERRUPT support and handling of the interrupt flag
> * Fix interrupt handler for above and add tasklet
> * Switch to spin_lock_bh() where possible
> * Remove empty dependency_added() function since it's no longer
> used in the framework.
> * Fix bug in "ring full" estimation.
>
Hi Olof,
Looks good, makes me want to go back and cleanup iop-adma a bit. A
few fyi's below, but no other review comments.
> Note that this still needs to go on top of the powerpc.git tree due to the
> pasemi_dma.h updates that this driver depends on. I suggest merging this
> through pasemi.git->powerpc.git->linus with an Acked-by from the DMA guys.
Ok, it still may not compile in mainline until after 2.6.26-rc1 due to
additional dmaengine cleanups like the ack-to-flags change I posted
earlier. Any better way to handle this? Go through -mm?
>
> -Olof
>
Acked-by: Dan Williams <dan.j.williams@intel.com>
> --- /dev/null
> +++ b/drivers/dma/pasemi_dma.c
[..]
> +static void pasemi_dma_clean(struct pasemi_dma_chan *chan)
> +{
> + int old, new, i;
>
> + struct pasemi_dma_desc *desc;
> + dma_async_tx_callback callback;
> +
> +restart:
> + spin_lock_bh(&chan->desc_lock);
>
> +
> + old = chan->next_to_clean;
> +
> + new = *chan->chan.status & PAS_STATUS_PCNT_M;
> + new <<= 2;
> + new &= (RING_SZ-1);
> +
> + if (old > new)
> + new += RING_SZ;
> +
> + for (i = old; i < new; i += 4) {
> + if (unlikely(chan->chan.ring_virt[i & (RING_SZ-1)] & XCT_COPY_O))
> + break;
> + desc = chan->ring_info[i & (RING_SZ-1)];
> +
> + callback = desc->async_tx.callback;
> + if (callback) {
> + /* Can't re-lock and just loop, since another cpu
> + * might have came in here while we released the lock.
> + * Instead, start all over again to re-read status words.
> + */
>
> + chan->next_to_clean = i & (RING_SZ-1);
> + spin_unlock_bh(&chan->desc_lock);
> + callback(desc->async_tx.callback_param);
> + goto restart;
> + }
Clients do not submit new operations in their callback routines so it
is "ok" to hold this lock over the callback.
Also, if your platform will need to support channel switching at some
point you can go ahead and add a call to async_tx_run_dependencies()
here.
next prev parent reply other threads:[~2008-03-17 18:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 23:39 [PATCH] pasemi_dma: Driver for PA Semi PWRficient on-chip DMA engine Olof Johansson
2008-03-07 0:31 ` Stephen Rothwell
2008-03-07 1:35 ` Olof Johansson
2008-03-11 7:06 ` Andrew Morton
2008-03-11 14:25 ` Olof Johansson
2008-03-11 17:53 ` Andrew Morton
2008-03-11 18:15 ` Dan Williams
2008-03-11 18:29 ` Kumar Gala
2008-03-11 20:37 ` Dan Williams
2008-03-11 17:04 ` [PATCH] pasemi_dma: Driver for PA Semi PWRficient on-chip DMAengine Dan Williams
2008-03-13 19:54 ` Olof Johansson
2008-03-13 22:29 ` Dan Williams
2008-03-13 23:14 ` Olof Johansson
2008-03-14 0:06 ` Dan Williams
2008-03-16 21:30 ` [PATCH v2] pasemi_dma: Driver for PA Semi PWRficient on-chip DMA engine Olof Johansson
2008-03-17 18:46 ` Dan Williams [this message]
2008-03-18 0:27 ` Olof Johansson
2008-03-17 20:34 ` [PATCH v2] pasemi_dma: Driver for PA Semi PWRficient on-chip DMAengine Nelson, Shannon
2008-03-18 0:21 ` Olof Johansson
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=e9c3a7c20803171146m5a7f0e11m31e074634de22b42@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=hskinnemoen@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=olof@lixom.net \
--cc=pasemi-linux@ozlabs.org \
--cc=shannon.nelson@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;
as well as URLs for NNTP newsgroup(s).