U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Monin" <benoit.monin@bootlin.com>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.u-boot-project.org, "Yao Zi" <me@ziyao.cc>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Quentin Schulz" <quentin.schulz@cherry.de>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Marek Vasut" <marek.vasut+renesas@mailbox.org>,
	"Torsten Duwe" <duwe@suse.de>,
	"Ryan Chen" <ryan_chen@aspeedtech.com>,
	"Guodong Xu" <guodong@riscstar.com>,
	"Alexey Charkov" <alchark@flipper.net>,
	"Bastien Curutchet" <bastien.curutchet@bootlin.com>,
	"Johan Jonker" <jbx6244@gmail.com>,
	"Tim Ouyang" <tim609@andestech.com>,
	"Leo Liang" <leo.liang@sifive.com>,
	"Jun Chang" <jun.chang@metanoia-comm.com>,
	"Peng Fan" <peng.fan@nxp.com>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"Bin Liu" <b-liu@ti.com>,
	"Hiago De Franco" <hfranco@baylibre.com>,
	"Michal Simek" <michal.simek@amd.com>,
	"Raymond Mao" <raymond.mao@riscstar.com>,
	"Alexander Feilke" <alexander.feilke@ew.tq-group.com>,
	"Chris Packham" <judge.packham@gmail.com>,
	"Randolph Sheng-Kai Lin(林聖凱)" <randolph@andestech.com>
Subject: Re: [PATCH 03/10] disk: efi: Reuse the GPT entries buffer with simple malloc
Date: Tue, 13 Oct 2026 10:45:00 +0200	[thread overview]
Message-ID: <0QsgRw8RTAyVBggNhJIj0A@bootlin.com> (raw)
In-Reply-To: <20261002152605.GT858934@bill-the-cat>

On Friday, 2 October 2026 at 17:26:05 CEST, Tom Rini wrote:
[...]
> > +      size = PAD_TO_BLOCKSIZE(count, desc);
> > +
> >        /* Allocate memory for PTE, remember to FREE */
> > -      if (count != 0) {
> > -              pte = memalign(ARCH_DMA_MINALIGN,
> > -                             PAD_TO_BLOCKSIZE(count, desc));
> > +      if (CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)) {
> > +              /*
> > +               * The simple malloc has a no-op free(): keep one
> > +               * buffer and reuse it. The entries are re-read on
> > +               * every call, so the buffer is device- and LBA-agnostic.
> > +               */
> > +              static gpt_entry *cache;
> > +              static size_t cache_size;
> > +
> > +              if (cache && cache_size == size) {
> > +                      pte = cache;
> > +              } else {
> > +                      pte = memalign(ARCH_DMA_MINALIGN, size);
> > +                      cache = pte;
> > +                      cache_size = size;
> > +              }
> > +      } else {
> > +              pte = memalign(ARCH_DMA_MINALIGN, size);
> >        }
> >  
> >        if (count == 0 || pte == NULL) {
> 
> This doesn't seem identical in the non-SPL case, since now pte is always
> assigned. Or am I missing something?
> 
I did overlook the count==0 case, will fix that.

-- 
Benoît



  reply	other threads:[~2026-10-13  8:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 13:02 [PATCH 00/10] riscv: Add support for Metanoia MT2824 SoC and MT5824 EVB Benoît Monin
2026-10-02 13:02 ` [PATCH 01/10] iopoll: Add readw_poll_sleep_timeout Benoît Monin
2026-10-02 15:25   ` Tom Rini
2026-10-13  8:44     ` Benoît Monin
2026-10-02 13:02 ` [PATCH 02/10] reset: Add a driver for simple controller Benoît Monin
2026-10-02 13:02 ` [PATCH 03/10] disk: efi: Reuse the GPT entries buffer with simple malloc Benoît Monin
2026-10-02 15:26   ` Tom Rini
2026-10-13  8:45     ` Benoît Monin [this message]
2026-10-02 13:02 ` [PATCH 04/10] nvmxip: Make NVM XIP devices available in SPL Benoît Monin
2026-10-02 15:28   ` Tom Rini
2026-10-02 13:02 ` [PATCH 05/10] riscv: andes: Add Kconfig option for Andes erratum #35102 Benoît Monin
2026-10-02 13:02 ` [PATCH 06/10] mmc: metanoia_sdhci: Add SDHCI driver for Metanoia MT2824 SoC Benoît Monin
2026-10-02 15:29   ` Tom Rini
2026-10-13  8:45     ` Benoît Monin
2026-10-13 15:05       ` Tom Rini
2026-10-02 13:02 ` [PATCH 07/10] ram: metanoia: Add driver for MT2824 DDR controller Benoît Monin
2026-10-02 13:02 ` [PATCH 08/10] spi: atcspi200_spi: Add spi-mem support for the Metanoia ATCSPI200 variant Benoît Monin
2026-10-02 13:02 ` [PATCH 09/10] riscv: dts: add MT2824 SoC and MT5824 EVB device trees Benoît Monin
2026-10-02 13:02 ` [PATCH 10/10] riscv: metanoia: Add support for the MT5824 EVB platform Benoît Monin

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=0QsgRw8RTAyVBggNhJIj0A@bootlin.com \
    --to=benoit.monin@bootlin.com \
    --cc=alchark@flipper.net \
    --cc=alexander.feilke@ew.tq-group.com \
    --cc=b-liu@ti.com \
    --cc=bastien.curutchet@bootlin.com \
    --cc=duwe@suse.de \
    --cc=guodong@riscstar.com \
    --cc=heiko@sntech.de \
    --cc=hfranco@baylibre.com \
    --cc=jbx6244@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=judge.packham@gmail.com \
    --cc=jun.chang@metanoia-comm.com \
    --cc=leo.liang@sifive.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=me@ziyao.cc \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@nxp.com \
    --cc=quentin.schulz@cherry.de \
    --cc=randolph@andestech.com \
    --cc=raymond.mao@riscstar.com \
    --cc=ryan_chen@aspeedtech.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tim609@andestech.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.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