From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51AE0C71136 for ; Tue, 17 Jun 2025 16:14:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E34476B00B3; Tue, 17 Jun 2025 12:14:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E127A6B00B5; Tue, 17 Jun 2025 12:14:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D49736B00B7; Tue, 17 Jun 2025 12:14:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C55526B00B3 for ; Tue, 17 Jun 2025 12:14:49 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4D53380672 for ; Tue, 17 Jun 2025 16:14:49 +0000 (UTC) X-FDA: 83565391098.14.23D893F Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf02.hostedemail.com (Postfix) with ESMTP id 3D55580003 for ; Tue, 17 Jun 2025 16:14:47 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750176887; a=rsa-sha256; cv=none; b=2SsggCgnmOMON+JBSxik45BqVkhaXkYYNrm7vYSCIOyslWxVIP07n3+b021YsaEB3ny90Q fgtXkOxFTryACxDqBSyoNJBFfKlUef507njSIVlYdZ1bXnWXapHVAAHAjTxUfFTTEsp6k9 S6QVZ4eQi17Uwaa47HCu2EdJQTXtrl4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750176887; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=rXk88VWn0Y71ouUuxfpkno0PwuBk4q3GaB1NMoN76iY=; b=S8MLd3ZwO5kq7zppufxwVLpKjxxMzTEmQj28iYzn57Qk4+6grjTKRqG4F3Q7VWNOWC9u9U goH1y2oydCmqxERXAN0juaCHtX7m4sNQNhx7GHc99kxDqLFCr3kpXay2Ga45R2woiao1ui 6scqgCCCdF2lk6wlqt8iIJSBDk9duYs= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4bMBjF4JHPz6L5Vg; Wed, 18 Jun 2025 00:12:33 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 176261404C4; Wed, 18 Jun 2025 00:14:44 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.48.157.40) by frapeml500007.china.huawei.com (7.182.85.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 17 Jun 2025 18:14:42 +0200 From: To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v9 0/2] ACPI: Add support for ACPI RAS2 feature table Date: Tue, 17 Jun 2025 17:14:14 +0100 Message-ID: <20250617161417.1681-1-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.48.157.40] X-ClientProxiedBy: lhrpeml500009.china.huawei.com (7.191.174.84) To frapeml500007.china.huawei.com (7.182.85.172) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3D55580003 X-Stat-Signature: a1yd6wf3qmhuircoqrkh3j9fsozq8m5f X-Rspam-User: X-HE-Tag: 1750176886-316792 X-HE-Meta: U2FsdGVkX19onIqNKmgCu4wM0SO2b1oSut5NHlN5cexFwpZVeu4NtXDUZKPeuojd8SGsNxJjEHYAWJk95vcC+ExCBJOkhCCJcsGo+UMWqNhiT+9ox1to9E+L8CvBYifIgUbO4+6H6Zz4rGsY2cOm4dlftaL59UbAKxUqPYmXXSZZkdox2cCiZpmQJjk9ZxYj7gsg6Il18BMJu7coYLBJMaa7PwbAjaolcslyM3Vl/JuTh/jR3hgmQuqZs5RX+BqveezbxbfRBC7kjrn+lcpECOIslhnfGvGiTPaS1icFB8GurTXuHOB1sWgAlLNuRab+Io03Cdm+HNU3cgACTPioNjt6UASPD1x1bvy2Pac7mUOao/jPNrbGuTs9hNJdhqzFFioWUwPP9fgonyA7mCmJ0+BleOcJJ6OK5HqET35u6nCGUiwDJ1N0RP7JxnKKUgKpNoiQJPh8xe3okLt4G+JC8tC5CJcqrf3gNSYVNtonaGP1hke8xET+68q7j4ASxhIHkSeto6eNPzXeDKMLF7KNH1zD7+BJfUXjHuJW67S/ejzKq5q38OoRiCKR7tK3ETLSr53rNh7AwQHLUKYfWHKJhKO/xpFJtI8txWiVZrtlXT5gU9A5WnTbLgZFIF0qnpsNPimR8BwH9ElDRYTv6vSzLa7VrqDtyXm5ySp+D5AL1+sv27PDkCDJhGgRLY6IO8umYlqMBCXpz7wPpEqqk/nFeLUNqvblE17zcZvTcTKBp1BZxD1UvadED1ueS2UBccODx0i0ZEjce8YUztqBMaQ5P4mLJI5ck/IuLuk+4cHQ0xno/Ea/iULtstZemWaypG9/bXwEHbXBhqDifXmOg/TWCOJgdRZ15Z/3+hSDoec3lXmk5xLurmz2uvyXLQFIrNK0zfVxGhY4Ckey5wPTOjLgR4vNVVYOJAxc8P1NhfAkQ7eUxkJ9MwT03sfyk/LgOtQWLew2GM7uIjda48Dry66 KY8wZTPJ Ww+AaXtRGbFlmL+p64+hip0HF85k810r4YL8OQnhSo0hre8lbK8wd8qnw9kymmPhVVy0xTGxZcQBQbBUBilFOIoqGG2ZCO5HmsUkBys9INbrcjCoeaIVlgtMnEiwvpO5uJpiWEHRBS2OcCgQikmVRc7gqXtfhancZCYLpcn75GKke6Ulqo1MbStKH/1jZWoRLVmpIitCTlkxuJpjnMEGSLii8gBDvBmp/EzyDSb6v8azNKDXBphTDkUC96zfcWaCq4wPvEob8vXYv72NVfJQ8kNaszIWqIRJAwq5G6pfrfMtgq8wIGF3ho9FstlhSXb5X+6N3T7QjPpd7X4Lck1iLKEkiKuwR67K3Pi+B3jZSD6OhQkSaApqq3WKu5C+VP2jC9sMk X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Shiju Jose Add support for ACPI RAS2 feature table (RAS2) defined in the ACPI 6.5 specification, section 5.2.21 and RAS2 HW based memory scrubbing feature. ACPI RAS2 patches were part of the EDAC series [1]. The code is based on linux.git v6.16-rc2 [2]. 1. https://lore.kernel.org/linux-cxl/20250212143654.1893-1-shiju.jose@huawei.com/ 2. https://github.com/torvalds/linux.git Changes ======= v8 -> v9: 1. Added following changes for feedback from Yazen. 1.1 In ras2_check_pcc_chan(..) function - u32 variables moved to the same line. - Updated error log for readw_relaxed_poll_timeout() - Added error log for if (status & PCC_STATUS_ERROR), error condition. - Removed an impossible condition check. 1.2. Added guard for ras2_pc_list_lock in ras2_get_pcc_subspace(). 2. Rebased to linux.git v6.16-rc2 [2]. v7 -> v8: 1. Rebased to linux.git v6.16-rc1 [2]. v6 -> v7: 1. Fix for the issue reported by Daniel, In ras2_check_pcc_chan(), add read, clear and check RAS2 set_cap_status outside if (status & PCC_STATUS_ERROR) check. https://lore.kernel.org/all/51bcb52c-4132-4daf-8903-29b121c485a1@os.amperecomputing.com/ v5 -> v6: 1. Fix for the issue reported by Daniel, in start scrubbing with correct addr and size after firmware return INVALID DATA error for scrub request with invalid addr or size. https://lore.kernel.org/all/8cdf7885-31b3-4308-8a7c-f4e427486429@os.amperecomputing.com/ v4 -> v5: 1. Fix for the build warnings reported by kernel test robot. https://patchwork.kernel.org/project/linux-edac/patch/20250423163511.1412-3-shiju.jose@huawei.com/ 2. Removed patch "ACPI: ACPI 6.5: RAS2: Rename RAS2 table structure and field names" from the series as the patch was merged to linux-pm.git : branch linux-next 3. Rebased to ras.git: edac-for-next branch merged with linux-pm.git : linux-next branch. v3 -> v4: 1. Changes for feedbacks from Yazen on v3. https://lore.kernel.org/all/20250415210504.GA854098@yaz-khff2.amd.com/ v2 -> v3: 1. Rename RAS2 table structure and field names in include/acpi/actbl2.h limited to only necessary for RAS2 scrub feature. 2. Changes for feedbacks from Jonathan on v2. 3. Daniel reported a known behaviour: when readback 'size' attribute after setting in, returns 0 before starting scrubbing via 'addr' attribute. Changes added to fix this. 4. Daniel reported that firmware cannot update status of demand scrubbing via the 'Actual Address Range (OUTPUT)', thus add workaround in the kernel to update sysfs 'addr' attribute with the status of demand scrubbing. 5. Optimized logic in ras2_check_pcc_chan() function (patch - ACPI:RAS2: Add ACPI RAS2 driver). 6. Add PCC channel lock to struct ras2_pcc_subspace and change lock in ras2_mem_ctx as a pointer to pcc channel lock to make sure writing to PCC subspace shared memory is protected from race conditions. v1 -> v2: 1. Changes for feedbacks from Borislav. - Shorten ACPI RAS2 structures and variables names. - Shorten some of the other variables in the RAS2 drivers. - Fixed few CamelCases. 2. Changes for feedbacks from Yazen. - Added newline after number of '}' and return statements. - Changed return type for "ras2_add_aux_device() to 'int'. - Deleted a duplication of acpi_get_table("RAS2",...) in the ras2_acpi_parse_table(). - Add "FW_WARN" to few error logs in the ras2_acpi_parse_table(). - Rename ras2_acpi_init() to acpi_ras2_init() and modified to call acpi_ras2_init() function from the acpi_init(). - Moved scrub related variables from the struct ras2_mem_ctx from patch "ACPI:RAS2: Add ACPI RAS2 driver" to "ras: mem: Add memory ACPI RAS2 driver". Shiju Jose (2): ACPI:RAS2: Add ACPI RAS2 driver ras: mem: Add memory ACPI RAS2 driver Documentation/edac/scrub.rst | 73 ++++++ drivers/acpi/Kconfig | 11 + drivers/acpi/Makefile | 1 + drivers/acpi/bus.c | 3 + drivers/acpi/ras2.c | 450 +++++++++++++++++++++++++++++++++++ drivers/ras/Kconfig | 11 + drivers/ras/Makefile | 1 + drivers/ras/acpi_ras2.c | 424 +++++++++++++++++++++++++++++++++ include/acpi/ras2.h | 70 ++++++ 9 files changed, 1044 insertions(+) create mode 100644 drivers/acpi/ras2.c create mode 100644 drivers/ras/acpi_ras2.c create mode 100644 include/acpi/ras2.h -- 2.43.0