devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Laxman Dewangan
	<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Courbot
	<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V4 2/3] dmaengine: tegra-adma: Add support for Tegra210 ADMA
Date: Tue, 5 Apr 2016 14:36:50 -0700	[thread overview]
Message-ID: <20160405213649.GA11586@vkoul-mobl.iind.intel.com> (raw)
In-Reply-To: <1458057390-20756-3-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On Tue, Mar 15, 2016 at 03:56:29PM +0000, Jon Hunter wrote:

> +static void tegra_adma_request_free(struct tegra_adma_chan *tdc)
> +{
> +	struct tegra_adma *tdma = tdc->tdma;
> +
> +	if (!tdc->sreq_reserved)
> +		return;
> +
> +	switch (tdc->sreq_dir) {
> +	case DMA_MEM_TO_DEV:
> +		clear_bit(tdc->sreq_index, &tdma->tx_requests_reserved);
> +		break;

empty line here woould be nicer

> +	ret = dma_cookie_status(dc, cookie, txstate);
> +	if (ret == DMA_COMPLETE || !txstate)
> +		return ret;
> +
> +	spin_lock_irqsave(&tdc->vc.lock, flags);
> +
> +	vd = vchan_find_desc(&tdc->vc, cookie);
> +	if (vd) {
> +		desc = to_tegra_adma_desc(&vd->tx);
> +		residual = desc->ch_regs.tc;

Here we are filling up residue for desc found in issued list

> +	} else if (tdc->desc && tdc->desc->vd.tx.cookie == cookie) {
> +		residual = tegra_adma_get_residue(tdc);

Well if it is not issued then why we we need to caluclate, its full size of
descriptor

> +	} else {
> +		residual = 0;

why this?

> +static struct dma_async_tx_descriptor *tegra_adma_prep_slave_sg(
> +	struct dma_chan *dc, struct scatterlist *sgl, unsigned int sg_len,
> +	enum dma_transfer_direction direction, unsigned long flags,
> +	void *context)
> +{
> +	struct tegra_adma_chan *tdc = to_tegra_adma_chan(dc);
> +
> +	dev_warn(tdc2dev(tdc), "scatter-gather transfers are not supported\n");
> +
> +	return NULL;
> +}

Why do we need this placeholder, If you dont support slave_sg dont add this
as capability

> +static const struct tegra_adma_chip_data tegra210_chip_data = {
> +	.nr_channels = 22,
> +};

why should this be hard coded in kernel and not queried from something like
DT? This case seems to be hardware property

> +	dma_cap_set(DMA_SLAVE, tdma->dma_dev.cap_mask);
> +	dma_cap_set(DMA_PRIVATE, tdma->dma_dev.cap_mask);
> +	dma_cap_set(DMA_CYCLIC, tdma->dma_dev.cap_mask);

I think you should not set DMA_SLAVE, do you need caps to be exported. I
think that should be exported for cyclic too, let me know if that was the
issue?

-- 
~Vinod

  parent reply	other threads:[~2016-04-05 21:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 15:56 [PATCH V4 0/3] Add support for Tegra210 ADMA Jon Hunter
     [not found] ` <1458057390-20756-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-03-15 15:56   ` [PATCH V4 1/3] Documentation: DT: Add binding documentation for NVIDIA ADMA Jon Hunter
     [not found]     ` <1458057390-20756-2-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-03-18 21:16       ` Rob Herring
2016-03-15 15:56   ` [PATCH V4 2/3] dmaengine: tegra-adma: Add support for Tegra210 ADMA Jon Hunter
     [not found]     ` <1458057390-20756-3-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-05 21:36       ` Vinod Koul [this message]
     [not found]         ` <20160405213649.GA11586-bQVUxfxUtC13uc1i7fC1zK2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2016-04-11 14:09           ` Jon Hunter
     [not found]             ` <570BB001.3020202-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-12 14:10               ` Vinod Koul
2016-04-12 16:23                 ` Jon Hunter
     [not found]                   ` <570D2104.1040607-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-13 13:49                     ` Vinod Koul
2016-04-13 17:20                       ` Stephen Warren
2016-04-14 11:04                       ` Jon Hunter
     [not found]                         ` <570F7952.2030606-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-18 15:06                           ` Jon Hunter
     [not found]                             ` <5714F7EF.5000605-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-19 13:25                               ` Vinod Koul
2016-04-19 13:59                                 ` Jon Hunter
     [not found]                                   ` <571639D5.10108-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-19 14:18                                     ` Arnd Bergmann
2016-04-19 14:54                                       ` Jon Hunter
     [not found]                                         ` <571646A3.1060400-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-19 15:13                                           ` Vinod Koul
2016-03-15 15:56   ` [PATCH V4 3/3] MAINTAINERS: Update Tegra DMA maintainers Jon Hunter
2016-03-28 12:39   ` [PATCH V4 0/3] Add support for Tegra210 ADMA Jon Hunter

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=20160405213649.GA11586@vkoul-mobl.iind.intel.com \
    --to=vinod.koul-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).