From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
Linux-sh list <linux-sh@vger.kernel.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sh: migor: Reserve memory block for CEU
Date: Thu, 09 Nov 2017 03:32:07 +0200 [thread overview]
Message-ID: <1691054.qjv9XWrNm9@avalon> (raw)
In-Reply-To: <CAMuHMdX5V1Zw+_HoBukkFx=7=n75WCDfrKTZrjH8JfQmNjFyQw@mail.gmail.com>
Hi Geert,
On Wednesday, 8 November 2017 20:31:22 EET Geert Uytterhoeven wrote:
> On Wed, Nov 8, 2017 at 7:05 PM, Jacopo Mondi wrote:
> > A memory region for CEU video buffer has to be reserved during machine
> > initialization.
> >
> > Originally, it was allocated through DMA API helpers and stored in the
> > second IORESOURCE_MEM entry, to be later remapped by the CEU driver with
> > a call to 'dma_declare_coherent_memory()'
> >
> > As Linux does not allow anymore to remap system RAM regions with
> > 'memremap' function, sh_mobile_ceu driver fails when trying to remap the
> > memory area:
> >
> > WARN_ONCE(1, "memremap attempted on ram %pa size: %#lx\n",
> >
> > &offset, (unsigned long) size)
> >
> > from 'memremap()' function in kernel/memremap.c
> >
> > To avoid hitting that WARN_ONCE() and have memory successfully remapped,
> > reserve a region using '.mv_mem_reserve' member of SH's 'struct
> > sh_machine_vector' to make sure memory is reserved early enough, and
> > removed from the available system RAM.
> >
> > This is similar to what happens on ARM architecture with
> > 'arm_memblock_steal()' function.
> >
> > Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
>
> I assume this failure isnot limited to CEU on Migo-R, but applies to
> the other 24 callers of platform_resource_setup_memory(), too?
>
> Can platform_resource_setup_memory() be fixed instead, or is that difficult
> due to the need to reserve the memory very early in the boot process?
That's exactly the problem, memory needs to be reserved early at boot, earlier
than the current call sites of platform_resource_setup_memory().
The real fix in my opinion would be to use CMA, but implementing CMA for SH is
out of scope of Jacopo's work on the CEU driver. And that would still require
patching all the 24 callers of platform_resource_setup_memory() anyway.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2017-11-09 1:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 18:05 [PATCH] sh: migor: Reserve memory block for CEU Jacopo Mondi
2017-11-08 18:31 ` Geert Uytterhoeven
2017-11-09 1:32 ` Laurent Pinchart [this message]
2017-11-09 1:39 ` Laurent Pinchart
2017-11-14 16:59 ` jacopo mondi
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=1691054.qjv9XWrNm9@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dalias@libc.org \
--cc=geert@linux-m68k.org \
--cc=jacopo+renesas@jmondi.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=ysato@users.sourceforge.jp \
/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