mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH master] resource: fix recently broken memory bank fusing
Date: Mon, 17 Oct 2022 15:47:42 +0100	[thread overview]
Message-ID: <21c1503b-1522-a3f7-046b-e3868d6e525b@mev.co.uk> (raw)
In-Reply-To: <20221017133859.299705-1-a.fatoum@pengutronix.de>

On 17/10/2022 14:39, Ahmad Fatoum wrote:
> barebox will fuse overlapping memory banks to avoid the common issue of
> the device tree being modified upstream to contain a minimum RAM size
> that would then conflict with a RAM size barebox determines by
> querying the memory controller. This was recently broken, because we
> changed memory banks to have IORESOURCE_MEM in their flags field,
> but resource_contains() used to compare regions won't return true if
> memory type differs. Fix this by settings .flags = IORESOURCE_MEM
> for the new resource as well.
> 
> Reported-by: Ian Abbott <abbotti@mev.co.uk>
> Fixes: d0b5f6bde15b ("of: reserved-mem: reserve regions prior to mmu_initcall()")
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>   common/memory.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/common/memory.c b/common/memory.c
> index 7e24ecb2bd03..0ae9e7383cce 100644
> --- a/common/memory.c
> +++ b/common/memory.c
> @@ -149,6 +149,7 @@ int barebox_add_memory_bank(const char *name, resource_size_t start,
>   	struct resource newres = {
>   		.start = start,
>   		.end = start + size - 1,
> +		.flags = IORESOURCE_MEM,
>   	};
>   
>   	for_each_memory_bank(bank) {

Tested-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-




  reply	other threads:[~2022-10-17 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 13:39 Ahmad Fatoum
2022-10-17 14:47 ` Ian Abbott [this message]
2022-10-18  8:52 ` Sascha Hauer

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=21c1503b-1522-a3f7-046b-e3868d6e525b@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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