From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=65.109.113.108 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796064403; b=3pSnnaRTNELFZJsbUWPmbUyORYZZbu9GNS5aLuhRCwNXv3WGRzhaJs0h7oo1QOSQqnmo L4S1Wu9IHZSiLigF3ftoB2OuA3SlLKCOJEC1TR+fMHVbdOeLfLqTrnRi8k6B3AfKMzJXJ FzbK0pcBO0uBMbQhlQBTVSXAfZI+1xystwGvi7MyDoXWgX4adr4wu8hhLgXjDvkEpYv0K P/nL96z+DtHt9Ao1EqBmgtL+BQPr2zoc3MHF5zqyAA237t16IezjGmHsizsdJbvbYKZQ8 NPDLp5ZIz+LtqREEt5FdGVcTPB/jUOpNPW60TbPVKJ65vj1++B3qO2ZZk6GaGMi9SFw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796064403; h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:Date:From:To: Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=KbC54uZ6hHphbcTrmC+6ZVtTb2vP4+rUGdAt3ID38hY=; b=Dt2xTg003iHDgjc0zmXDzLfHdt8IC2ufjMY8GFLuWVRckstAA03YZFhQ5U7Rt1Z4/sx4 oV2x30H65YDsFDiaKUXGqa+cGmPFpk0G9lzxy8D9BtEVIe/ClpX5e9Jz5lu9WSU4LjN4N g0sZ7OoGZp+9V2ivDVPBVY8RIMIMfb3x/kjEBAK4dhu53ebxXOsqEOImNUsMUFDImOZ4b XpiXXzK0xUsoj4ZmRpC8C9I8IlW3n+d3usvmlJ7CZvCaMs1R3XP3uA/VQs2gPgozX3/Bl A+kCAUdnBoJUMGxJcERfpE1M8/lZgiStfGMds3rwPG30MzDce1OSs+SI70tF8m0o6nQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; arc=none smtp.remote-ip=65.109.113.108 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 969CB606A31C; Mon, 30 Nov 2026 18:46:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 969CB606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 5BE0540E0218; Mon, 30 Nov 2026 18:46:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hqR9oXMhtdmq; Mon, 30 Nov 2026 18:46:35 +0000 (UTC) Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::2b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 8C94540E0140; Mon, 30 Nov 2026 18:46:23 +0000 (UTC) Date: Mon, 30 Nov 2026 10:46:20 -0800 From: Borislav Petkov To: Eric Yun Lin Chiang , Ryan Chen Cc: Stefan Schaeckeler , Tony Luck , Joel Stanley , Andrew Jeffery , Billy Tsai , linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] EDAC/aspeed: do not fail probe when ECC is disabled Message-ID: <20261130184620.GDaw3EfMZIOSEcOjq_@fat_crate.local> References: <20261118151907.3949719-1-ericyunlinchiang@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261118151907.3949719-1-ericyunlinchiang@gmail.com> Ryan? 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 > --- > 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