From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 DFA1B606A31C for ; Mon, 30 Nov 2026 07:25:07 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4jdFsZ39Ckz2xlP; Mon, 30 Nov 2026 18:25:06 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796023506; cv=none; b=LptufWUS/4puwA5QHSCfGqI7FDFziwdHZ32TiaNF2GG+KlRIgoNzkawMoYueqEZ3ZuPj3eIbpsuJO1HUpRiyrBsIOoqU5d6PDCTax5mGqCr1pfPYzoDLCxRfj0g1k1PFJmOtuPUupXbJ9SKe5SmQXmVwG+Csu9PqS5jK8kry4mOLiNvVvqJWODIRAHgsjFP4kcUfrkPhyDWfxvaijkZNwlDu7o/WFr9c2fv3So7xy8EA/Y8mcgUjPgBHbKiA35Dow8E1HsQTIQp7kSSF/vvlWttDHiUh0PbtG6EmQIIjXecht7HC9kXKSLEKq2+E2QNg84DaXBTjOOkSVMb+yV4xPg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796023506; c=relaxed/relaxed; bh=VmmSuSVYJSeh4adKz2fzzTEMgHZr9AJj3Ft+2doK8/Q=; h=From:Subject:Date:Message-ID:MIME-Version:Content-Type:To:CC; b=Izs0blSMUrz+sdOwdAlQV0qiaKMEGSLmC3v9eRq/06zTcVrU875sWAnKmIS7wrsCFrvdM5GiGf995USTd9j97lgmLyTJLrEkgIlANk+HAdk8H7BMdU6dq+RKLQXWbeK76utIgD8L+uucFvtN+T5hQ0ltrPB4vjKCXYxTvVi3/fgA9+7tATiYfeAZyFbuSUNf/Jij0D/3QOBzi3flslSnOFew17QCJApng+oCt2efUdY8kthKCIVPFhIk4DtWcK7ew1jbA0W5FJ4VOGghmCM33FPpdYeiuUdPn4jIr19U/vBfX7gJui4K0/O7kX4YvxwmPsRdSH8iEcStrK/QlNtPEw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass (client-ip=211.20.114.72; helo=twmbx01.aspeedtech.com; envelope-from=ryan_chen@aspeedtech.com; receiver=lists.ozlabs.org) smtp.mailfrom=aspeedtech.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aspeedtech.com (client-ip=211.20.114.72; helo=twmbx01.aspeedtech.com; envelope-from=ryan_chen@aspeedtech.com; receiver=lists.ozlabs.org) Received: from twmbx01.aspeedtech.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4jdFsY0Y24z2xNT for ; Mon, 30 Nov 2026 18:25:04 +1100 (AEDT) Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Mon, 30 Nov 2026 15:24:46 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Mon, 30 Nov 2026 15:24:46 +0800 From: Ryan Chen Subject: [PATCH v7 00/10] Add Aspeed AST2700 SDRAM EDAC support Date: Mon, 30 Nov 2026 15:24:27 +0800 Message-ID: <20261130-edac-v7-0-3aaf6d243f07@aspeedtech.com> X-Mailing-List: linux-aspeed@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , Precedence: list X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAKskDWsC/23NTW7CMBCG4asgr3Flj/+76j2qLhzPmHgBQTGKW qHcvQ6kBYksv5Gf11dWaSxU2fvuykaaSi3DqQ2337HUx9OBeMG2GQiwwoLhhDFxT8EKEkAuO9a enkfK5fuW+fxquy/1Mow/t+okl+s94CXcA5PkggsVAhBShOA+Yj0T4YVS/5aGI1sqEzxJ0KuEJ pNH33U2KOPtplQPGaRdpWoSFAVCyB3msCn1k1RilXr5E8iAzYrQbUvzL6UQbpWmSZOUzMlg1il vSvuQUv5J22SE6LTrQiu8ynmefwH3/FtTvwEAAA== X-Change-ID: 20260625-edac-8e960e02e7f7 To: Stefan Schaeckeler , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Andrew Jeffery , Borislav Petkov , Tony Luck , Billy Tsai CC: , , , , , Ryan Chen X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796023486; l=6752; i=ryan_chen@aspeedtech.com; s=20251126; h=from:subject:message-id; bh=MS/3asCk6/vYmiTQJazJ0B6bBGehIZYfvnpbkv3VUJA=; b=8SVH4kTmQgx90iiMnOw7p8evng8RI2NeqyxTnooIaMI3RksURckL0/BLAH9HbkeY8+mH2gtgO cOiwcr71RkVBSBrl1SwEVAgmQFhKuiZYb2RmFIQ9scNyn/aN9GGrwgg X-Developer-Key: i=ryan_chen@aspeedtech.com; a=ed25519; pk=Xe73xY6tcnkuRjjbVAB/oU30KdB3FvG4nuJuILj7ZVc= X-Spam-Status: No, score=-21.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Add ECC error reporting for the Aspeed AST2700 to the aspeed_edac driver. The AST2700 memory controller reports ECC errors much like the older Aspeed chips, but its registers are laid out differently, it has separate registers to read, clear and mask its interrupts, and it uses DDR4 or DDR5 memory. This series is based on the edac-drivers-aspeed branch of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git, which already has v5 patches 1-5. Patches 1-3 prepare the driver: they drop the global variables and the regmap, and put the differences between chips in a table. Patch 4 stops unlocking the interrupt control register on the AST2600, which doesn't need it. Patches 5-8 prepare for the way the AST2700 handles interrupts and reports error addresses. Patch 9 adds the AST2700. Patch 10 is Stefan's step-down patch, changed to keep the entry with me as its reviewer. Claude, an AI coding assistant, was used in developing patches 1-9. It drafted parts of the code and of the commit messages. I reviewed every change and tested the series on AST2600 and AST2700 hardware; the results are below the --- line in patches 4 and 9. Signed-off-by: Ryan Chen --- Changes in v7: - Split the three driver patches of v6 into nine, one change each. - Patch 4 is new: v6 changed the AST2600 unlock as part of the chip table patch. - Patch 8 is new: v6 disabled the interrupts before requesting the line as part of the chip table and AST2700 patches. - Rewrite the commit messages in plain English and give only the reason for each change. - Move test results out of the commit messages to below the --- line. - Drop the aspeed_ prefix from the static functions. aspeed_probe() and aspeed_remove() keep theirs, like the probe and remove functions of the other EDAC drivers. - Link to v6: https://lore.kernel.org/r/20261117-edac-v6-0-a2a747b95c3f@aspeedtech.com Changes in v6: - Rebase onto the edac-drivers-aspeed branch of bp.git and drop the five v5 patches applied there (v5 patches 1-5). v5 patches 6-9 are now patches 1-4. - Patch 1: use a spinlock_t rather than a raw_spinlock_t for the register lock, as regmap did; the interrupt handler is not IRQF_NO_THREAD. Patches 2 and 3 follow. - Patch 1: drop the __guarded_by() annotations and the context analysis opt-in, and assign the register base in probe without taking the lock, so aspeed_probe() no longer mixes scoped_guard() with goto unwinding. - Link to v5: https://lore.kernel.org/r/20261007-edac-v5-0-5c31fc5df4cf@aspeedtech.com Changes in v5: - v5 patch 2: register the ECC interrupt with request_irq() instead of devm_request_irq() followed by an explicit free, and keep the interrupt number alongside the driver's other state so aspeed_remove() does not have to call platform_get_irq() again. - Link to v4: https://lore.kernel.org/r/20260930-edac-v4-0-c2e526f3ed79@aspeedtech.com Changes in v4: - Put the bug fixes first: the two fixes became v4 patches 1 and 2, the cleanups v4 patches 3 and 4, and the bindings patch moved to v4 patch 5 ahead of the AST2700 work. - Explain in v4 patch 1 where the grain value comes from, rather than the warning it silences. - Drop the Cc: stable tags from the two fixes. Neither meets the bar in Documentation/process/stable-kernel-rules.rst; the Fixes: tags stay. - Merge Stefan's step-down patch into v4 patch 9 (now patch 4), keeping the MAINTAINERS entry alive with a reviewer instead of removing it. - Link to v3: https://lore.kernel.org/r/20260916-edac-v3-0-23e9ed2fbdf9@aspeedtech.com Changes in v3: - Establish the AST2700 interrupt mask in the driver rather than deriving it from the register's contents: ast2700_set_irq() now writes the mask outright, masking every source and unmasking only the ECC ones, and the mask is established before the interrupt is requested. - New patch: add myself as a reviewer for the driver in MAINTAINERS. - Tested on an AST2600 with CONFIG_PROVE_LOCKING=y; injected correctable errors are reported from the interrupt handler with no lockdep reports. - Link to v2: https://lore.kernel.org/r/20260824-edac-v2-0-c8d8bb693586@aspeedtech.com Changes in v2: - New patch (v5 patch 2, now applied): free the ECC interrupt before the mem_ctl_info in aspeed_remove(). The interrupt is requested with devm_request_irq() and is only released after .remove() has returned, so edac_mc_free() could free the handler's context while the handler was still running on another CPU. - Acquire the register lock with the irqsave variant in init_csrows() and in aspeed_probe(). The interrupt handler takes the same lock in hardirq context. - Move the dev_dbg() of the interrupt status register out of the raw_spinlock critical section in the interrupt handler. - Opt aspeed_edac.o into context analysis in drivers/edac/Makefile. The check is opt-in per object, so without it the __guarded_by() annotation added by the same patch was never actually verified. - Return IRQ_NONE from ast2700_dramc_isr() when no ECC interrupt status bit is set; the handler clears only the ECC bits, so unconditionally claiming the interrupt could livelock the level-triggered line. - Tested v2 on both AST2600 and AST2700 by injecting a correctable error with the memory controller's ECC error injection; each is reported as a CE with the expected failure address. - Link to v1: https://lore.kernel.org/r/20260812-edac-v1-0-03992edea297@aspeedtech.com --- Ryan Chen (9): EDAC/aspeed: Stop keeping driver state in global variables EDAC/aspeed: Replace regmap with direct register access EDAC/aspeed: Put the differences between chips in a table EDAC/aspeed: Don't unlock the interrupt control register on AST2600 EDAC/aspeed: Let each chip provide its own interrupt handling EDAC/aspeed: Allow reporting an error without an address EDAC/aspeed: Allow error addresses above 4 GiB EDAC/aspeed: Disable interrupts before requesting the interrupt line EDAC/aspeed: Add AST2700 support Stefan M Schaeckeler (1): MAINTAINERS: Step down as Aspeed AST2500 EDAC driver maintainer CREDITS | 8 + .../bindings/edac/aspeed,ast2400-sdram-edac.yaml | 2 +- MAINTAINERS | 2 +- drivers/edac/aspeed_edac.c | 308 ++++++++++++++------- 4 files changed, 224 insertions(+), 96 deletions(-) --- base-commit: 65d0a904696bae7e99a2c6eef61d4df03bac025f change-id: 20260625-edac-8e960e02e7f7 Best regards, -- Ryan Chen