From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 2/2] dmaengine: Add Xilinx AXI Central Direct Memory Access Engine driver support
Date: Mon, 5 Oct 2015 16:18:17 +0100 [thread overview]
Message-ID: <20151005151816.GD13501@vkoul-mobl.iind.intel.com> (raw)
In-Reply-To: <1441629198-17663-1-git-send-email-appanad@xilinx.com>
On Mon, Sep 07, 2015 at 06:03:18PM +0530, Kedareswara rao Appana wrote:
> +static struct xilinx_cdma_tx_segment *
> +xilinx_cdma_alloc_tx_segment(struct xilinx_cdma_chan *chan)
> +{
> + struct xilinx_cdma_tx_segment *segment;
> + dma_addr_t phys;
> +
> + segment = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &phys);
> + if (!segment)
> + return NULL;
> +
> + memset(segment, 0, sizeof(*segment));
dma_pool_zalloc() pls
> +static void xilinx_cdma_start_transfer(struct xilinx_cdma_chan *chan)
> +{
> + struct xilinx_cdma_tx_descriptor *head_desc, *tail_desc;
> + struct xilinx_cdma_tx_segment *tail_segment;
> + u32 ctrl_reg = cdma_read(chan, XILINX_CDMA_CONTROL_OFFSET);
> +
> + if (chan->err)
> + return;
> +
> + if (list_empty(&chan->pending_list))
> + return;
> +
> + if (!chan->idle)
> + return;
this and err case can be combined !
> +static struct dma_async_tx_descriptor *
> +xilinx_cdma_prep_memcpy(struct dma_chan *dchan, dma_addr_t dma_dst,
> + dma_addr_t dma_src, size_t len, unsigned long flags)
> +{
> + struct xilinx_cdma_chan *chan = to_xilinx_chan(dchan);
> + struct xilinx_cdma_desc_hw *hw;
> + struct xilinx_cdma_tx_descriptor *desc;
> + struct xilinx_cdma_tx_segment *segment, *prev;
> +
> + if (!len || len > XILINX_CDMA_MAX_TRANS_LEN)
> + return NULL;
> +
> + desc = xilinx_cdma_alloc_tx_descriptor(chan);
> + if (!desc)
> + return NULL;
> +
> + dma_async_tx_descriptor_init(&desc->async_tx, &chan->common);
> + desc->async_tx.tx_submit = xilinx_cdma_tx_submit;
> + async_tx_ack(&desc->async_tx);
Why do you need this ?
> +static int xilinx_cdma_terminate_all(struct dma_chan *dchan)
> +{
> + struct xilinx_cdma_chan *chan = to_xilinx_chan(dchan);
> +
> + /* Reset the channel */
> + xilinx_cdma_chan_reset(chan);
what about the irqs that are already fired/tasklets scheduled?
> +
> + /* Remove and free all of the descriptors in the lists */
> + xilinx_cdma_free_descriptors(chan);
> +
> + return 0;
> +}
> +
> +/* -----------------------------------------------------------------------------
> + * Probe and remove
> + */
> +
> +/**
> + * xilinx_cdma_free_channel - Channel remove function
> + * @chan: Driver specific cdma channel
> + */
> +static void xilinx_cdma_free_channel(struct xilinx_cdma_chan *chan)
Free channel is a bad name, as we alloc and free channels from dmaengine API
--
~Vinod
prev parent reply other threads:[~2015-10-05 15:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 12:33 [PATCH v6 2/2] dmaengine: Add Xilinx AXI Central Direct Memory Access Engine driver support Kedareswara rao Appana
2015-10-05 13:39 ` Vinod Koul
2015-10-05 13:50 ` Appana Durga Kedareswara Rao
2015-10-05 14:10 ` Koul, Vinod
2015-10-05 14:19 ` Appana Durga Kedareswara Rao
2015-10-05 15:18 ` Vinod Koul [this message]
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=20151005151816.GD13501@vkoul-mobl.iind.intel.com \
--to=vinod.koul@intel.com \
--cc=linux-arm-kernel@lists.infradead.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