linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.or>,
	Arnaud Pouliquen <arnaud.pouliquen@st.com>
Subject: Re: [PATCH] firmware: qcom_scm: use correct parameter type for dma_alloc_coherent
Date: Thu, 8 Feb 2018 15:09:34 +0100	[thread overview]
Message-ID: <CAK8P3a0-qZM8aaXSNjuQctZVirN6wEsOsU4pyDG7QhqcG2LBjA@mail.gmail.com> (raw)
In-Reply-To: <20180208122146.28399-1-benjamin.gaignard@linaro.org>

On Thu, Feb 8, 2018 at 1:21 PM, Benjamin Gaignard
<benjamin.gaignard@linaro.org> wrote:
> dma_alloc_coherent expects it third argument type to be dma_addr_t and
> not phys_addr_t.
> When phys_addr_t is defined as u32 and dma_addr_t as u64 that generate
> a compilation issue.
> Change the variable name because dma_alloc_coherent returns a bus
> address not a physical address.
>

> @@ -480,14 +480,14 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
>
>         /* Fill details of mem buff to map */
>         mem_to_map = ptr + ALIGN(src_sz, SZ_64);
> -       mem_to_map_phys = ptr_phys + ALIGN(src_sz, SZ_64);
> +       mem_to_map_phys = handle + ALIGN(src_sz, SZ_64);
>         mem_to_map[0].mem_addr = cpu_to_le64(mem_addr);
>         mem_to_map[0].mem_size = cpu_to_le64(mem_sz);
>
>         next_vm = 0;
>         /* Fill details of next vmid detail */
>         destvm = ptr + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);
> -       dest_phys = ptr_phys + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);
> +       dest_phys = handle + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);

This still assigns from a 'dma' address to a 'phys' address without a
long comment
explaining why you do it. There is also another instance of the naming confusion
in qcom_scm_pas_init_image and __qcom_scm_pas_init_image, so maybe they
should be addressed at the same time.

       Arnd

  reply	other threads:[~2018-02-08 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 12:21 [PATCH] firmware: qcom_scm: use correct parameter type for dma_alloc_coherent Benjamin Gaignard
2018-02-08 14:09 ` Arnd Bergmann [this message]
2018-02-08 14:26   ` Benjamin Gaignard

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=CAK8P3a0-qZM8aaXSNjuQctZVirN6wEsOsU4pyDG7QhqcG2LBjA@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=andy.gross@linaro.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.or \
    --cc=linux-soc@vger.kernel.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).