From patchwork Tue Nov 19 00:39:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879315 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2088.outbound.protection.outlook.com [40.107.212.88]) (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 6B43CDDD9; Tue, 19 Nov 2024 00:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; cv=fail; b=DXYEql0Y+L5yD4Q+j+42MexdXLmCsJjAt7wbcxxHCYi5t9c25PYVhL0XuMKiOjnoLy6zE0YcBRRJG8guGZuiuPiqqS5IsKxzX7jherNmNBZg95Xew4rdHcMVRVft2OA9Qkpiwmi3KaeDSRFzIuEHD07K/JE2/RTjpV9srXDHPTo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; c=relaxed/simple; bh=36yDoWeDM96SHaAGYVEkJGHm23x5D1rO96WYtImk3e8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rbYqjoL6MSvwEmvvmpTwqN8dQkh2xfXpE3yVFEB5Wyj/uotMs6luGlNWE1JFiZn5wR9KhZnAcUNxmFeMbgj5/k+yFSEmepeH3yyOVqHg5Kcd2rR56PYbAVrrb/2BGKwwuuztv9RhZM3mQY+J3qNHsKUEcCZL/V7JTR6wEC2SEk8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=BGZMeJM4; arc=fail smtp.client-ip=40.107.212.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="BGZMeJM4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PfbTStn3lC0Kf7lzQHUa3sgMzpOlL8l3VbBL6Z6kfyF0jmkPdeRPMwgtccHGfHT/pqmbBUKK2IIOlLkfFTOfcBuCOaAtgvyKJfYFOzM5hIc5xJes59f9cmovb6r7rKws8Vj8+qAii/PCZ6GcmZ+2Az+AO9UEmf7DWh9nBi37DxH9yF2ZL9QR67u3ODczQ7zPz6sboA9YrfX/RTGsHgsVPmfC5NaLpZSRe1qbSrZHGv6NqZa7820NdINTb++8/NPj2Q+dEvpPlGNYute6mZ8vW5aFpFVdvDkGoHBUcLx5TxXmhTGM/bJnnC8xE/bTNV9LueOA+EM1ZEwXS5dEsYmCxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tSf1xRYBSF4bsCI076/XpD5Wes1OgImzDLxY1bYM0g8=; b=IEgANRUCLGwT5AHeGZ6c+BEGF8ETks2cGS42iVCfOOntqzIcQSQmXNNIUWukK7Dv3/1bQM8JArKLgVf/8Dv/0kqyU5Dj7UNdmAh8tGJQQVHaAMFH7pM9yhRt5uW7unAivgLFQLZFzibxFDWI+uGWhxHsGJ+MbP5PsN6CJsaw335t9L0ztwicPsFPwS8sNrarjhALvORZbETtqMRD9GNBq5Ur0ohXKPNa7poD8D7ncrnTG/JQDcDdWeknWuwl5RKutRURgfFNOQ67Kx6BiGvhbjvE9DSYZ8aeaQoif+861ft94pcBanzvDKCbpgPcwoxrXWVbunr5tw9TlTX06tvG+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tSf1xRYBSF4bsCI076/XpD5Wes1OgImzDLxY1bYM0g8=; b=BGZMeJM4Mx4sbhiUhh+FWQbuLAsjfxcZAYa/GyoJ2J87DTTZg5Tey47oljBp7v6na/yRXpou6+WW8WaMPGA0+8HaxNSwZV+7Zb/OAkkw4Pe8MiaZ7s8ViUcPRUkPftd+nJbjtifMOb+DviKXx/hWhq8YlgdmxmfboDU6ooSAYRU= Received: from DM6PR10CA0018.namprd10.prod.outlook.com (2603:10b6:5:60::31) by PH7PR12MB9103.namprd12.prod.outlook.com (2603:10b6:510:2f5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.21; Tue, 19 Nov 2024 00:39:27 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::13) by DM6PR10CA0018.outlook.office365.com (2603:10b6:5:60::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24 via Frontend Transport; Tue, 19 Nov 2024 00:39:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:26 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:25 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 1/7] efi/cper, cxl: Prefix protocol error struct and function names with cxl_ Date: Tue, 19 Nov 2024 00:39:09 +0000 Message-ID: <20241119003915.174386-2-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|PH7PR12MB9103:EE_ X-MS-Office365-Filtering-Correlation-Id: 23c2dff0-7c5d-4006-934d-08dd08329f24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: zjun3qKuMrySWg7F/Grw6qbWdrq3xta80OX/hxQeRX8MBLAMJ65Vx2AH4js0SdFjDZ1KxrMl+aY0PG1Ko1eSm7fz7tV72gAULD8nCpfs1oB7jcvBTrcfQqWNH4hZQp8obOcej9xl2G3WDbVWnpVJUW3oHMEUY5oc7Ft3C8XSb34YnUxT5QSl5XgkpG8+Hnc0rzWByM2g/SkKOjB6ZuTEcQsAfIHfUvrn0jOUKkjsPIYcTMuM/vEFiq241ECyo6rh3nN6A6VmhpcbEpgDnfqbe7eipD1bAQ6R4l5HMt5p2rsfGmqvBJP2JDTOvjy5T7wfTdu7hs9eA6HRYCSZXOCD1xCLx75GblzBacjO/ju1TCuuSSR/rgW1c6+kXO2Ra6kM/Hz6x4rqvCHdueyRlv2bCpnGlaAkrZ6chepzVY8WBsOB715fuLqcXM8Iu+xrJSCCbg94l+dPE5OqIvFDh0+K01tvWvLy6flkiKEXXNBYT8yMzkcoy3MGqM4xhpdyx1ny/QMIUd4Y16kap06QRJY8CbLgVo15Lu7lZOusn/HVC65m8kbnmocziONLs7v8bK1wk1c+N2qG9hGJH+txeF0EiB9H9YpOO79JBM0FrZC261mlckhlxLRaDO4TKKYs6uEiEE0nkrD57UVp0nPofyp6woaBvdcVo0PK4AVqZkk0vlGnF1jtSZQmHKKM+K48bV+/B11m+SG64wmkcvT4n0uXxD4y3fLWSCpfQLRgGgTXSmD3A08+HbzJqIomG95YYjxXoC4ybdGB/PnTDTCigCSlHcBb2CSn7KZ1GZZQqCN8wbhkjCxevkrGjsjmIDLghibWFHHBvOiyVZCsMLyP87zgusNQUMHCasXekRHo2JypuXg0Vhr4Wsnioh6GU8NZnS788z/OOychRopZoEoHCyJx/s2/Qd03OwK9Y4XuZKlZ5chtkVbTG4XC+zIwRJHevy4Bx67zhhQXiCr1LTjD7kH3FoGkayXylDUv9SX3Q134b+hVmlVj9uc+HnMLVlOdIqoHTn177Y9i8HvGt2NyyVkipGr8eUF+9YxIIWtX9IEc+bpTygjnxeXX6At11kECwJljEmF8JObRsb0S2/phlvStZCfpVifldls9pCog0OO29uxq3XXFaD3MIqxXd0UhPFP0SSf5xFjVf4LJfux44Zm4LaUFSxdSFnT94bh2frP0VyANSWc1AAOAb+I0/RTI/3kwsNHms+NPIBBUuOxmk7a3Oo4fmjRqp5Yn6ljrXnq6ZXoC79mzdoEPJzIua2qud0pTaOuPlVaHnmipSvFAH8fVlHKl6xkK+nsliR2j4ig2fR3gENhaFSklKoBnfJjpKVYBonHm3UoWT3q07z8VRcWVrpQsTM3umUF6foPqu4DSZXZeEOH0SWea4eT2zFhxde6OoAoozZW36FvVEiNdqeUg8g== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:26.6902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23c2dff0-7c5d-4006-934d-08dd08329f24 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9103 Rename the protocol error struct from struct cper_sec_prot_err to struct cxl_cper_sec_prot_err and cper_print_prot_err() to cxl_cper_print_prot_err() to maintain naming consistency. No functional changes. Signed-off-by: Smita Koralahalli --- drivers/firmware/efi/cper.c | 4 ++-- drivers/firmware/efi/cper_cxl.c | 3 ++- drivers/firmware/efi/cper_cxl.h | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index b69e68ef3f02..8e5762f7ef2e 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -624,11 +624,11 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata else goto err_section_too_small; } else if (guid_equal(sec_type, &CPER_SEC_CXL_PROT_ERR)) { - struct cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata); + struct cxl_cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata); printk("%ssection_type: CXL Protocol Error\n", newpfx); if (gdata->error_data_length >= sizeof(*prot_err)) - cper_print_prot_err(newpfx, prot_err); + cxl_cper_print_prot_err(newpfx, prot_err); else goto err_section_too_small; } else { diff --git a/drivers/firmware/efi/cper_cxl.c b/drivers/firmware/efi/cper_cxl.c index a55771b99a97..cbaabcb7382d 100644 --- a/drivers/firmware/efi/cper_cxl.c +++ b/drivers/firmware/efi/cper_cxl.c @@ -55,7 +55,8 @@ enum { USP, /* CXL Upstream Switch Port */ }; -void cper_print_prot_err(const char *pfx, const struct cper_sec_prot_err *prot_err) +void cxl_cper_print_prot_err(const char *pfx, + const struct cxl_cper_sec_prot_err *prot_err) { if (prot_err->valid_bits & PROT_ERR_VALID_AGENT_TYPE) pr_info("%s agent_type: %d, %s\n", pfx, prot_err->agent_type, diff --git a/drivers/firmware/efi/cper_cxl.h b/drivers/firmware/efi/cper_cxl.h index 86bfcf7909ec..0e3ab0ba17c3 100644 --- a/drivers/firmware/efi/cper_cxl.h +++ b/drivers/firmware/efi/cper_cxl.h @@ -18,7 +18,7 @@ #pragma pack(1) /* Compute Express Link Protocol Error Section, UEFI v2.10 sec N.2.13 */ -struct cper_sec_prot_err { +struct cxl_cper_sec_prot_err { u64 valid_bits; u8 agent_type; u8 reserved[7]; @@ -61,6 +61,7 @@ struct cper_sec_prot_err { #pragma pack() -void cper_print_prot_err(const char *pfx, const struct cper_sec_prot_err *prot_err); +void cxl_cper_print_prot_err(const char *pfx, + const struct cxl_cper_sec_prot_err *prot_err); #endif //__CPER_CXL_ From patchwork Tue Nov 19 00:39:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879314 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) (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 44239C149; Tue, 19 Nov 2024 00:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; cv=fail; b=jK/QlnOZiD0sJJ+9NJ/YpTXeUMxrqBqWZJ2gt6pOJ/UPH+eiRdUkZl9NdDoqWO72eWwe7V060SMc9qL9+gkN+TenXVVguxF/sxer9ydW/CpRle6GPatimW+74Dr868At787Jaf7cFbGO+fEK9eh9bqJGGk+3M2aouDtD75CXC5I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; c=relaxed/simple; bh=vGL8Unq2WkkBe9SugJeT0WtmOcmHhU+7i9quqLuUnSs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C3CKT6hnhbozLYOlPScG/TGpE3TMUNASJFvqseKUG4j/zZc0auY5aGtpHfPD2Dj1dR/ABdkL4nsvKZsPjuLtAemf3X9FAweYfC2cep/LbFvOWCWidsQ/LSXqQodZn/EoTUgTry1d9nrwe7LJWnhWZNI7hVGrHgHdetRjB3W9jko= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=tK8fMg8e; arc=fail smtp.client-ip=40.107.93.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tK8fMg8e" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b9Dg7+0iwbrDBt7ONXTADPzRzbmAXNed6PTarab/YggPlkf1cNKWzvczWU119LT5c1ufAfHtnCxpkSPeskm0nBheALn82iPHMAHXGvw9BlLfp5fKoKBKG3cq6n//xUvFf61h+OdCF8obaXQL/yRjMBTGRCXWicT4cf3q3FkMTZB9aCjBEIZDJLmTtaWG/mH4DPrfZYexNGvlgN9Vb39RVXNho7Ydq//4nfm8Shz8LiQ5JGgnnYxU+n2uX9i/wSdVXJD5Ex0/wIMbpmhJjXdDFxnMLO5lBME0oDIhYhNzEGskFhMs8c4SjVGQWjnWw/mqe5YBhU0wHa4PFpptzSu0qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iz3k6pUc/wF6Zqc5xdthELnrH+BhypjgxrsMEVJVLU0=; b=I+yto12+Yk6FXRKxhy9c/F2Ac1aeQK/uHHsJ+z9GDrwm6H6xifUVQjMoqRRmVTqWe3YVuXRCEtaDpf0QZL83B9nOKxb+qkDAXi173jRELm0LvduKrL9FJsrStmdXK4LbY+l11i6SzDQRpMe2vitsUfYNkzRjbb2ehGpHsAh4o+7zcaZ7J5L6RbAe4NE72xlRAinZk8/YaVZxXTMRinGMxFUaF9N7JGGyIGO/VQs5l/Uuyf0B3bzm3DxQbdMbEkpWZ8hi5api31kkQ4aUynWKHGAl7ZaunidfPHq7QcFB/CnRWZFASz9W8bqugKhoeIqZtxx9QaDG6BC8Oa2D1Ugyuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iz3k6pUc/wF6Zqc5xdthELnrH+BhypjgxrsMEVJVLU0=; b=tK8fMg8e7B3hsOXtkZcHSIbcN9oM9RRNSd/qhDOlpusD3kMdOR+gzyaUa8g1+Ccz/3JrciGe3NhRb/NBY9LkhzuAvCT1ltWhIDdpAaEKlUPMIUgNqDbUdYw6jj4mNOZweF/O7ebf8D4FXFbkSGOlFs/Nr9CQhAaHfMv0cvILbbc= Received: from DM6PR10CA0022.namprd10.prod.outlook.com (2603:10b6:5:60::35) by SJ2PR12MB8977.namprd12.prod.outlook.com (2603:10b6:a03:539::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 00:39:28 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::e2) by DM6PR10CA0022.outlook.office365.com (2603:10b6:5:60::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23 via Frontend Transport; Tue, 19 Nov 2024 00:39:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:27 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:25 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 2/7] efi/cper, cxl: Make definitions and structures global Date: Tue, 19 Nov 2024 00:39:10 +0000 Message-ID: <20241119003915.174386-3-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|SJ2PR12MB8977:EE_ X-MS-Office365-Filtering-Correlation-Id: 35124d49-8458-4d66-db29-08dd08329fae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: Kjgu7a2JY1VtzkT3k7R73nOthmpuO+Apg7NdtiCm4+sp9rDWAM6wwyJngUKXokUxzLXDA30i5PKZh44bcNdCZaS2NL0YDACE4lLST2BKCHmdhlh68eEEFVAkN5n8zTm9paTe09zHGaigljJce/b8O/223sAmzzNbmSDEu9M3kqsQQeus30s9xeKn+AJJcf2t0Ghp2I1vZRPI9TAdQ6afWXlTFkG/ZDagGRe2HE7+Vzrq0+7rafnwE2PCtN3HFSH9kXPFEzjyHgN4kK4Rfef5ROdYelqakZh604gcdrb8qIK5n9vq/hFg7C85YgurDMmG3jcI6i/+BhM2sGnkzIXEFjA+c6IXxCn0eIuHwbP/2dMImg82Lfq5xgrDFRx/gSrT3BZiEjEWwFcJoNQeuUI2QP9538qODWDc1R0lnIaSZB0ItGgZPFtEg43RBy82KcE1Rz7TlZk2+T+Tb6VjiIsAMTpMGCl+PzGVugfdoTsbGNAzAPd56GT5tbJ6I2JMVPpK5kvl3U04rAPE2xzvnGCKyyNSII0YHUGb2AtRcxlBHwZ99PyfrFpXYO92h0o+l04S+2UPREtkyxpCLrAYEPMIVkCVVhDXlZVZGj4VFMtr06GYQ1mozTv++BOJBXAzgT4hangYhdX0Mf9ucb2QB7cK8OB6EaXcH9HUcpAUrRyyhiwaLg1jjw2PSotPalb9ZWgs6ABDJc4/GlFcSOh+f5ph0Ho3T6k4RoC0+XWz/WsgrELyigv3l8XUFe8JMJKvt+9GWtkpd8hWpUmqex4Uxfb5fWhNsY6Vv0ZcSEOGzf+NUg+wH3Onfw4qSNYY7uu0lae7OiOls9Anx/aYV87buKHmoZZ2UQjgW2PPQO5VP1mUqoRMQFxLmaPIcf5BE+HJavXlVkrzKjUaMsLOSBrfY+2MNoRkhlLLpA3+oX2i679e7q7a+/zNLxiNe0+a+E/wfDutLBI4qF0Lpx0bYsQYvk8TqbRpSsOhkRAVLwEecsVukUTgVv7jApe7kHrzbA+8I1Y300afnXM/mRdxliZFscsnTQ8XGLhr7tak+s7X0OIwiL9rDmxdsnTeoGue00oUA9zRbZgIbKRNZaq6F4Uo1ycK9V5BmWrBi6ojb9/DSya5lg3O4Zzim/2NyjwfYejEPmax7N5Mh9b+c3/gjV5PdlaoytWF1I2e3Gy/ZmxF84LjM/XgAWGkmIgV3e0Dz2s5r88EPrObd5SpC7CjUvQvC59+vTist2saIo37fbDox76fMw/W77tOMVaYUnJCiSiC83+R4yqzTnjWCavzGjQn3hiGpzkEWr1II414ELc5zx3MIB1rsDQyZnhzrH7lYg86rzG2ZlswJ1AepXFh1vuTRTrYUsi2TEtyWK6OblVakVfH7aM8Eh80W82JhsRakW4XO/G9dfKnm5XeV1kSJXLzAZKuCg== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:27.5808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35124d49-8458-4d66-db29-08dd08329fae X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8977 In preparation to add tracepoint support, move protocol error UUID definition to a common location, Also, make struct CXL RAS capability, cxl_cper_sec_prot_err and CPER validation flags global for use across different modules. Signed-off-by: Smita Koralahalli --- drivers/firmware/efi/cper.c | 1 + drivers/firmware/efi/cper_cxl.c | 35 +-------------- drivers/firmware/efi/cper_cxl.h | 51 --------------------- include/cxl/event.h | 80 +++++++++++++++++++++++++++++++++ include/linux/cper.h | 4 ++ 5 files changed, 86 insertions(+), 85 deletions(-) diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index 8e5762f7ef2e..ae1953e2b214 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "cper_cxl.h" /* diff --git a/drivers/firmware/efi/cper_cxl.c b/drivers/firmware/efi/cper_cxl.c index cbaabcb7382d..64c0dd27be6e 100644 --- a/drivers/firmware/efi/cper_cxl.c +++ b/drivers/firmware/efi/cper_cxl.c @@ -8,27 +8,9 @@ */ #include +#include #include "cper_cxl.h" -#define PROT_ERR_VALID_AGENT_TYPE BIT_ULL(0) -#define PROT_ERR_VALID_AGENT_ADDRESS BIT_ULL(1) -#define PROT_ERR_VALID_DEVICE_ID BIT_ULL(2) -#define PROT_ERR_VALID_SERIAL_NUMBER BIT_ULL(3) -#define PROT_ERR_VALID_CAPABILITY BIT_ULL(4) -#define PROT_ERR_VALID_DVSEC BIT_ULL(5) -#define PROT_ERR_VALID_ERROR_LOG BIT_ULL(6) - -/* CXL RAS Capability Structure, CXL v3.0 sec 8.2.4.16 */ -struct cxl_ras_capability_regs { - u32 uncor_status; - u32 uncor_mask; - u32 uncor_severity; - u32 cor_status; - u32 cor_mask; - u32 cap_control; - u32 header_log[16]; -}; - static const char * const prot_err_agent_type_strs[] = { "Restricted CXL Device", "Restricted CXL Host Downstream Port", @@ -40,21 +22,6 @@ static const char * const prot_err_agent_type_strs[] = { "CXL Upstream Switch Port", }; -/* - * The layout of the enumeration and the values matches CXL Agent Type - * field in the UEFI 2.10 Section N.2.13, - */ -enum { - RCD, /* Restricted CXL Device */ - RCH_DP, /* Restricted CXL Host Downstream Port */ - DEVICE, /* CXL Device */ - LD, /* CXL Logical Device */ - FMLD, /* CXL Fabric Manager managed Logical Device */ - RP, /* CXL Root Port */ - DSP, /* CXL Downstream Switch Port */ - USP, /* CXL Upstream Switch Port */ -}; - void cxl_cper_print_prot_err(const char *pfx, const struct cxl_cper_sec_prot_err *prot_err) { diff --git a/drivers/firmware/efi/cper_cxl.h b/drivers/firmware/efi/cper_cxl.h index 0e3ab0ba17c3..5ce1401ee17a 100644 --- a/drivers/firmware/efi/cper_cxl.h +++ b/drivers/firmware/efi/cper_cxl.h @@ -10,57 +10,6 @@ #ifndef LINUX_CPER_CXL_H #define LINUX_CPER_CXL_H -/* CXL Protocol Error Section */ -#define CPER_SEC_CXL_PROT_ERR \ - GUID_INIT(0x80B9EFB4, 0x52B5, 0x4DE3, 0xA7, 0x77, 0x68, 0x78, \ - 0x4B, 0x77, 0x10, 0x48) - -#pragma pack(1) - -/* Compute Express Link Protocol Error Section, UEFI v2.10 sec N.2.13 */ -struct cxl_cper_sec_prot_err { - u64 valid_bits; - u8 agent_type; - u8 reserved[7]; - - /* - * Except for RCH Downstream Port, all the remaining CXL Agent - * types are uniquely identified by the PCIe compatible SBDF number. - */ - union { - u64 rcrb_base_addr; - struct { - u8 function; - u8 device; - u8 bus; - u16 segment; - u8 reserved_1[3]; - }; - } agent_addr; - - struct { - u16 vendor_id; - u16 device_id; - u16 subsystem_vendor_id; - u16 subsystem_id; - u8 class_code[2]; - u16 slot; - u8 reserved_1[4]; - } device_id; - - struct { - u32 lower_dw; - u32 upper_dw; - } dev_serial_num; - - u8 capability[60]; - u16 dvsec_len; - u16 err_len; - u8 reserved_2[4]; -}; - -#pragma pack() - void cxl_cper_print_prot_err(const char *pfx, const struct cxl_cper_sec_prot_err *prot_err); diff --git a/include/cxl/event.h b/include/cxl/event.h index 0bea1afbd747..66d85fc87701 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -152,6 +152,86 @@ struct cxl_cper_work_data { struct cxl_cper_event_rec rec; }; +#define PROT_ERR_VALID_AGENT_TYPE BIT_ULL(0) +#define PROT_ERR_VALID_AGENT_ADDRESS BIT_ULL(1) +#define PROT_ERR_VALID_DEVICE_ID BIT_ULL(2) +#define PROT_ERR_VALID_SERIAL_NUMBER BIT_ULL(3) +#define PROT_ERR_VALID_CAPABILITY BIT_ULL(4) +#define PROT_ERR_VALID_DVSEC BIT_ULL(5) +#define PROT_ERR_VALID_ERROR_LOG BIT_ULL(6) + +/* + * The layout of the enumeration and the values matches CXL Agent Type + * field in the UEFI 2.10 Section N.2.13, + */ +enum { + RCD, /* Restricted CXL Device */ + RCH_DP, /* Restricted CXL Host Downstream Port */ + DEVICE, /* CXL Device */ + LD, /* CXL Logical Device */ + FMLD, /* CXL Fabric Manager managed Logical Device */ + RP, /* CXL Root Port */ + DSP, /* CXL Downstream Switch Port */ + USP, /* CXL Upstream Switch Port */ +}; + +#pragma pack(1) + +/* Compute Express Link Protocol Error Section, UEFI v2.10 sec N.2.13 */ +struct cxl_cper_sec_prot_err { + u64 valid_bits; + u8 agent_type; + u8 reserved[7]; + + /* + * Except for RCH Downstream Port, all the remaining CXL Agent + * types are uniquely identified by the PCIe compatible SBDF number. + */ + union { + u64 rcrb_base_addr; + struct { + u8 function; + u8 device; + u8 bus; + u16 segment; + u8 reserved_1[3]; + }; + } agent_addr; + + struct { + u16 vendor_id; + u16 device_id; + u16 subsystem_vendor_id; + u16 subsystem_id; + u8 class_code[2]; + u16 slot; + u8 reserved_1[4]; + } device_id; + + struct { + u32 lower_dw; + u32 upper_dw; + } dev_serial_num; + + u8 capability[60]; + u16 dvsec_len; + u16 err_len; + u8 reserved_2[4]; +}; + +#pragma pack() + +/* CXL RAS Capability Structure, CXL v3.0 sec 8.2.4.16 */ +struct cxl_ras_capability_regs { + u32 uncor_status; + u32 uncor_mask; + u32 uncor_severity; + u32 cor_status; + u32 cor_mask; + u32 cap_control; + u32 header_log[16]; +}; + #ifdef CONFIG_ACPI_APEI_GHES int cxl_cper_register_work(struct work_struct *work); int cxl_cper_unregister_work(struct work_struct *work); diff --git a/include/linux/cper.h b/include/linux/cper.h index 265b0f8fc0b3..5c6d4d5b9975 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -89,6 +89,10 @@ enum { #define CPER_NOTIFY_DMAR \ GUID_INIT(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \ 0x72, 0x2D, 0xEB, 0x41) +/* CXL Protocol Error Section */ +#define CPER_SEC_CXL_PROT_ERR \ + GUID_INIT(0x80B9EFB4, 0x52B5, 0x4DE3, 0xA7, 0x77, 0x68, 0x78, \ + 0x4B, 0x77, 0x10, 0x48) /* CXL Event record UUIDs are formatted as GUIDs and reported in section type */ /* From patchwork Tue Nov 19 00:39:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879316 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) (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 AFDF71B813; Tue, 19 Nov 2024 00:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; cv=fail; b=OmK9m556RXOiwWFoXRkSU1RIQ8Ji+P2h8uJrzV3a90AOwOEjDMfz2HlwfYMBlBuS6PNG5rKRxvXHzZC5Bnl9p3Se31c3muxe3/fdwEgM9yJx3EG4T4qs8gyNqgmYNY79XiSjuKTwr90nnzZSs/NQXCqdup6M48r6bGiIdD8aQ/4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; c=relaxed/simple; bh=vM3eYy/Z+VEBWavkbs8ERQvH8ZeVd1hob6BD4BlWXXQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gxt36tLhi/+gE/RgRoDDNrCl+JRz0gAjOZrbNjPT9r/90lvhEN0fWRQ3N6GZ/MMs8/B5LkAXQNU75tuSycTWgdjFs0huBLENwJWM8LQokn1446i9q79c2K7AtWC0T7VK7s91XMvafi6cHRz7gybZKEFBVCy0ftMVfFHO2eCInZE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=FlT0VjI/; arc=fail smtp.client-ip=40.107.92.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="FlT0VjI/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wc0Hql0RhiSF88zVJc2T46VRywVcCtyUGQr3dkiuLNnrX8DkXXKLdHdLOIQgQ091LlCo8JBVW82xKY9O9f4dOukP8MYv5csdz9ksRkrA1Pw1wT/urt+/wv56PrnZP9JDKY5r/SWSiesCqrOntMj0jUnVZEiHMFbmFqj9phMDlDTWQnNUeeWi/gzINNYGvxPXsU/x64iktjX2+ww0sC0uNE5kPJDlrsM5sh6dL/Te5Mpq8Vs80J243gQlhtRzdHhkIQUjO2ri6x43GBzGK6YDaJxZzSqTmlwF4qeG3NykFmW0IBlms66GvGENSLH2lTM94QZwTaBMx/4DIeY8SAIufw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=65M8XrTr6xsyMeIaVWniIJ0CrgkrKpX/DF8w8B0PeuE=; b=kp0jK2NFD9QhU+7I40kSdx4/6M1ILf7GVwAE2Uevj5i+rVYKZqMef3zA+EVWKzsM/uIBmsVLXNouoUR/43+qffr/pCMBmDn1FkiGpw7qtKFcrBs+T3toKfsWMLpHIxM/vg4nWrhuXJ4Aj7KblF7RaY4ONg4UfFvGjwhBNR6VW3B29OppoOlMmAGYaCIswDi++gjB6gCbRh5edZJoQJZRAccUhLt2fdViGsAhLbZHAucNP2pENicLKYMEbhjnw17docsFJ0X/aiDLZ8+h018oThSd9n2XpjcLVRxfCuU/VihsvePMaRSCBbsYUxragvVi5BvulQ102pVe5GjVrQBxpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=65M8XrTr6xsyMeIaVWniIJ0CrgkrKpX/DF8w8B0PeuE=; b=FlT0VjI/85KCiYRnwsZWPwpl7lPRg6UD7aCio1WTFdh2gzLgCyxdxLNxQjBQPXOoNKiSdWXMa1O9AOzG1rRerS5492Ie/td9BVy1od8NubXYjN2De/YiWrP+qrsMS4avEXwfhmRaUj1OSj5N0jqAxcjNNQvF9NIr8h27S3YiWIs= Received: from DM6PR10CA0033.namprd10.prod.outlook.com (2603:10b6:5:60::46) by SA3PR12MB8763.namprd12.prod.outlook.com (2603:10b6:806:312::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 00:39:28 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::13) by DM6PR10CA0033.outlook.office365.com (2603:10b6:5:60::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22 via Frontend Transport; Tue, 19 Nov 2024 00:39:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:28 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:26 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 3/7] efi/cper, cxl: Remove cper_cxl.h Date: Tue, 19 Nov 2024 00:39:11 +0000 Message-ID: <20241119003915.174386-4-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|SA3PR12MB8763:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f2c1f74-866e-4b8d-d4f3-08dd0832a02a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: OE8f6zsXRTsXVSCdHhCSyeyZa1sMu/TeR4s1avEGB++HWt6RWnmDSytj/7OIUL5GdX6WzXGNgQ7Yagq4FMNmqGFSFlINzUaKPOyKzGPQNUW0s4vtO3/gucH6E0Kn5jGtKHQwbUn8VxjH+WkGrHBg0OlcgI7OYRZ+urhqbUpF/+OYf/W9lqo7YK0Lc0wQnDV7ay0H/yEwzG/QmpWNUkqEKuYds1XhPc97AL5wP4ebZn5hW+O5MBIYkeZyrIcroDvGPtGHrGwc0flGBKbpQowNVgUC7iQjX7fKZWc+BzxATerSB/RqLvLXldbtFeSN/NWZhJxjR89/QSCe/Za86/v/MI5rDCS93Pi7oZtnhUiez/RnIkZjasVJ+NlRdhp2zJ/98rEK5qw0W6D8bWp2pTMO3ignms5kv4VZpYaylCXXajIvFA0e4x1F3rOm6KgIgsT03+4Meq/l1sQcIRSxozj/KaLQqIt+TA3MFqb8DnxE9JU6dKVrcg8GxK3Fbl/rOIpsLKnCc8/v5yX+5/knz7VJBvMBf1p8lLS1b39A+PupN0hEikk06cKABwWjHPlEeo9zZqREOnJO4Xg4jsnPzZZRoR7LljqmEkCQ/e6nqce1GoL8XJcOjOuM8VcBKUe3osM5rK881w/74poFYSImyvDRG7sEKcISXBVfh7ZfFZa6XKgtjqkkB9OrSGR1BJ7EHR1dArOLF8z5X8B3USBo7+bFZIVw3c4EoYmf655D7Hh+m9PcAeRR9OmeXiVY4YdJq09JnamT22kuE+tQ5S5W630LmsVdXWKrG6bGHklAD9pWZXCV13zOhpB518riqi8yASSl+mLFDYhf6g1HrewMaRN7HVj7ye/Kt26EToz4Q/Jtb6xmz6/jbEz84vjjmKK656WI6wwnZcjM70Ewlt3sJ03oO4mdgx/o7ysaWRKDhjowVMjg1+Gw/TQH2CuOOcI2p61+QvVyIrqb57HrrbP+RlZHXOcPWZy4uR31q/F7VkOCSqPcSUbtwM59VrAXFtkiprhmkGOASCAXbHf23pCG415JhCl8W3JbcpUrixfZblxFnjvifQTU7cXyI6d3gXCCi60hdOJ/s8ekdFZ8svuMV3O1dGFihiFauPcE8I6szHRNOVg9+H05ISPnipGc/1HFCD9xwWSc7B5LbMvHDqa3gKQuntz/H0nIJEabhyNGoND22sIdqGHOcCk22HW4+SDuhEQHLCpvU4mZ1J7aqdCOPQXG8dtFH9X5PHMK9ef59Y2AwAL9+8Q9VNdq+XQAwh3XN7XciSS/cIbxLRYi77hj/YpwLfcxak1neioX9rZkeWpliMQkQFUtwZSQk34Rv8M6hh52XBb4QvY3TNnc7jQu7TtGYTLEiS+EcfODozNPa82Re16dYAddikbk5o48wC7I4XqCHx+HU23RjSKI6iyEF2a0Yg== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:28.4089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f2c1f74-866e-4b8d-d4f3-08dd0832a02a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8763 Move the declaration of cxl_cper_print_prot_err() to include/linux/cper.h to avoid maintaining a separate header file just for this function declaration. Remove drivers/firmware/efi/cper_cxl.h as its contents have been reorganized. Eliminate its corresponding #include directives from source files that previously included it, since the header file has been removed. No functional changes. Signed-off-by: Smita Koralahalli --- drivers/firmware/efi/cper.c | 1 - drivers/firmware/efi/cper_cxl.c | 1 - drivers/firmware/efi/cper_cxl.h | 16 ---------------- include/linux/cper.h | 4 ++++ 4 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 drivers/firmware/efi/cper_cxl.h diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index ae1953e2b214..928409199a1a 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -25,7 +25,6 @@ #include #include #include -#include "cper_cxl.h" /* * CPER record ID need to be unique even after reboot, because record diff --git a/drivers/firmware/efi/cper_cxl.c b/drivers/firmware/efi/cper_cxl.c index 64c0dd27be6e..8a7667faf953 100644 --- a/drivers/firmware/efi/cper_cxl.c +++ b/drivers/firmware/efi/cper_cxl.c @@ -9,7 +9,6 @@ #include #include -#include "cper_cxl.h" static const char * const prot_err_agent_type_strs[] = { "Restricted CXL Device", diff --git a/drivers/firmware/efi/cper_cxl.h b/drivers/firmware/efi/cper_cxl.h deleted file mode 100644 index 5ce1401ee17a..000000000000 --- a/drivers/firmware/efi/cper_cxl.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * UEFI Common Platform Error Record (CPER) support for CXL Section. - * - * Copyright (C) 2022 Advanced Micro Devices, Inc. - * - * Author: Smita Koralahalli - */ - -#ifndef LINUX_CPER_CXL_H -#define LINUX_CPER_CXL_H - -void cxl_cper_print_prot_err(const char *pfx, - const struct cxl_cper_sec_prot_err *prot_err); - -#endif //__CPER_CXL_ diff --git a/include/linux/cper.h b/include/linux/cper.h index 5c6d4d5b9975..0ed60a91eca9 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -605,4 +605,8 @@ void cper_estatus_print(const char *pfx, int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus); int cper_estatus_check(const struct acpi_hest_generic_status *estatus); +struct cxl_cper_sec_prot_err; +void cxl_cper_print_prot_err(const char *pfx, + const struct cxl_cper_sec_prot_err *prot_err); + #endif From patchwork Tue Nov 19 00:39:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879313 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2081.outbound.protection.outlook.com [40.107.220.81]) (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 5C522AD4B; Tue, 19 Nov 2024 00:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976773; cv=fail; b=r8OXc1mxrPhrepMZqzdpEl/OIl8Mn/PE1Gs0PCoR6Gn97gRg1s4dvr84i4yuSq5QhiytYQDWAxp9MsFXmUYqxWmX8dPeJqVESjpPlDt/PL/OxrxVnLLAcy1Kl9F4Ji7HjpQSPRceModi99uWUAIxyrygLONMv7+IE65qu5VMcyA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976773; c=relaxed/simple; bh=xevecpJPjINvi3ZaLxeNKDHouEUWIqEG8Fg7YiuwSbo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Yi2K7mCxf6RVC/sKTW5e180WFYXIBuPnnIMolDrsj/ohk9Fe209oq8aNW/+ho4rmO7mGGDjt6GKml4JKuBgdMMlDL/DW7AXK47+jOT/SaH8HfXB2qe2zURHruhPwnjXQe3wz45YWy8FbaSmA4EoDx+nSMLh9UNzSioi/FYFaS7Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=xpNosrC6; arc=fail smtp.client-ip=40.107.220.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="xpNosrC6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xMoSWtbTmqasm/4rF+qw+WIxC/cGJvsYSnMxTiQSw6gEvg+6t7LzARyBVS5Tco9KHHi29JMEqrgy39qoaNLy/DuvUljnHHUsKrD/+p3YBCS4UsDsBkSBYo+het0irPcDTQ+VCSs8UWLdF1VFEkL5RKWoU9TyIu+tiC6yKBPlSb6b6UzdMWj9Z1KXzLpMaskZ2RiWYy7kylZz1nvGIWoyrdQgsYSmap28o7vYcgLv3uBK03PMzsCVt0w/esu8yBbsxzbtlBibZpzoe0UeEmoPzyPEI63jMf5/fIjzNMbDGjfRXd/zXp8uAZfCODshWVecyz/4vCwu/k/3N045u4cwMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9zQIBz+47OqiDnEKvRI36bBP4W+/g4/b3gJ6i5hh6wI=; b=NyLdIfkrL6hOXC7819eIdjLMFEoZfOO/KhXvOSBBXJUIPX+zqbdyumF0LvLat55nJ/8Ym6KMvew/sz6l8H7vArzjy3zRf54Xb2XDmE5sJGVsy34HRMWkv0B9+U20ZrNKBqSE7t47v53Z+neBBBxMuwprNZrsTdyfNDQuV5xbKtluMG9nAeMsxJU9UPQcR/KNHSjFA03TpJA30u9h93vg7D7TeuFdp+ZAfkvqOwGPoIt8kABzdOQW7H7Oy8+f5SA/U1coQ0liQHV248aLXCSaOA5UlXYHE1we7uBpa4LwuSXJqidak310LhSthrfidu0XWtsFO7pBslAJOo6aw2lkXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9zQIBz+47OqiDnEKvRI36bBP4W+/g4/b3gJ6i5hh6wI=; b=xpNosrC67wAdj1M3EUDO/e5bG+EDZlO9p3elXJou4gbWV3HKLke1Tnl41NewjE7tHthvzvUBAGADlEdCAqQmpoX3jqaUJXMtBtTtKbvkBJPs3ut6KvYkBXmqYROZf6xc1Tnm9MUeBkTJiygf8LDrPoO+I6sm9TKs2aMiRNH9n54= Received: from DM6PR10CA0032.namprd10.prod.outlook.com (2603:10b6:5:60::45) by CH3PR12MB8877.namprd12.prod.outlook.com (2603:10b6:610:170::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 00:39:29 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::dd) by DM6PR10CA0032.outlook.office365.com (2603:10b6:5:60::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22 via Frontend Transport; Tue, 19 Nov 2024 00:39:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:28 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:26 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 4/7] acpi/ghes, cxl: Rename cxl_cper_register_work to cxl_cper_register_event_work Date: Tue, 19 Nov 2024 00:39:12 +0000 Message-ID: <20241119003915.174386-5-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|CH3PR12MB8877:EE_ X-MS-Office365-Filtering-Correlation-Id: 07205ac9-2fe9-48f0-a968-08dd0832a080 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: Gh50Yc3q94jd5vblHHbtuxabCrUhV8PtX+MXsx+eAmVitzHsePWH+TjFVNnMTUm4/wZppx1ZtXJoqmksGFG3CPQCI2sD4BC8JfJqPUqOuCn2e82IK+PMoivIDVTX/W0+0pWeqN81z+KbC36zG8HQyZIv799CFzcVotD1MA6y7/bP1OYYKBgLsU7gNgOitLu5ok30q2UQ0oBrGZxinnnW9ndCVkUawBxhg+FKfQejT98iQ6G00XRd5l3zyVLsaWfqcwP1M8KaCJpQbKV1l9SIpORl2JpY0OlO1sv+fDI7LXn9nerxxoKP3AyV3YCCMWmL4jCiK7vAJuRPaljg0J5UUnj7n/wLo07hWFKrYbgaLY6eXlOzEI20MDwrzvA5JutVxd/XgEytyWp6JtZ2T983Kyht9Gd+1TPogF8CryxQ6+uxoHFPKMiaCmx/HYDrhcz8cbNq50sb+6CbbMOfV1iJNaLxwscZCZWP8vavKhFq4BIX/ZYTy3GeO04w8hzlsIAklkzL8qKSMh3tny82pV80R/rDSUdHMAgAhR6a7Ex0Rm1Q3YkcE2IP5diQPPOMOhURDosa7mLgOQZwjIczfvAMTYVbYCFFa7mPDJTMVfcTyatEb2E65gZUqSzF4BpfNZVIEXYQUI1heKosrJqOuXYWT5dL6ZXa4Sg3bU9o9OvD3lb4+l0bXEJwR2daY5pEud2u9NK/DwSqxW+2sBHNl/q1t2vJXCkCHFlYIV8Ro1Zfv8CQBqnSqrcXXYMP9MJlN8X8+O4jua08j1HKjI6FFSU36wjot3D6hZwQRWx1A9fj2mPwjEyIhtnUQMsxkINXt1mL5Vc5iUlqzv/cUHv77RiA5V0kLdAx1h3fM+nKLZztK2Kfl/63Av0ZZztWdv3MpawTLRGY8FuE7iUtwbgQxJGZm2Q+oSFZAckc/1jpxH5x62AB6pIqNBefiSLtxYOFHH0I3dplS8RSVWDOmJt0ON90BLsc4/isXESdCwfFujSaAv8L1LpCNVTfcrnY7wnHjc82b9FR3sGk1XN96lZvoK74dNKIjpTTu78Wk05Rev2KGVt44pi2vuNWmgL43l34FdTHwTt3jDPVuC1/wZU5yCZmbiOEddZX5Jdym36UTIZvtL8P/ZgyzGiCe3oU3LABqvpKGtMHIalF9h5CA6q336NnRfRszgMUaQrTTZaWv3qOlz/LO/nHN07AVnkncQoSu+Nrf0nC9n2C1P0EguHmTIUj10pWR8NFER6lBan6DB/UvrnfoKDIAy8nxtqn0oyp4HjzofVf5qM4238qDxyqXL5+oNcPyMFSlrWlgA1rYNxrFFpns2q4fFuVMyX5z5n1doYbHXC9RQMRrjBat2vD+sM1oLk3WJPqsgEbS49mm9MZaqj6qI8cYlVeE+Im/uPYkSL+v36AzuwsgY8ZtFwLVRikGw== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:28.9558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07205ac9-2fe9-48f0-a968-08dd0832a080 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8877 Rename cxl_cper_register_work() to cxl_cper_register_event_work() to better reflect its purpose of registering CXL Component Events based work within the CXL subsystem. This rename prepares the codebase to support future patches where cxl_cper_register_work() will accept generic pointers for Protocol Error workqueue integration. Signed-off-by: Smita Koralahalli --- drivers/acpi/apei/ghes.c | 8 ++++---- drivers/cxl/pci.c | 4 ++-- include/cxl/event.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index ada93cfde9ba..082c409707ba 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -717,7 +717,7 @@ static void cxl_cper_post_event(enum cxl_event_type event_type, schedule_work(cxl_cper_work); } -int cxl_cper_register_work(struct work_struct *work) +int cxl_cper_register_event_work(struct work_struct *work) { if (cxl_cper_work) return -EINVAL; @@ -726,9 +726,9 @@ int cxl_cper_register_work(struct work_struct *work) cxl_cper_work = work; return 0; } -EXPORT_SYMBOL_NS_GPL(cxl_cper_register_work, CXL); +EXPORT_SYMBOL_NS_GPL(cxl_cper_register_event_work, CXL); -int cxl_cper_unregister_work(struct work_struct *work) +int cxl_cper_unregister_event_work(struct work_struct *work) { if (cxl_cper_work != work) return -EINVAL; @@ -737,7 +737,7 @@ int cxl_cper_unregister_work(struct work_struct *work) cxl_cper_work = NULL; return 0; } -EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_work, CXL); +EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_event_work, CXL); int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd) { diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 188412d45e0d..88a14d7baa65 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -1075,7 +1075,7 @@ static int __init cxl_pci_driver_init(void) if (rc) return rc; - rc = cxl_cper_register_work(&cxl_cper_work); + rc = cxl_cper_register_event_work(&cxl_cper_work); if (rc) pci_unregister_driver(&cxl_pci_driver); @@ -1084,7 +1084,7 @@ static int __init cxl_pci_driver_init(void) static void __exit cxl_pci_driver_exit(void) { - cxl_cper_unregister_work(&cxl_cper_work); + cxl_cper_unregister_event_work(&cxl_cper_work); cancel_work_sync(&cxl_cper_work); pci_unregister_driver(&cxl_pci_driver); } diff --git a/include/cxl/event.h b/include/cxl/event.h index 66d85fc87701..992568b35455 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -233,16 +233,16 @@ struct cxl_ras_capability_regs { }; #ifdef CONFIG_ACPI_APEI_GHES -int cxl_cper_register_work(struct work_struct *work); -int cxl_cper_unregister_work(struct work_struct *work); +int cxl_cper_register_event_work(struct work_struct *work); +int cxl_cper_unregister_event_work(struct work_struct *work); int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd); #else -static inline int cxl_cper_register_work(struct work_struct *work) +static inline int cxl_cper_register_event_work(struct work_struct *work) { return 0; } -static inline int cxl_cper_unregister_work(struct work_struct *work) +static inline int cxl_cper_unregister_event_work(struct work_struct *work) { return 0; } From patchwork Tue Nov 19 00:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879317 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) (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 35C5F20328; Tue, 19 Nov 2024 00:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; cv=fail; b=jhbVlabwKjq+5rv6gu+wZJRy7OQOLdcT/GHVPy54+ZJrqYuxkoDgTixcFTQrDhQtLzlr802IB8PD5fuXUxsXS0OU0N7bUK6HyOau2cmbVBVvXgRa01U/yWjLZLNbHmesmhlZZ//mcKxZHicBhEx5xiSi4FErPEPWfXZ7mGl4PaQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976774; c=relaxed/simple; bh=9v81WZmZ/T2poKWZAMxeQf1HUmSbnJ2SqMaPAlC5dLE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VZcpXwCW3ReRD2vqDafAELNg+0lyv0Fo1T0AaEJGbnd3NtRr8WWyfuuoa96DE6ZjelQUMAMh0p2G2T3UpVx4ForTJ4ieuq/+nWRKOUP0spKiFyQU/z4FSBwzKTyvm4gOO72XeaNM3qTKqgcbifEs2iP2A9eevll967rkvqiPlYg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Q8FW+b04; arc=fail smtp.client-ip=40.107.237.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Q8FW+b04" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WTITgkr2rBOsW2W5f9hA3HaMvVVERRsITdutGwZF7N5X53CEGy4CUSNTRnajd89SJ8v1iNIgq/1CUCLocsyBKJEJwIAH+iaIBaGol1UlhMS9l+/0Qnm92R4qiXHreBHw+O2YTsVFVh8BIbU/DTC7McwyS4POd7A9EfNw1BCT+S46aYnDBgEvUGmUcgnPjvvDakiC9Qn1o/JFXCvWURxDRkNqe+bz0xQfp1mWS5Za2XgR1svLH1Wm1mUV9p3tjDO0tEnG9qtDksETXF2Ys7seA/0Z7lWmKZcnFAJpOUco8TI8yIJAiHMw7k9ET/9ky8A8l5iYI7tHYgAjtD1i62Abgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/pGk3pbn3bep9eghYVDP2ymR7MxQhQPU+Njsnmv5iBU=; b=rHZP12gQr3Coh8i1w4nPlcZxh0WlJ1PJZSgSAyyW7nVFvjDUujkvKI4KZPxcF7n9ztaoBCJv6lWsRjGk7fRASS9VAsIOCMi5bMqauh0YpAfa8XK2sZzXyzPYw8wuAKsX8IrvpgGFc4SJY68wEifbJtib/XRu/eQYwIAGvsAfZhZavJdahQYbHcfeF5b18Ug3VWa1JVMOrMxUjjkr2z51be/CUScfNmzxKng5Gc4AsMUkR00qhCeyrpIWTG19iLOojcwBxUreKKC915goBGngGP8FK0e5YqcOvj9kJ0YEyPU8W3jG2hxfKYzVY67UirNu84aqL9XLzrR2ksjJBmF14g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/pGk3pbn3bep9eghYVDP2ymR7MxQhQPU+Njsnmv5iBU=; b=Q8FW+b04mR+hnT+g/s6Al7DQx1HB69i65VzF7QYGA7LrEP0EhKTZVjy4wB6kXF67Xyw1xQRGbZE43bScwo9jQKbuW6sEByvg+TUQxldAa3zxo+vbP0f0alIWzvJPaJLbzwPmB01eHQsfqXXZ/MKqLzUqBfQ6bo/vDK3QXK2qoVw= Received: from DM6PR10CA0014.namprd10.prod.outlook.com (2603:10b6:5:60::27) by DM4PR12MB5769.namprd12.prod.outlook.com (2603:10b6:8:60::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.21; Tue, 19 Nov 2024 00:39:30 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::d8) by DM6PR10CA0014.outlook.office365.com (2603:10b6:5:60::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24 via Frontend Transport; Tue, 19 Nov 2024 00:39:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:29 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:27 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 5/7] acpi/ghes, cxl: Refactor work registration functions to support multiple workqueues Date: Tue, 19 Nov 2024 00:39:13 +0000 Message-ID: <20241119003915.174386-6-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|DM4PR12MB5769:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bd0046d-6f5c-46de-6b25-08dd0832a0c3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: lQeXPwnYuf9zxQD8ctEG3t0+xyAxhWb2xiq5Qy37VGWwgyTTugIlDmFwJMXyREfmnt+nil44SyuF6jmu661E18gBlvXI3egrUgA26+LlZJE/vIz83cQJ9b0IxecGU4qXS6mkE2aZwkSEk0F4fyooLbmwmvdommiN00gQnCvVPE7Fh1f8aHevinD/hFg8jpbc+wXqfC9OHzla3ldVOiQOd/a4QCZ38PN18v31h3jfmC85lHzDBlkU3rjeAdYURY1siGBLEnvITReD1UcUcvKQBgg8DxVW0Xe5d0PdCmsjcmCSbvKiO+U9jXpEvIFA8kwvdugAmj7w6sKX0o2Mw9Qs8C35eCBHsmbuu/LPXbKsc316GJPRKaAuJL5O5XHPg4pfUvBJvfYzigUk3/yqcgCPLJ8TepqNgOwMKYjObXIEbRKYAZbp1wbDQtVTkjqzxL17gMV4btRoP0CqyE75tNyRitB2z8xQlMgfKY4K316Ky5nggqjgLzuudoBxMb4/xJAofRTdtf49sgOc8fE21wFsN9BMMMSvKpEA4LkxBKeoU3ZG5mSxk9hQiGgzdVe6uD4+3QuCJeTJEN7hD4owwX955nFXQJWzfsdpgMGU74iOsFpE8dgmHSQ5LQfAx9JBj8cVQ6pulz9c3H4l998yNQ+54F/r6JYVm7V0wQZkUeBb+Fh1rZ9NcpS4TatChHa2VRgZ0SpvCCF/pJxdT/+YDxpYHj1JcSveR1knVDTtbrPZEMcY+7Z0imqRAMieSrgC3tv/Y6HblYupY+E87489I0nS3y12Ceo6VIZba0hjX5KHXR5cF7RkDeyOIpsK8s8fc3TcN/6vk6V8Degp/wXbKAo/AePOYZxSgecAg7qF83K7n4pSTiDx809xmh8+98O4y3u4YYltS0LXH4TmkTJnaMTB6F7+CfSqJX38fQEyIZnElHBIQ4SPsrF4sE/jg7GjwQxkds4wbpaLFvPduGC1HqmfagvAMo/3GD6OkynsnqZV6qlGFI94dWvj1c+InexprugSDas0cC5U7F+oD62gkBzKb3cG0j7uE35DhvXJqTG8WfpfP11nbeDaoxl7LYGHoPgatoQzYLg0FhCTGAACIh0b83He9T13EuAC8UpscIsBO1t/VI93O0VUEBxnM4XBNcebp9SsMCTc2S/NSBxivhmGh4R8KrfxYFUzOsf4ffrGH9pqV6TMhFnVSW5B0iGDmzDMmZecQZWBOE/iFo4tMGvgxGiV3jptNhq5MFjLT+GDmFuTYqdt1K0Wz8nHHs3be79TgEGY37hjvtfCGjVB9PXQpiN8QLhHf1WYMNxMqasZj7LYP6zYaHEMSzvZfWEol8V0lUc/9zRVbTdvzeUOCOM/CtbWMa9nrMNT5rAP4/dfOkrWWvtnVrDlvG39NtOyCPYfK4kZZDGi18nGeG7mn/Fr3w== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:29.4089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8bd0046d-6f5c-46de-6b25-08dd0832a0c3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5769 Refactor the work registration and unregistration functions in GHES to enable reuse across different workqueues. This update lays the foundation for integrating additional workqueues in the CXL subsystem for better modularity and code reuse. Signed-off-by: Smita Koralahalli --- drivers/acpi/apei/ghes.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 082c409707ba..62ffe6eb5503 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -717,26 +717,42 @@ static void cxl_cper_post_event(enum cxl_event_type event_type, schedule_work(cxl_cper_work); } -int cxl_cper_register_event_work(struct work_struct *work) +static int cxl_cper_register_work(struct work_struct **work_ptr, + spinlock_t *lock, + struct work_struct *work) { - if (cxl_cper_work) + if (*work_ptr) return -EINVAL; - guard(spinlock)(&cxl_cper_work_lock); - cxl_cper_work = work; + guard(spinlock)(lock); + *work_ptr = work; return 0; } -EXPORT_SYMBOL_NS_GPL(cxl_cper_register_event_work, CXL); -int cxl_cper_unregister_event_work(struct work_struct *work) +static int cxl_cper_unregister_work(struct work_struct **work_ptr, + spinlock_t *lock, + struct work_struct *work) { - if (cxl_cper_work != work) + if (*work_ptr != work) return -EINVAL; - guard(spinlock)(&cxl_cper_work_lock); - cxl_cper_work = NULL; + guard(spinlock)(lock); + *work_ptr = NULL; return 0; } + +int cxl_cper_register_event_work(struct work_struct *work) +{ + return cxl_cper_register_work(&cxl_cper_work, &cxl_cper_work_lock, + work); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_register_event_work, CXL); + +int cxl_cper_unregister_event_work(struct work_struct *work) +{ + return cxl_cper_unregister_work(&cxl_cper_work, &cxl_cper_work_lock, + work); +} EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_event_work, CXL); int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd) From patchwork Tue Nov 19 00:39:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879319 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2053.outbound.protection.outlook.com [40.107.93.53]) (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 DF1C4137750; Tue, 19 Nov 2024 00:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976780; cv=fail; b=ZUh+8qIKuN7nNCuJ8WshMqHz1gcJIawykE7XxHfoz74kc2rLw8aHgYQICtwDz5c1Him+v/RDeq3nP91BZerkvoS06hO8KVY3GbxSg/EvveajSm8cAGijtXh420g9XTsZOKRoK11fqp3ir8ORkN1ogdNjqgE3hU6Miv4KMxkQL7o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976780; c=relaxed/simple; bh=eI2RxorsISW2gvo0IHk8IE5HzKi9kPQYotwHNSH/0CE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fkp20ituNYUUTSfoYo1swe1i69oEOrRgK/pVSLJH7az5OTmp8d2hGwdW4D+0Uin8cl5H9pkDfYoozdPLtaqQ3DPfqb3qc3O7VodEBIJBWSNpsjFZ7wxyqz7SKtqJIeuhVHVCsQK5ZB3/lt6rPYzUAGL9bu6lBVYw142RppZs2bk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=OefkgQVo; arc=fail smtp.client-ip=40.107.93.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="OefkgQVo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eGaY9xdUf9In0mM+anBHvItyVuqBamU5YaXUTcMfp3dbMzD3Umb7JkfU5pNLY0hgn38sEt2kiWRoaPidKeKJkRJib6BSyKREkYiJ9e5QlByESCxH2xbY7r4i1sEOm3E77gIiIMcZsUe6VcK3tF3yR/sfjyqKvYJ746390flSG6ZSoK6RospLfXLiY3h+URqOim23BXrTvu9WSe3W/RYRAqCxhlCXTVMYh4Qg739pT+nPAT8bvoeJtUzIuMoEd3KfBVu6mJsjCv9YowgXQGIO7NsqUjdUv1ADZp0V6wVk5YBa0dkrasVaY77OQpVkLWQM5jd2DEl4rvkrGTg8oEUfmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R59fQdZTGIEMq/jvL0lLNzgH4fY3E1rfQySjzSVj9K8=; b=JoUxm8MDt6OZFG/fi8tTew9iYyrgallntSoCHjhoqOUdpgg45jJoyaOxYGTRBkdqFXZLEWcoZYN8igJIQ6w78QdqsaGTGURLZbV2hvjVaMiyCmuiDvNDSdcV+Pkj/K1+aW3DPgSCvx6oScAsnc+XS5+XVg8aDPReVTQ1wxBOKLutytJvcC8zeub9bPljjmqBY7rpbmC8oe4+wmPA78EFH0s5B5QVfTRiEHh4ie0YCGT7EXXnfox+3x07l/aoUEtY6w+o/Avj7KIY6dPyl2gGhGfCBaB10rhC9MTDa4qBkfhFIFc1AFOx7nJ4/keKta2yiM3zLttjM3OJbskqkRYl2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R59fQdZTGIEMq/jvL0lLNzgH4fY3E1rfQySjzSVj9K8=; b=OefkgQVomG+QAluvUnjoQqdBvvVDnwVkc4TpTTP/cy3aa7pPPq6OWFqyYZDJBhfUURF6VsI2sSbDVC0QmTZPgLCK6BSzr3d7gYfDY6EWTtayvBJVBVE7wp1t5CgtVSuwcCGl2ds9Q0E+KUVfCKCcsZuulGaUM0tXxsK4liOa7k8= Received: from DM6PR10CA0003.namprd10.prod.outlook.com (2603:10b6:5:60::16) by SJ2PR12MB8652.namprd12.prod.outlook.com (2603:10b6:a03:53a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.20; Tue, 19 Nov 2024 00:39:33 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::34) by DM6PR10CA0003.outlook.office365.com (2603:10b6:5:60::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24 via Frontend Transport; Tue, 19 Nov 2024 00:39:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:30 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:27 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 6/7] acpi/ghes, cper: Recognize and cache CXL Protocol errors Date: Tue, 19 Nov 2024 00:39:14 +0000 Message-ID: <20241119003915.174386-7-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|SJ2PR12MB8652:EE_ X-MS-Office365-Filtering-Correlation-Id: 4501131e-541e-4fe5-4da3-08dd0832a189 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: KIUimBHukhIAQ6QLGzlKSxNPcwMTjhQ9tnRY5k0Z+w2RS5cxYVHVsLToP17h/3GtqduYOoaTZmnTrhymESVBnO0KTJnog1FfRhKzlVYawmmQvkCGR7tgePBlrRZQEl2ZqiCxfzP8AjbdczV8ZdDIOEY2D4VJk30/zTQuwsciZlFuO0RQtIMvxAG6uFdb2LrWBf4nLioDCMI8+/bowfLdO/vbdRR+S9AiqiVJqvS9siuGQ4S5GJ1xFkOnPtBe2QWdHlfzJqqlo+Xxiqc/iMhVGW4f1IlSr6+Mqws8qHa+jMB31rPqw8aqIB971MrbiaIkuYFdHC68H8n9s2msEArjlYwkhKPzLw7Qwt+pBcc1hLOKICoPWirVH8asYAqKclQOLlT6GOmg20vQqJ0DuBTVIS+tizB1HRYYMqVqlqj3/cVm6VEH9ItnNF+usqr/hznSpMu/24Bq6zaFGgIkvHOBOimYlDgUwvW5u/vagKpXN+zVQ7JqwsJv9wPbUMW2aNWHxa8aFX+95ouJiEsOaET9IExMPuBSDU9yMJmhCbjAvTqlpGoYBy7xu8braIxAha2GCGkkdwuE/g7leYyQvQRz30j06PQT5Aj9d1xJAbeO8Qevg5H1n8sXLqz1JfQFuBVrQjQ9pyOmhFatBZ7+IHs0ZPvvExabnLhEQp7kgyZDa8WhyK1zIG+4okwJkG8jQ94t71hWjlgDlooHOSL5yA7O0ZB43q0xiTWWeGW3o7lSkdF9EtOZwbOYHl7CypunjQAOUj2MW/vEsH4e9zEh8RbYMYNgtnwVyTHfACVBYg6cURJojBgV11lEydYnqzzgi1UUn/6wVPEeUZH/eOJ4Q7vTeSw1CNLQ3Wx52VutGa782T6PiAR3VrW3i7HQs0Baih+zMUDrx23Ax1R5T5RPd/fsYPYNPlDeIjncOE1baOxAXxUdRCTuHZh5eBSaQXIHJ+CSDo77+WNFLubjztCfW2TxzU0Tf1gBp2OA3Hlcn18f3xhv3OQAzJH/Fl+5/VtyP2ZwZtjk5m3+zWvZNZR2OTYynvuJZTtVt46z/pfjBgijUnKlSdNf6d06F0By1rdpdgHrMOzuYnWIuOlVFxtJo4+sNTTnAm2/AceQGh9T4+WFHM3uqru25FA4j9LffaVVV9J+9842NXuJkaFHNx028uaMjpUXUza7cQvZCDuS30mCtraP5PnKdRgVdObZSoeJR1yIwA6p6BHHZ6v8hlDsTKhetExOW3ePiiKxCo+XgqW3XY7IFnYVrzZUjSNsvUuFicUzIrd9aoERg6HTVehcg0pQupFQ0///HQKA5sr3a0hTNGT/9IZ3XQYxJSO2cbX1VU9HYjsJySaKBAa1bd/iaEiAubi3fBWqr+Z3iSh+V/9bI5qYp0XjuCVEepXn6hiLT39IrC0Ed88JwvmUnjTYbpt6Tg== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:30.6901 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4501131e-541e-4fe5-4da3-08dd0832a189 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8652 Add support in GHES to detect and process CXL CPER Protocol errors, as defined in UEFI v2.10, section N.2.13. Define struct cxl_cper_prot_err_work_data to cache CXL protocol error information, including RAS capabilities and severity, for further handling. These cached CXL CPER records will later be processed by workqueues within the CXL subsystem. Signed-off-by: Smita Koralahalli --- drivers/acpi/apei/ghes.c | 52 ++++++++++++++++++++++++++++++++++++++++ include/cxl/event.h | 6 +++++ 2 files changed, 58 insertions(+) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 62ffe6eb5503..6cd9d5375d7c 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -676,6 +676,54 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata, schedule_work(&entry->work); } +static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, + int severity) +{ + struct cxl_cper_prot_err_work_data wd; + u8 *dvsec_start, *cap_start; + + if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) { + pr_err_ratelimited("CXL CPER invalid agent type\n"); + return; + } + + if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) { + pr_err_ratelimited("CXL CPER invalid protocol error log\n"); + return; + } + + if (prot_err->err_len != sizeof(struct cxl_ras_capability_regs)) { + pr_err_ratelimited("CXL CPER invalid RAS Cap size (%u)\n", + prot_err->err_len); + return; + } + + if (!(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER)) + pr_warn(FW_WARN "CXL CPER no device serial number\n"); + + switch (prot_err->agent_type) { + case RCD: + case DEVICE: + case LD: + case FMLD: + case RP: + case DSP: + case USP: + memcpy(&wd.prot_err, prot_err, sizeof(wd.prot_err)); + + dvsec_start = (u8 *)(prot_err + 1); + cap_start = dvsec_start + prot_err->dvsec_len; + + wd.ras_cap = *(struct cxl_ras_capability_regs *)cap_start; + wd.severity = cper_severity_to_aer(severity); + break; + default: + pr_err_ratelimited("CXL CPER invalid agent type: %d\n", + prot_err->agent_type); + return; + } +} + /* Room for 8 entries for each of the 4 event log queues */ #define CXL_CPER_FIFO_DEPTH 32 DEFINE_KFIFO(cxl_cper_fifo, struct cxl_cper_work_data, CXL_CPER_FIFO_DEPTH); @@ -795,6 +843,10 @@ static bool ghes_do_proc(struct ghes *ghes, } else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) { queued = ghes_handle_arm_hw_error(gdata, sev, sync); + } else if (guid_equal(sec_type, &CPER_SEC_CXL_PROT_ERR)) { + struct cxl_cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata); + + cxl_cper_post_prot_err(prot_err, gdata->error_severity); } else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) { struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata); diff --git a/include/cxl/event.h b/include/cxl/event.h index 992568b35455..c9a38ebaf207 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -232,6 +232,12 @@ struct cxl_ras_capability_regs { u32 header_log[16]; }; +struct cxl_cper_prot_err_work_data { + struct cxl_cper_sec_prot_err prot_err; + struct cxl_ras_capability_regs ras_cap; + int severity; +}; + #ifdef CONFIG_ACPI_APEI_GHES int cxl_cper_register_event_work(struct work_struct *work); int cxl_cper_unregister_event_work(struct work_struct *work); From patchwork Tue Nov 19 00:39:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13879318 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2072.outbound.protection.outlook.com [40.107.220.72]) (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 BB62112F375; Tue, 19 Nov 2024 00:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976779; cv=fail; b=kKQpk511kPQnwI3oicP9OhcAdc0cvZUDXLi7buybdF66kQM1ryilQqj/xpcrdba5Nk0WyohBns5uVmheejk6ILXsdZpEA56FQDXKt2ysa6ARmCC46EKICUF8UPn6HyzHJQJ/FMzkzPe7r1UnfTt2TK3/Khx8dN3swLonSIJHJ/c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731976779; c=relaxed/simple; bh=s1dTVHODGYZHn4DWYL4w6ARvDv58hIcasPs2LJRX848=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b3TdgG/p/a28Epxp0O9/x7RVGcXeUd+Q3FLRSOftVtNR1+q7b6w2Z71/KZV9KPw/ZPZKfOGYjCzqCL7JAIP6uNbQ2lG5UdKGxZXv9qrEQmpd3tU9EJLfyOY6a0nt2ZyrXXpV27FoHn3G3QfEITHkyxbnwN/uOaETlq8+XKrr9yA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=s/nUZ0t2; arc=fail smtp.client-ip=40.107.220.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="s/nUZ0t2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MYlTSjjPa53W9sjZQbbF9zXIpqj4z6U+V75x8ZDS4iwsA3SmVCKw10tg9hP4lAOW6fs5QzZS75DYUeEFgJW/aRvBfmRqofYLHawXhQPXVtERxu5WZHTX3RSlyxgfvZVH/H1vG7kbPT6LV4chI1rd/dFhK6KEvyjqW27iVo9rweovIIleoj6gk/Rurk1vzfa5kQmN4YNkE8C3H3ADq4A0ndBsSJFZpq8bklkX1OHjY88AY/NvpthU/teblW8fMDyi2ajytq+Pnr77ET+Pps7BtdWkQGpJWX2Q8dDze+KgdXoQVHWyhgBzmdzxTP49tmdYD6PLCZEFTik+hTX+PEOiPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uXo3T/9XOSb8PMo6JY0TO7NVnXhFQUcqrbXmC+2RFeg=; b=glXrmyxEC7YgTNyj7bClQ7NO84+xhQdXFFKXR7aAysbz1aSoph1vjK3UI1vZv5Fg5hqC8EUkePuPASg6vOBJEtoDV8ykJllKJCd2wNhQWKc2CQKEPqH0AV47GINiEE2zfxKFCmxWBJ441DXMmYVcLZnFCnu/wca69U4Ik8xIwk/ULQnlgKHoSiU9YBF+VmDNaESnNOtp4MAG1On/CqOUbKO9iWxemJXLDe3wpHTtLhhPuclK8tYb3XVZ3DbpCVG/vcj4+/t5odszkW3I2yxMnOkT1Gr8hhSSTD9KYn4y6Jap7Y+lunlVN6+65U/Y0pMXV2oCcaOt4vE7S1xvUD/SLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uXo3T/9XOSb8PMo6JY0TO7NVnXhFQUcqrbXmC+2RFeg=; b=s/nUZ0t2uRlQZbDq3WUA5h1CPsMv90jkpG5Z8ymg+f2kfiuezzyctYNd4sgO7zinXaW5L/YOxwooFMweXqJwnQaWz2UYseZUTbyi+XbGFyn/2oyaHUiIuo8jn6BG07VbPVWWCHhCHo+qtfoaKUCEJWI7CTXLQTTlCKl7caA5Hjc= Received: from DM6PR10CA0001.namprd10.prod.outlook.com (2603:10b6:5:60::14) by SJ0PR12MB6784.namprd12.prod.outlook.com (2603:10b6:a03:44f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24; Tue, 19 Nov 2024 00:39:34 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::a2) by DM6PR10CA0001.outlook.office365.com (2603:10b6:5:60::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23 via Frontend Transport; Tue, 19 Nov 2024 00:39:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Tue, 19 Nov 2024 00:39:34 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 18:39:28 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v3 7/7] acpi/ghes, cxl/pci: Process CXL CPER Protocol Errors Date: Tue, 19 Nov 2024 00:39:15 +0000 Message-ID: <20241119003915.174386-8-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> References: <20241119003915.174386-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|SJ0PR12MB6784:EE_ X-MS-Office365-Filtering-Correlation-Id: 447822bd-3f13-40ef-e5e2-08dd0832a389 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: rUUIu/6lVVTnS8utfx6mpo7o67f7DiU8gt1rx64KBZVSrUbTDqjp0I+/NqVD+c9xF6UFJg9NjwoG218tSrRDB2VeYD924SOAB+vmOuZPlDKtszbNEa66zFIvEFD3Lz/9njJNJkRtxxZyX7Q9BFT99QoB5ROkJ8zvd9dvckPoFLaE8Wq5YkdPL2QOQ+b4e9d+3y+QGuCNXRXrYd/qMSk+BKu4SHI9ue+SAAy2loo6TLzble9InryDyNdOWCyWJ2/VDnVCUjRDWn/xTw65KZuMbkRM33655zIDz+iXhB9Ihf2RTgYVkViXh2oJnjaSLUZgZnH3YUDvaHk65kqLF7/1i5SoFr63dsqS8ZuW6bKrft6virdKhgmzGICWzUV3OsxwJqn7pPXDTYukyj0ZvZlzalK2OPtkguyvVDF4ggx3vUdov6QDxZDG4dyWc7cwUozVVSDD6mVDRAA4NUqpBb+sUfphM3aOmPNVcfHDPlXA3NPiznOWkkGweHDFelWMRdY9zZmL8v4f5iqkMYG0vyTiljtduKn8p4FLWlIHat/ER88kKBM2G7HLYxsIv2ZRmfEUNRHNWBqun7fh345hp3JtvxlspQYon6eGPG7ezUp8mlnAeqtmL9AeE6MppkWlOG7lGIenyE2EvOGo5VBVj3mNqjlsAFZ44etMX4coIVh+tkiq3k9q3ek3bLkTzm7JYVRTCz+q2HlYtBL/DrFRKNz6K6LtZm/cPAgX4FnSCB0m91qEXnVyeOEkwxD4rHGTXGXcw0HR/eE2RjDYNqe2tIO7LT7CVhltrv71b7fmnDoS7k/zXxZfo/yLwWhQflHL0iYDyt2D6QxzCAr/R52/XrqeqBVHH0MxmXp+vg5snbAKfuL7npdpbUwNrmL8pnpU3V91vnINJzUxs1q0UCozON2lTBdrbMyU3mHfCfQ7jODldhS2YXYSiZXcVqG8+ec5wDVB8fujZskNYAHLb7+vw//JCE/9NWowxXj9jBPGa12Z4TnmYttuwTdLijCFXZnOykVx/UiAyXSZUgbJly5gqc/DRCyPsSL3EtjKjZnEWFE+Re8JtXCi9PONa/by1A1K1UtNc59zAgJLZHrh5GtQhcqWKQYxFDruGZcG3hBfVmo92xHpw5dootkRdYTaXxHPb4NSlel5A0XkOsFFBd/P3OoSNt6VzJP2CxHcKAloEsKW7EpgVaboehjUgvsXsyiWR3fN0ETuqs6mnaqVt3WZmy0ecfI3iuZQylP+Q8PKd67qIhmHw8glx68A8qpBHNL9qEa7lYDfiV4Z9MZRmQuBfdSxEuNjj1vglTcOIKD1SfJPRlyOaA7w9I89ob69SdrTzNEgYyOdBZPMwAF+qL3yPehLQdMfJgg8cm7CaP3mErLmi+w/S8DhfUwxJO4hEi4UUaSzW/7Pjbb49ysd4c0Zzcu0sQ== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 00:39:34.0651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 447822bd-3f13-40ef-e5e2-08dd0832a389 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6784 When PCIe AER is in FW-First, OS should process CXL Protocol errors from CPER records. Introduce support for handling and logging CXL Protocol errors. The defined trace events cxl_aer_uncorrectable_error and cxl_aer_correctable_error trace native CXL AER endpoint errors, while cxl_cper_trace_corr_prot_err and cxl_cper_trace_uncorr_prot_err trace native CXL AER port errors. Reuse both sets to trace FW-First protocol errors. Since the CXL code is required to be called from process context and GHES is in interrupt context, use workqueues for processing. Similar to CXL CPER event handling, use kfifo to handle errors as it simplifies queue processing by providing lock free fifo operations. Add the ability for the CXL sub-system to register a workqueue to process CXL CPER protocol errors. Signed-off-by: Smita Koralahalli --- drivers/acpi/apei/ghes.c | 41 ++++++++++++++++++++++++++++++ drivers/cxl/core/pci.c | 50 ++++++++++++++++++++++++++++++++++++ drivers/cxl/cxlpci.h | 6 +++++ drivers/cxl/pci.c | 55 ++++++++++++++++++++++++++++++++++++++++ include/cxl/event.h | 15 +++++++++++ 5 files changed, 167 insertions(+) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 6cd9d5375d7c..32062b6a9985 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -676,6 +676,15 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata, schedule_work(&entry->work); } +/* Room for 8 entries */ +#define CXL_CPER_PROT_ERR_FIFO_DEPTH 8 +static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data, + CXL_CPER_PROT_ERR_FIFO_DEPTH); + +/* Synchronize schedule_work() with cxl_cper_prot_err_work changes */ +static DEFINE_SPINLOCK(cxl_cper_prot_err_work_lock); +struct work_struct *cxl_cper_prot_err_work; + static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, int severity) { @@ -701,6 +710,11 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, if (!(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER)) pr_warn(FW_WARN "CXL CPER no device serial number\n"); + guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock); + + if (!cxl_cper_prot_err_work) + return; + switch (prot_err->agent_type) { case RCD: case DEVICE: @@ -722,6 +736,13 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, prot_err->agent_type); return; } + + if (!kfifo_put(&cxl_cper_prot_err_fifo, wd)) { + pr_err_ratelimited("CXL CPER kfifo overflow\n"); + return; + } + + schedule_work(cxl_cper_prot_err_work); } /* Room for 8 entries for each of the 4 event log queues */ @@ -809,6 +830,26 @@ int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd) } EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get, CXL); +int cxl_cper_register_prot_err_work(struct work_struct *work) +{ + return cxl_cper_register_work(&cxl_cper_prot_err_work, + &cxl_cper_prot_err_work_lock, work); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_register_prot_err_work, CXL); + +int cxl_cper_unregister_prot_err_work(struct work_struct *work) +{ + return cxl_cper_unregister_work(&cxl_cper_prot_err_work, + &cxl_cper_prot_err_work_lock, work); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_prot_err_work, CXL); + +int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd) +{ + return kfifo_get(&cxl_cper_prot_err_fifo, wd); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_prot_err_kfifo_get, CXL); + static bool ghes_do_proc(struct ghes *ghes, const struct acpi_hest_generic_status *estatus) { diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index 4ede038a7148..c992b34c290b 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -650,6 +650,56 @@ void read_cdat_data(struct cxl_port *port) } EXPORT_SYMBOL_NS_GPL(read_cdat_data, CXL); +void cxl_cper_trace_corr_prot_err(struct pci_dev *pdev, bool flag, + struct cxl_ras_capability_regs ras_cap) +{ + struct cxl_dev_state *cxlds; + u32 status; + + status = ras_cap.cor_status & ~ras_cap.cor_mask; + + if (!flag) { + trace_cxl_port_aer_correctable_error(&pdev->dev, status); + return; + } + + cxlds = pci_get_drvdata(pdev); + if (!cxlds) + return; + + trace_cxl_aer_correctable_error(cxlds->cxlmd, status); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_corr_prot_err, CXL); + +void cxl_cper_trace_uncorr_prot_err(struct pci_dev *pdev, bool flag, + struct cxl_ras_capability_regs ras_cap) +{ + struct cxl_dev_state *cxlds; + u32 status, fe; + + status = ras_cap.uncor_status & ~ras_cap.uncor_mask; + + if (hweight32(status) > 1) + fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK, + ras_cap.cap_control)); + else + fe = status; + + if (!flag) { + trace_cxl_port_aer_uncorrectable_error(&pdev->dev, status, fe, + ras_cap.header_log); + return; + } + + cxlds = pci_get_drvdata(pdev); + if (!cxlds) + return; + + trace_cxl_aer_uncorrectable_error(cxlds->cxlmd, status, fe, + ras_cap.header_log); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_uncorr_prot_err, CXL); + static void __cxl_handle_cor_ras(struct device *dev, void __iomem *ras_base) { diff --git a/drivers/cxl/cxlpci.h b/drivers/cxl/cxlpci.h index 4da07727ab9c..5e4aa8681937 100644 --- a/drivers/cxl/cxlpci.h +++ b/drivers/cxl/cxlpci.h @@ -129,4 +129,10 @@ void read_cdat_data(struct cxl_port *port); void cxl_cor_error_detected(struct pci_dev *pdev); pci_ers_result_t cxl_error_detected(struct pci_dev *pdev, pci_channel_state_t state); + +struct cxl_ras_capability_regs; +void cxl_cper_trace_corr_prot_err(struct pci_dev *pdev, bool flag, + struct cxl_ras_capability_regs ras_cap); +void cxl_cper_trace_uncorr_prot_err(struct pci_dev *pdev, bool flag, + struct cxl_ras_capability_regs ras_cap); #endif /* __CXL_PCI_H__ */ diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 88a14d7baa65..e261abe60e90 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -1067,6 +1067,53 @@ static void cxl_cper_work_fn(struct work_struct *work) } static DECLARE_WORK(cxl_cper_work, cxl_cper_work_fn); +static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) +{ + unsigned int devfn = PCI_DEVFN(data->prot_err.agent_addr.device, + data->prot_err.agent_addr.function); + struct pci_dev *pdev __free(pci_dev_put) = + pci_get_domain_bus_and_slot( + data->prot_err.agent_addr.segment, + data->prot_err.agent_addr.bus, + devfn + ); + int port_type; + + if (!pdev) + return; + + guard(device)(&pdev->dev); + if (pdev->driver != &cxl_pci_driver) + return; + + port_type = pci_pcie_type(pdev); + if (port_type == PCI_EXP_TYPE_ROOT_PORT || + port_type == PCI_EXP_TYPE_DOWNSTREAM || + port_type == PCI_EXP_TYPE_UPSTREAM) { + if (data->severity == AER_CORRECTABLE) + cxl_cper_trace_corr_prot_err(pdev, false, data->ras_cap); + else + cxl_cper_trace_uncorr_prot_err(pdev, false, data->ras_cap); + + return; + } + + if (data->severity == AER_CORRECTABLE) + cxl_cper_trace_corr_prot_err(pdev, true, data->ras_cap); + else + cxl_cper_trace_uncorr_prot_err(pdev, true, data->ras_cap); + +} + +static void cxl_cper_prot_err_work_fn(struct work_struct *work) +{ + struct cxl_cper_prot_err_work_data wd; + + while (cxl_cper_prot_err_kfifo_get(&wd)) + cxl_cper_handle_prot_err(&wd); +} +static DECLARE_WORK(cxl_cper_prot_err_work, cxl_cper_prot_err_work_fn); + static int __init cxl_pci_driver_init(void) { int rc; @@ -1079,13 +1126,21 @@ static int __init cxl_pci_driver_init(void) if (rc) pci_unregister_driver(&cxl_pci_driver); + rc = cxl_cper_register_prot_err_work(&cxl_cper_prot_err_work); + if (rc) { + cxl_cper_unregister_event_work(&cxl_cper_work); + pci_unregister_driver(&cxl_pci_driver); + } + return rc; } static void __exit cxl_pci_driver_exit(void) { cxl_cper_unregister_event_work(&cxl_cper_work); + cxl_cper_unregister_prot_err_work(&cxl_cper_prot_err_work); cancel_work_sync(&cxl_cper_work); + cancel_work_sync(&cxl_cper_prot_err_work); pci_unregister_driver(&cxl_pci_driver); } diff --git a/include/cxl/event.h b/include/cxl/event.h index c9a38ebaf207..5f83c3bfc813 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -242,6 +242,9 @@ struct cxl_cper_prot_err_work_data { int cxl_cper_register_event_work(struct work_struct *work); int cxl_cper_unregister_event_work(struct work_struct *work); int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd); +int cxl_cper_register_prot_err_work(struct work_struct *work); +int cxl_cper_unregister_prot_err_work(struct work_struct *work); +int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd); #else static inline int cxl_cper_register_event_work(struct work_struct *work) { @@ -256,6 +259,18 @@ static inline int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd) { return 0; } +static inline int cxl_cper_register_prot_err_work(struct work_struct *work) +{ + return 0; +} +static inline int cxl_cper_unregister_prot_err_work(struct work_struct *work) +{ + return 0; +} +static inline int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd) +{ + return 0; +} #endif #endif /* _LINUX_CXL_EVENT_H */