All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"U-Boot Custodians" <u-boot-custodians@lists.denx.de>,
	"Marek Vasut" <marex@denx.de>,
	"Pavel Herrmann" <morpheus.ibis@gmail.com>
Subject: Re: [PATCH 08/10] dm: core: Deal with a wrinkle with linker lists
Date: Tue, 19 Apr 2022 08:50:00 -0400	[thread overview]
Message-ID: <20220419125000.GM3045430@bill-the-cat> (raw)
In-Reply-To: <20220327202622.3438333-7-sjg@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

On Sun, Mar 27, 2022 at 02:26:20PM -0600, Simon Glass wrote:

> When every member of a linker list is aligned by the compiler, we can no
> longer rely on the sizeof of the struct to determine the number of
> entries.
> 
> For example, if the struct size is 0x90 but every entry is aligned to 0xa0
> by the compiler, the linker list entries takes more space in memory and
> the calculation of the number of entries is incorrect. For example, we may
> see 0x12 entries when there are only 0x11.
> 
> This is a real problem. There may be a general solution, although I cannot
> currently think of one. So far it only bites with OF_PLATDATA_RT which
> creates a pointer to each entry of the 'struct udevice' linker_list. This
> does not happen without that option, so it only affects SPL.
> 
> Work around it by manually calculating the aligned size of struct udevice,
> then using that for the n_ent calculation.
> 
> Note: the alignment fix to linker list was here:
> 
>    0b2fa98aa5e linker_lists: Fix alignment issue
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2022-04-19 12:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27 20:26 [PATCH 00/10] dm: Experiments for reducing SPL memory usage Simon Glass
2022-03-27 20:26 ` [PATCH 01/10] Makefile: v2 Allow LTO to be disabled for a build Simon Glass
2022-03-31 10:29   ` Andrew Scull
2022-04-11 21:46     ` Simon Glass
2022-04-11 21:53       ` Tom Rini
2022-05-15 18:52       ` Andrew Scull
2022-03-27 20:26 ` [PATCH 02/10] sandbox: Correct loss of early output in SPL Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 03/10] Makefile: Drop a stale comment about linking Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 04/10] Makefile: Avoid resetting link flags in config.mk Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 05/10] sandbox: Allow link flags to be given Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 06/10] sandbox: Align linker lists to a 32-byte boundary Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 07/10] dm: core: Allow devres to be disabled in SPL Simon Glass
2022-04-12 19:07   ` Angus Ainslie
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 08/10] dm: core: Deal with a wrinkle with linker lists Simon Glass
2022-04-19 12:50   ` Tom Rini [this message]
2022-03-27 20:26 ` [PATCH 09/10] RFC: dm: add tag support Simon Glass
2022-03-27 20:26 ` [PATCH 10/10] WIP: dm: core: Add a command to calculate memory usage Simon Glass

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=20220419125000.GM3045430@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=marek.behun@nic.cz \
    --cc=marex@denx.de \
    --cc=morpheus.ibis@gmail.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot-custodians@lists.denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.