U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Maniyam, Dinesh" <dinesh.maniyam@altera.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Marek Vasut <marex@denx.de>,
	Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Tom Rini <trini@konsulko.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Tien Fong <tien.fong.chee@altera.com>,
	Kok Kiang <kok.kiang.hea@altera.com>,
	Boon Khai <boon.khai.ng@altera.com>,
	Alif <alif.zakuan.yuslaimi@altera.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH] driver: nand: skip BBT scan during SPL to reduce size and complexity
Date: Tue, 25 Nov 2025 11:02:04 +0800	[thread overview]
Message-ID: <2f8f86c3-8290-41d4-946b-eda747c707b4@altera.com> (raw)
In-Reply-To: <e7e19789-6c0b-4ede-b7a3-ad5002a7b9ed@gmx.de>

Hi

On 25/11/2025 8:00 am, Heinrich Schuchardt wrote:
> [CAUTION: This email is from outside your organization. Unless you 
> trust the sender, do not click on links or open attachments as it may 
> be a fraudulent email attempting to steal your information and/or 
> compromise your computer.]
>
> On 11/13/25 04:03, dinesh.maniyam@altera.com wrote:
>> From: Dinesh Maniyam <dinesh.maniyam@altera.com>
>>
>> Guard the Bad Block Table (BBT) scanning with `#ifndef CONFIG_SPL_BUILD`
>
> Thank you for looking into this issue.
>
> In the patch you use CONFIG_XPL_BUILD not CONFIG_SPL_BUILD.
>
> Overlooked. I will make changes to the commit message.
>
>> to prevent running `chip->scan_bbt()` in SPL builds.
>>
>> The SPL only requires basic NAND read functionality to load the next
>> stage and does not need full BBT management. Running the BBT scan in
>> SPL unnecessarily increases code size, memory usage, and boot time.
>>
>> This change ensures the BBT is scanned only in U-Boot proper, where the
>> full NAND subsystem and dynamic memory are available.
>>
>> Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
>> ---
>>   drivers/mtd/nand/raw/nand_base.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/raw/nand_base.c 
>> b/drivers/mtd/nand/raw/nand_base.c
>> index 48e3685d995..4dc2a19b8f6 100644
>> --- a/drivers/mtd/nand/raw/nand_base.c
>> +++ b/drivers/mtd/nand/raw/nand_base.c
>> @@ -532,7 +532,9 @@ static int nand_block_checkbad(struct mtd_info 
>> *mtd, loff_t ofs, int allowbbt)
>>       if (!(chip->options & NAND_SKIP_BBTSCAN) &&
>>           !(chip->options & NAND_BBT_SCANNED)) {
>>               chip->options |= NAND_BBT_SCANNED;
>> +#ifndef CONFIG_XPL_BUILD
>
> Running scripts/checkpatch.pl creates a warning because you use #ifdef
> instead of preferred
>
>     if (IS_ENABLED(CONFIG_XPL_BUILD))
>
> Best regards
>
> Heinrich
>
> I will use the preferred. 
>
> Thanks
> Dinesh
>
>>               chip->scan_bbt(mtd);
>> +#endif
>>       }
>>
>>       if (!chip->bbt)
>

  reply	other threads:[~2025-11-25  8:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  3:03 [PATCH] driver: nand: skip BBT scan during SPL to reduce size and complexity dinesh.maniyam
2025-11-25  0:00 ` Heinrich Schuchardt
2025-11-25  3:02   ` Maniyam, Dinesh [this message]
2025-11-25 11:55   ` Marek Vasut
2025-11-25 14:54     ` Miquel Raynal
2025-11-27  0:56       ` Maniyam, Dinesh
2025-11-25 13:45 ` Michael Nazzareno Trimarchi

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=2f8f86c3-8290-41d4-946b-eda747c707b4@altera.com \
    --to=dinesh.maniyam@altera.com \
    --cc=alif.zakuan.yuslaimi@altera.com \
    --cc=andre.przywara@arm.com \
    --cc=andrew.goodbody@linaro.org \
    --cc=boon.khai.ng@altera.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=kok.kiang.hea@altera.com \
    --cc=marex@denx.de \
    --cc=michael@amarulasolutions.com \
    --cc=simon.k.r.goldschmidt@gmail.com \
    --cc=tien.fong.chee@altera.com \
    --cc=trini@konsulko.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox