linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/2] soc/tegra: fuse: Fix reading registers using DMA on Tegra20
Date: Wed, 4 Oct 2017 11:47:27 +0100	[thread overview]
Message-ID: <d0e89b75-a223-2509-e8f5-bc38736346aa@nvidia.com> (raw)
In-Reply-To: <1fe535d4655ae00199a8d60768b384e87df3ed51.1507068874.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


On 03/10/17 23:35, Dmitry Osipenko wrote:
> DMA config is incorrect, because of it DMA transfer is never issued and
> tegra20_fuse_read() always returns 0x0.
> 
> Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/soc/tegra/fuse/fuse-tegra.c   | 1 +
>  drivers/soc/tegra/fuse/fuse-tegra20.c | 3 ++-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
> index b7c552e3133c..73a3a2c74021 100644
> --- a/drivers/soc/tegra/fuse/fuse-tegra.c
> +++ b/drivers/soc/tegra/fuse/fuse-tegra.c
> @@ -132,6 +132,7 @@ static int tegra_fuse_probe(struct platform_device *pdev)
>  
>  	/* take over the memory region from the early initialization */
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	fuse->phys = res->start;
>  	fuse->base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(fuse->base))
>  		return PTR_ERR(fuse->base);
> diff --git a/drivers/soc/tegra/fuse/fuse-tegra20.c b/drivers/soc/tegra/fuse/fuse-tegra20.c
> index 294413a969a0..a33f48c06771 100644
> --- a/drivers/soc/tegra/fuse/fuse-tegra20.c
> +++ b/drivers/soc/tegra/fuse/fuse-tegra20.c
> @@ -59,7 +59,7 @@ static u32 tegra20_fuse_read(struct tegra_fuse *fuse, unsigned int offset)
>  
>  	mutex_lock(&fuse->apbdma.lock);
>  
> -	fuse->apbdma.config.src_addr = fuse->apbdma.phys + FUSE_BEGIN + offset;
> +	fuse->apbdma.config.src_addr = fuse->phys + FUSE_BEGIN + offset;
>  
>  	err = dmaengine_slave_config(fuse->apbdma.chan, &fuse->apbdma.config);
>  	if (err)
> @@ -119,6 +119,7 @@ static int tegra20_fuse_probe(struct tegra_fuse *fuse)
>  	fuse->apbdma.config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
>  	fuse->apbdma.config.src_maxburst = 1;
>  	fuse->apbdma.config.dst_maxburst = 1;
> +	fuse->apbdma.config.direction = DMA_DEV_TO_MEM;
>  
>  	init_completion(&fuse->apbdma.wait);
>  	mutex_init(&fuse->apbdma.lock);

Acked-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Cheers
Jon

-- 
nvpublic

  parent reply	other threads:[~2017-10-04 10:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 22:35 [PATCH v2 0/2] Correct Tegra20 FUSE driver DMA usage Dmitry Osipenko
     [not found] ` <cover.1507068874.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-03 22:35   ` [PATCH v2 1/2] soc/tegra: fuse: Fix reading registers using DMA on Tegra20 Dmitry Osipenko
     [not found]     ` <1fe535d4655ae00199a8d60768b384e87df3ed51.1507068874.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-04 10:47       ` Jon Hunter [this message]
     [not found]         ` <d0e89b75-a223-2509-e8f5-bc38736346aa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-10-05 12:22           ` Jon Hunter
     [not found]             ` <9398d8e6-5a8d-7965-ebf8-9825c1fb3a06-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-10-05 12:41               ` Dmitry Osipenko
2017-10-03 22:35   ` [PATCH v2 2/2] soc/tegra: fuse: Explicitly request DMA channel from APB DMA driver Dmitry Osipenko
     [not found]     ` <c2b55552d079f47564456ebfcd982116aad32be8.1507068874.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-04 10:48       ` Jon Hunter
     [not found]         ` <a877b502-9c26-d27f-ab29-14918afa030c-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-10-04 11:11           ` 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=d0e89b75-a223-2509-e8f5-bc38736346aa@nvidia.com \
    --to=jonathanh-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=digetx-Re5JQEeQqe8AvxtiuMwx3w@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).