linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Loic Pallardy <loic.pallardy@st.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	linux-remoteproc@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arnaud Pouliquen <arnaud.pouliquen@st.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Suman Anna <s-anna@ti.com>
Subject: Re: [PATCH 4/7] remoteproc: add warning on resource table cast
Date: Fri, 30 Nov 2018 15:33:29 +0100	[thread overview]
Message-ID: <CAK8P3a25Y3y1Zjtf18i6Tgt83npLvbCeBvcd-r1+u8ijp=X2Yw@mail.gmail.com> (raw)
In-Reply-To: <1543526968-56091-5-git-send-email-loic.pallardy@st.com>

On Thu, Nov 29, 2018 at 10:31 PM Loic Pallardy <loic.pallardy@st.com> wrote:
>
> Today resource table supports only 32bit address fields.
> This is not compliant with 64bit platform for which addresses
> are cast in 32bit.
> This patch adds warn messages when address cast is done.
>
> Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
> ---
>  drivers/remoteproc/remoteproc_core.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 18a1bbf820c9..61c954bd695e 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -772,6 +772,10 @@ static int rproc_alloc_carveout(struct rproc *rproc,
>                 dev_dbg(dev, "carveout mapped 0x%x to %pad\n",
>                         mem->da, &dma);
>         } else {
> +               /* Update device address as undefined by requester */
> +               if (sizeof(dma_addr_t) > sizeof(u32))
> +                       dev_warn(dev, "DMA address cast in 32bit to fit resource table format\n");
> +
>                 mem->da = (u32)dma;
>         }

I think this patch is wrong: sizeof(dma_addr_t) is defined to be large enough
to support any machine that the kernel can run on. If you build a kernel that
happens to work on an ARM32 platform with LPAE enabled, then this will
warn every time, even if you are running on a machine that only has a 32-bit
address space.

     Arnd

  reply	other threads:[~2018-11-30 14:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 21:29 [PATCH 0/7] remoteproc: Fixes for memoy carveout management Loic Pallardy
2018-11-29 21:29 ` [PATCH 1/7] remoteproc: correct rproc_mem_entry_init() comments Loic Pallardy
2018-11-29 21:29 ` [PATCH 2/7] remoteproc: fix rproc_da_to_va in case of unallocated carveout Loic Pallardy
2018-11-29 21:29 ` [PATCH 3/7] remoteproc: fix rproc_alloc_carveout() bad variable cast Loic Pallardy
2018-11-29 21:29 ` [PATCH 4/7] remoteproc: add warning on resource table cast Loic Pallardy
2018-11-30 14:33   ` Arnd Bergmann [this message]
2018-11-30 20:48     ` Loic PALLARDY
2018-11-29 21:29 ` [PATCH 5/7] remoteproc: fix rproc_alloc_carveout() for rproc with iommu domain Loic Pallardy
2018-11-29 21:29 ` [PATCH 6/7] remoteproc: fix trace buffer va initialization Loic Pallardy
2018-12-06 20:37   ` Loic PALLARDY
2018-11-29 21:29 ` [PATCH 7/7] remoteproc: fix rproc_check_carveout_da() returned error and comments Loic Pallardy

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='CAK8P3a25Y3y1Zjtf18i6Tgt83npLvbCeBvcd-r1+u8ijp=X2Yw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=arnaud.pouliquen@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.com \
    /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).