[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=b-Wzp4-0vg_AVz0os08dC7hX6gZBQn8WHfcF5@mail.gmail.com>
Date: Wed, 29 Sep 2010 14:16:00 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Linus Walleij <linus.walleij@...ricsson.com>
Cc: linux-kernel@...r.kernel.org, Peter Pearse <peter.pearse@....com>,
Ben Dooks <ben-linux@...ff.org>,
Kukjin Kim <kgene.kim@...sung.com>,
Alessandro Rubini <rubini@...pv.it>
Subject: Re: [PATCH] driver for the ARM PL080/PL081 PrimeCells v5
On Tue, Sep 28, 2010 at 6:57 AM, Linus Walleij
<linus.walleij@...ricsson.com> wrote:
> This creates a DMAengine driver for the ARM PL080/PL081 PrimeCells
> based on the implementation earlier submitted by Peter Pearse.
> This is working like a charm for memcpy and slave DMA to the PL011
> PrimeCell on the PB11MPCore.
>
> This DMA controller is used in mostly unmodified form in the ARM
> RealView and Versatile platforms, in the ST-Ericsson Nomadik, and
> in the ST SPEAr platform.
>
> It has been converted to use the header from the Samsung PL080
> derivate instead of its own defintions. The Samsungs have a custom
> driver in their mach-* folders though, atleast we can share the
> register definitions.
>
> Cc: Peter Pearse <peter.pearse@....com>
> Cc: Ben Dooks <ben-linux@...ff.org>
> Cc: Kukjin Kim <kgene.kim@...sung.com>
> Cc: Alessandro Rubini <rubini@...pv.it>
> Acked-by: Viresh Kumar <viresh.kumar@...com>
> Signed-off-by: Linus Walleij <linus.walleij@...ricsson.com>
> ---
> Changes v4->v5:
> - Squashed in all the follow-up patches
> - Deny transfers at prep() time and hold a scary lock across to
> tx_submit() time in order to avoid pending works being pulled out
> by completed transfers before submitting
> - inline dummy filter function
>
> Notes: I had to keep the condition that slave prep() calls will
> bail out immediately and not queue up like memcpy calls do. The
> reason is that a memcpy will always proceed once there is a
> physical channel available, whereas a slave transfer also needs
> to mux in a signal after acquiring the physical channel, and this
> can fail, which would mean that jobs would have to fail
> asynchronously as well which seems a bit unsafe to me.
> Waiting for the muxing to be available is no alternative either
> since there is no guarantee this will ever happen resulting in
> serious starvation, better to fail at prep() time IMO.
Yes, let's go with the simpler / safe option now we can always get
fancier later.
> +/*
> + * Initialize a descriptor to be used by memcpy submit
> + */
> +static struct dma_async_tx_descriptor *pl08x_prep_dma_memcpy(
> + struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
> + size_t len, unsigned long flags)
> +{
> + struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
> + struct pl08x_driver_data *pl08x = plchan->host;
> + struct pl08x_txd *txd;
> + int ret;
> +
> + txd = kzalloc(sizeof(struct pl08x_txd), GFP_KERNEL);
> + if (!txd) {
> + dev_err(&pl08x->adev->dev,
> + "%s no memory for descriptor\n", __func__);
> + return NULL;
> + }
With your acknowledgment I'll append a patch to convert this to
GFP_NOWAIT because device_prep_dma_memcpy() is meant to be callable
from atomic contexts.
--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists