From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796433057; b=ief5iuPiKOXQkB8Zm+g2pZqZorYnmESYYqxMSHkx8BzD4ZYPJCYR1681e9zpxVWsjQSZ 3+QUTGdCJk+RPYJ/OE6Y7nN1LBsZFuooJ34L0FlXHx2O16cBcbCvXcvpr3fSN6D0BSuMd Ry0HzLZid1dQk6tLHQkmkn6SykAaCSNZw8+6Pde+gYJfTVYfchtQhS5H6hKmJoA66qN1Y ZgarIh38nyNWeW9PJCjdIJKM591rmI/1JrjHhIKrc4o70M4zPNHfFgecKcWoIk92vIRJg VKapseWkVPbeJCHVK0apUut4wMNq8/Jqy94/6kpULcOWkRgND/1jLeXCZnRGutxSQ/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796433057; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=393J5jYgzjfLd7bp8ZRo8hvho62cuuYLzOM+yY51q58=; b=WqW2BHv0luQ8YhrDEmeVysRojQlhawCNZ7BmPOvyXb0YBB2fP61oD0lAAiZj+sfp/5nr uYgnDZ4MSLJVXr9YB5zANs/9CcYAjCwGXZKtZhnGYyxFkHZBrkcddd3uHy4RU2FO7hC+G 7RpMWnd3HRozxWDXDU+jfBA933L5eFcqJIKvgV3YNtxVuusDjkK0A2/CZ+umGgZPOOZvo nJMzQv4L5qeYHEVSY0rrg+nONwSwsXZxL3Los/N6No/yTmNBgcsxr+oCYj6f2HlNt4QWH K7m5vPqYqbKUAr24+VZaRSJ2rRfWOI1CFZcORkwQN2qIvuhALpA9cYSRUOvyuKSWXKA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XYxWNuCK; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66AD8606A322 for ; Sat, 5 Dec 2026 01:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XYxWNuCK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C2E61F00936; Sat, 5 Dec 2026 01:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796433057; bh=393J5jYgzjfLd7bp8ZRo8hvho62cuuYLzOM+yY51q58=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XYxWNuCKEyzJZh4HovI8yhuc8LrUxF0dsIsICSzNGLKqw/U2VHEe3f8+yaTQAXCtU oNMzdRQjPTO+/i63GonMrVTUbbluv5Wh0TZNVUt5E8bUuObMTsNp0bNitjjYM6gxgX WXQvYzAHc57CCtMZktSswEoWvppLdUte0r9GQEYMLtgraE8etJeKJmCAC+Wd6TMSoN OMvrLQZmPZZcecwPonna6Wfp/7iuCH5WvygWZj19vAXlLc4KGaYA+GsSxSpDBVHQAF VhmXWzuSUbWjJVEKEwh/yvMNyTCcUzngBChxlyxCgNeDL+/uvyz4ebOQIfToKpzkag rAB8bkYiOcBHA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v8 09/10] EDAC/aspeed: Add AST2700 support Reply-To: sashiko-reviews@lists.linux.dev To: "Ryan Chen" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261205-edac-v8-9-8a27981a6053@aspeedtech.com> References: <20261205-edac-v8-0-8a27981a6053@aspeedtech.com> <20261205-edac-v8-9-8a27981a6053@aspeedtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 01:10:56 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] edac: aspeed: AST2700 IRQ clear/counter mismatch in ast2700_irq_handler() -- commit 1990ff4c873d797149e12eca773229e520b466dc Author: Ryan Chen EDAC/aspeed: Add AST2700 support This commit adds EDAC support for the Aspeed AST2700 memory controller, including its interrupt handler, IRQ mask configuration, and device tree match entry. > diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c > index 4435820b20917..12c7d770afa6c 100644 > --- a/drivers/edac/aspeed_edac.c > +++ b/drivers/edac/aspeed_edac.c [ ... ] > @@ -198,6 +215,58 @@ static void ast2400_set_irq(struct driver_priv *priv= , bool enable) > enable ? ASPEED_MCR_INTR_CTRL_ENABLE : 0); > } > =20 > +static irqreturn_t ast2700_irq_handler(int irq, void *arg) > +{ > + struct mem_ctl_info *mci =3D arg; > + struct driver_priv *priv =3D mci->pvt_info; > + u32 int_sts, ecc_sts, fail_addr; > + u8 rec_cnt, un_rec_cnt; > + phys_addr_t addr; > + > + int_sts =3D readl(priv->regs + AST2700_INT_STS); > + if (!(int_sts & AST2700_INT_ECC)) > + return IRQ_NONE; > + > + ecc_sts =3D readl(priv->regs + AST2700_ECC_STS); > + fail_addr =3D readl(priv->regs + AST2700_ECC_FAIL_ADDR); > + > + /* clear only the ECC interrupts */ > + writel(int_sts & AST2700_INT_ECC, priv->regs + AST2700_INT_CLR); > + > + rec_cnt =3D FIELD_GET(AST2700_ECC_REC_CNT, ecc_sts); > + un_rec_cnt =3D FIELD_GET(AST2700_ECC_UNREC_CNT, ecc_sts); > + > + /* the register holds address bits [35:4], in units of 16 bytes */ > + addr =3D (phys_addr_t)fail_addr << 4; > + > + /* > + * Only the address of the latest failure is recorded, shared by both > + * error types. When both occurred, attribute it to the uncorrectable > + * errors and report the corrected ones without an address. > + */ > + if (un_rec_cnt) { > + count_un_rec(mci, un_rec_cnt, addr, true); > + count_rec(mci, rec_cnt, 0, false); > + } else if (rec_cnt) { > + count_rec(mci, rec_cnt, addr, true); [Severity: Medium] Can ast2700_irq_handler() double-count ECC errors or take a spurious re-entry when the other error type arrives between reading AST2700_INT_STS and AST2700_ECC_STS? AST2700_INT_CLR only clears the bits sampled earlier in int_sts, while both rec_cnt and un_rec_cnt from ecc_sts are reported unconditionally. Because config_irq() requests the IRQ with IRQF_TRIGGER_HIGH, an unacknowledged bit immediately re-triggers the handler: CPU0 () Memory controller ast2700_irq_handler() readl(AST2700_INT_STS) /* only recoverable bit set */ unrecoverable ECC error arrives sets unrecoverable bit & un_rec_cnt readl(AST2700_ECC_STS) /* sees rec_cnt & un_rec_cnt */ writel(int_sts & ..., INT_CLR) /* clears only recoverable */ count_un_rec() & count_rec() return IRQ_HANDLED ast2700_irq_handler() <-- re-enters, unrecoverable still set If AST2700_INT_CLR resets the recoverable and unrecoverable counters independently per bit, un_rec_cnt remains non-zero and is reported a second time; if the counters clear jointly or on read, the second entry is a spurious interrupt with zero counters. Either gate reporting of rec_cnt and un_rec_cnt on their respective int_sts bits, or include the corresponding clear bit in the AST2700_INT_CLR write whenever a counter read from ecc_sts is non-zero. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205-edac-v8-0-= 8a27981a6053@aspeedtech.com?part=3D9