From patchwork Wed May 7 21:43:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 888182 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76FF31C84CD; Wed, 7 May 2025 21:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746654246; cv=none; b=ZqmO/X/7PtS1HKtXtNETrdnjtnWdyoV6CyyNTr3ybGi5m/ygil2mGZWQj/2q6FaSaejp7sxG3REvBsd3MYQOsk1XMkyxzzdPi0G45eaza3cdb6LQBXfqnoz+HCQ4EEZaTNmUS3wmW5mabolGFDreOXv9XbNBAmt5mUyXjfTBwII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746654246; c=relaxed/simple; bh=HB64N7tbguqQ8EKDpmjwX/FJbgKt02pVEL/A3ACSTw0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=EyaW4VYFqhLTnybvtdsqyvDwN17gg0RpK7h17pb4Uh5jm0m5zkmYk0hT2n1ILCoGQb1lkPiGR4QyZ27ptIPW9w9vuJOa+pqP1id9SV2Ac+jiOkhjRy+iWi04tnYvkKvmal20VtmcxectZcoP3zaVpEZeM7SdWHl9BlN6DC1czGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Zt7xl217dz6L5Th; Thu, 8 May 2025 05:41:31 +0800 (CST) Received: from frapeml500007.china.huawei.com (unknown [7.182.85.172]) by mail.maildlp.com (Postfix) with ESMTPS id 8A22B1402F1; Thu, 8 May 2025 05:43:59 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.48.148.233) 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; Wed, 7 May 2025 23:43:58 +0200 From: To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v5 0/2] ACPI: Add support for ACPI RAS2 feature table Date: Wed, 7 May 2025 22:43:41 +0100 Message-ID: <20250507214344.709-1-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To frapeml500007.china.huawei.com (7.182.85.172) 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 ras.git: edac-for-next branch [2] merged with linux-pm.git [3] : linux-next branch. 1. https://lore.kernel.org/linux-cxl/20250212143654.1893-1-shiju.jose@huawei.com/ 2. https://web.git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git/log/?h=edac-for-next 3. https://web.git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/ Changes ======= 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 ACPICA 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. Not for merging. Corresponding changes are merged in the acpica: https://github.com/acpica/acpica/commit/2c8a38f747de9d977491a494faf0dfaf799b777b 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 | 76 ++++++ drivers/acpi/Kconfig | 11 + drivers/acpi/Makefile | 1 + drivers/acpi/bus.c | 3 + drivers/acpi/ras2.c | 451 +++++++++++++++++++++++++++++++++++ drivers/ras/Kconfig | 11 + drivers/ras/Makefile | 1 + drivers/ras/acpi_ras2.c | 406 +++++++++++++++++++++++++++++++ include/acpi/ras2.h | 70 ++++++ 9 files changed, 1030 insertions(+) create mode 100644 drivers/acpi/ras2.c create mode 100644 drivers/ras/acpi_ras2.c create mode 100644 include/acpi/ras2.h