linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jonathan Hunter
	<jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Laxman Dewangan
	<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dmaengine: tegra-apb: Support non-flow controlled slave configuration
Date: Thu, 12 Oct 2017 22:23:11 +0530	[thread overview]
Message-ID: <20171012165310.GU30097@localhost> (raw)
In-Reply-To: <20171003223838.31834-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Wed, Oct 04, 2017 at 01:38:38AM +0300, Dmitry Osipenko wrote:
> This allows DMA client to issue a non-flow controlled TX. In particular
> it is needed for the fuse driver that reads fuse registers using APBDMA
> to workaround a HW bug that results in hang when CPU and DMA perform
> simultaneous access to fuse peripheral.
> 
> Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/dma/tegra20-apb-dma.c | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index b9d75a54c896..a177039713a7 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -353,7 +353,8 @@ static int tegra_dma_slave_config(struct dma_chan *dc,
>  	}
>  
>  	memcpy(&tdc->dma_sconfig, sconfig, sizeof(*sconfig));
> -	if (tdc->slave_id == TEGRA_APBDMA_SLAVE_ID_INVALID) {
> +	if (tdc->slave_id == TEGRA_APBDMA_SLAVE_ID_INVALID &&
> +	    sconfig->device_fc) {
>  		if (sconfig->slave_id > TEGRA_APBDMA_CSR_REQ_SEL_MASK)
>  			return -EINVAL;
>  		tdc->slave_id = sconfig->slave_id;
> @@ -970,8 +971,13 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
>  					TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
>  	ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
>  
> -	csr |= TEGRA_APBDMA_CSR_ONCE | TEGRA_APBDMA_CSR_FLOW;
> -	csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
> +	csr |= TEGRA_APBDMA_CSR_ONCE ;
				    ^^^
Checkpatch should have complained here, no space before ; please

> +
> +	if (tdc->slave_id != TEGRA_APBDMA_SLAVE_ID_INVALID) {
> +		csr |= TEGRA_APBDMA_CSR_FLOW;
> +		csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
> +	}
> +
>  	if (flags & DMA_PREP_INTERRUPT)
>  		csr |= TEGRA_APBDMA_CSR_IE_EOC;
>  
> @@ -1110,10 +1116,13 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
>  					TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
>  	ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
>  
> -	csr |= TEGRA_APBDMA_CSR_FLOW;
> +	if (tdc->slave_id != TEGRA_APBDMA_SLAVE_ID_INVALID) {
> +		csr |= TEGRA_APBDMA_CSR_FLOW;
> +		csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
> +	}
> +
>  	if (flags & DMA_PREP_INTERRUPT)
>  		csr |= TEGRA_APBDMA_CSR_IE_EOC;
> -	csr |= tdc->slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
>  
>  	apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
>  
> -- 
> 2.14.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
~Vinod

  parent reply	other threads:[~2017-10-12 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 22:38 [PATCH] dmaengine: tegra-apb: Support non-flow controlled slave configuration Dmitry Osipenko
     [not found] ` <20171003223838.31834-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-05 12:20   ` Jon Hunter
2017-10-12 16:53   ` Vinod Koul [this message]
2017-10-12 17:35     ` Dmitry Osipenko

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=20171012165310.GU30097@localhost \
    --to=vinod.koul-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@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=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).