From: Ryan Chen <ryan_chen@aspeedtech.com>
To: Borislav Petkov <bp@alien8.de>,
Eric Yun Lin Chiang <ericyunlinchiang@gmail.com>
Cc: Stefan Schaeckeler <sschaeck@cisco.com>,
Tony Luck <tony.luck@intel.com>, Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@codeconstruct.com.au>,
Billy Tsai <billy_tsai@aspeedtech.com>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] EDAC/aspeed: do not fail probe when ECC is disabled
Date: Mon, 30 Nov 2026 23:54:37 +0000 [thread overview]
Message-ID: <TYZPR06MB79206491D18501DFFCB8EDDBF24E2@TYZPR06MB7920.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <20261130184620.GDaw3EfMZIOSEcOjq_@fat_crate.local>
> Subject: Re: [PATCH] EDAC/aspeed: do not fail probe when ECC is disabled
>
> Ryan?
Yes, give me more time to look at this ~
>
> On Wed, Nov 18, 2026 at 11:19:07PM +0800, Eric Yun Lin Chiang wrote:
> > The AST2600 memory-controller EDAC node is enabled by default in
> > aspeed-g6.dtsi (it has no status property), so aspeed_edac binds on
> > every AST2600 board. aspeed_probe() reads the memory-controller
> > configuration and, when DRAM ECC was not turned on by firmware, prints
> > an error and returns -EPERM:
> >
> > aspeed-edac 1e6e0000.sdram: ECC mode is not configured in u-boot
> > aspeed-edac 1e6e0000.sdram: probe with driver aspeed-edac failed
> > with error -1
> >
> > Running without DRAM ECC is a normal platform choice, not a failure.
> > -EPERM is both the wrong errno (this is not a permission problem) and
> > one the driver core reports as a probe error, so every non-ECC AST2600
> > board logs a spurious "failed with error -1" at boot.
> >
> > Return -ENODEV instead, which the driver core treats as "no device to
> > bind" and does not log as an error, and lower the message to dev_info
> > so the reason EDAC did not register is still visible once without
> > looking like a fault. The AST2500 node is disabled by default, so only
> > boards that explicitly enable it are affected there. No other error
> > path is changed.
> >
> > This change was prepared with the help of an AI coding assistant,
> > which analysed the probe path and drafted this changelog; the author
> > has reviewed it and stands behind the change.
> >
> > Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC
> > driver")
> > Signed-off-by: Eric Yun Lin Chiang <ericyunlinchiang@gmail.com>
> > ---
> > Tested: the pre-fix "failed with error -1" was reproduced on an
> > AST2600 (Facebook Bletchley) BMC by triggering the aspeed-edac probe
> > over sysfs; the fixed driver builds (W=1, no new warnings) and passes
> > checkpatch, and the resulting behaviour -- aspeed_probe() now returns
> > -ENODEV, which the driver core does not log as an error -- was
> > confirmed by disassembly of the built object. NOT boot-tested on
> > hardware (the kernel was not booted).
> >
> > drivers/edac/aspeed_edac.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
> > index 6e069b255..e6f8cf78a 100644
> > --- a/drivers/edac/aspeed_edac.c
> > +++ b/drivers/edac/aspeed_edac.c
> > @@ -295,8 +295,8 @@ static int aspeed_probe(struct platform_device
> *pdev)
> > /* bail out if ECC mode is not configured */
> > regmap_read(aspeed_regmap, ASPEED_MCR_CONF, ®04);
> > if (!(reg04 & ASPEED_MCR_CONF_ECC)) {
> > - dev_err(&pdev->dev, "ECC mode is not configured in u-boot\n");
> > - return -EPERM;
> > + dev_info(&pdev->dev, "ECC mode is not configured in u-boot\n");
> > + return -ENODEV;
> > }
> >
> > edac_op_state = EDAC_OPSTATE_INT;
> > --
> > 2.53.0
> >
> >
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
prev parent reply other threads:[~2026-11-30 23:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 15:19 Eric Yun Lin Chiang
2026-11-30 18:46 ` Borislav Petkov
2026-11-30 23:54 ` Ryan Chen [this message]
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=TYZPR06MB79206491D18501DFFCB8EDDBF24E2@TYZPR06MB7920.apcprd06.prod.outlook.com \
--to=ryan_chen@aspeedtech.com \
--cc=andrew@codeconstruct.com.au \
--cc=billy_tsai@aspeedtech.com \
--cc=bp@alien8.de \
--cc=ericyunlinchiang@gmail.com \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sschaeck@cisco.com \
--cc=tony.luck@intel.com \
/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
all inboxes | Powered by JetHome®