public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH/RFC] ARM: shmobile: LPAE memory bank CMA assignment prototype
Date: Mon, 28 Dec 2015 10:10:27 +0000	[thread overview]
Message-ID: <2868316.ceRkbP7uHp@avalon> (raw)
In-Reply-To: <20151219014005.6274.87661.sendpatchset@little-apple>

Hi Magnus,

On Monday 28 December 2015 12:17:15 Magnus Damm wrote:
> On Sun, Dec 27, 2015 at 5:51 PM, Laurent Pinchart wrote:
> > On Saturday 19 December 2015 10:40:05 Magnus Damm wrote:
> >> From: Magnus Damm <damm+renesas@opensource.se>
> >> 
> >> This prototype patch extends the kernel to also reserve CMA memory
> >> in the top memory bank on R-Car Gen2 boards and ties this larger
> >> CMA area to the DU device for testing purpose.
> >> 
> >> This top portion of the memory requires 40-bits addressing support
> >> in bus master devices including LPAE for the ARM CPU cores.
> >> 
> >> The patch assigns a 512 MiB CMA area to the DU device that may be
> >> used with the IPMMU hardware to perform 40-bit bus master access.
> >> Without IPMMU the DU hardware only supports 32-bit addresses.
> >> 
> >> Tested on r8a7791 Koelsch HDMI output using the modetest utility:
> >> # modetest -M rcar-du -s 33:1024x768@AR24
> >> 
> >> Not for upstream merge.
> > 
> > I tried to understand where the setup-rcar-gen2.c code you're patching
> > came from. Due to a rebase the commit message of 83850b04ae77 ("ARM:
> > shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update") is
> > incorrect, but I've traced the original commit to ae8bf91c80b0 ("ARM:
> > shmobile: Add shared R-Car Gen2 CMA reservation code") in Simon's tree.
> 
> Right, I recall adding that CMA reservation code.
> 
> > That patch doesn't look like a very good approach to me, and neither does
> > this one :-) drivers/staging/board is a hack, and we're starting to abuse
> > it.
>
> At the time the Gen2 CMA reservation code was written there was no DT
> memory reservation support available.

Good point.

> Regarding this patch, it is just a proof of concept to test allocation
> from a high memory address without modifying any hardware description.
> 
> > I don't want to see board code coming back through the back door. What's
> > wrong with just reserving memory in DT with the reserved-memory bindings
> > and assigning it to the DU ?
> 
> Describing device-to-memory bank assignment in DT equals mixing
> software policy with hardware description. I prefer to keep the
> software policy in C and the hardware description in DT.
> 
> If you think there are better ways to reserve memory, why don't you
> cook up a counter proposal and post it in a public space? =)

Doing it in DT is the better way in my opinion :-) There are established DT 
bindings for that purpose, and that's what upstream is using.

-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2015-12-28 10:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19  1:40 [PATCH/RFC] ARM: shmobile: LPAE memory bank CMA assignment prototype Magnus Damm
2015-12-27  8:51 ` Laurent Pinchart
2015-12-28  3:17 ` Magnus Damm
2015-12-28 10:10 ` Laurent Pinchart [this message]
2015-12-28 10:21 ` Geert Uytterhoeven
2015-12-28 10:24 ` Laurent Pinchart

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=2868316.ceRkbP7uHp@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-sh@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