From patchwork Tue Apr 11 18:02:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bowman, Terry" X-Patchwork-Id: 1767758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=JYXIXHFQ; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PwtzW05lrz1yXv for ; Wed, 12 Apr 2023 04:05:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjDKSFI (ORCPT ); Tue, 11 Apr 2023 14:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjDKSE6 (ORCPT ); Tue, 11 Apr 2023 14:04:58 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::600]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7155C5240; Tue, 11 Apr 2023 11:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5hpMkQCt3O+uUmXA/0ti3l+vGqP6/RrVr0faU9ATBrsXNcIVb8s/OeOvgKgNl7MJCoeqvYLNQjWX8HNpyASirgq+rOZpfkk4dOULxd3occqdPPryxQ8CE2hcmqJlMmIro0xZgflVPm1V+4qjDeMVd27UScrl+OiV4sMB0+Yg0yWcws/a+v+iXJ2WixFa49FNkeFeC1FL+mxEDW4Sk89/SDozbtgcKTj6YUZSwuSFAhgiQwusMzknI7fJB/in64W7ZsGRXAIsSoRNkThCujZNEOAYnsCbtgeLTESZorsuVtVZXNbJfV9uTuMb/DW7t+EJtUCjkUEJFCz+Pw/R6a6OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9jWizZyOkncM0zUzSAlj45CvBH14g/iZi511HWH1pLE=; b=jpD6YtWPsdIrTRAyTcQQmc2XJ6uCaGFOrWcyyWjKDG3xmmiMhmeUPoUwT9b7nwiKH2Z2UQ7IsCvWtK7rcqLH5sNF5JkU4hO8bJfjGKhrgta8uBCwusfUsRgUBldCvFtrHuFcWwQUXROy8CGo17kyOFCHySFWOEyTajr0ndZ72uGqFmqiKi3RDlWP7v/KjE5gkwRhjaXghY1cmhngbwBUuyFv/oaXTdi5s1WYWioeOGFhCZvY4B+ExjuoHXGyUNGstLzfwMOGsdFM0qxp5G/JwoHOmn6Gqhd62oinAjlj6FGISYJeZOyAOLgcQ03dET6kFUpBTlVheNiITDFLTV9EkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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 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=9jWizZyOkncM0zUzSAlj45CvBH14g/iZi511HWH1pLE=; b=JYXIXHFQvkgc0kNDxxOiyk9wQ4ASCRQFASIns+OfJ4X1WBsePAVXIGz6rjbkb59AvH0IKyPb7/QYwLVtSG6XeZYcMSmlMWIVzywFSyvvpTAT3vfdcdG6a8XDG3rOu1geawEkDvwdf9STavtusV/Ga0i4CTV7M9/qxx74tLmVPXs= Received: from BN8PR03CA0022.namprd03.prod.outlook.com (2603:10b6:408:94::35) by PH8PR12MB6988.namprd12.prod.outlook.com (2603:10b6:510:1bf::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 18:03:55 +0000 Received: from BN8NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:408:94:cafe::70) by BN8PR03CA0022.outlook.office365.com (2603:10b6:408:94::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Tue, 11 Apr 2023 18:03:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) 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.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT053.mail.protection.outlook.com (10.13.177.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.29 via Frontend Transport; Tue, 11 Apr 2023 18:03:54 +0000 Received: from ethanolx7ea3host.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.2375.34; Tue, 11 Apr 2023 13:03:54 -0500 From: Terry Bowman To: , , , , , , , CC: , , , , Mahesh J Salgaonkar , Oliver O'Halloran , Subject: [PATCH v3 3/6] PCI/AER: Export cper_print_aer() for use by modules Date: Tue, 11 Apr 2023 13:02:59 -0500 Message-ID: <20230411180302.2678736-4-terry.bowman@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411180302.2678736-1-terry.bowman@amd.com> References: <20230411180302.2678736-1-terry.bowman@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: BN8NAM11FT053:EE_|PH8PR12MB6988:EE_ X-MS-Office365-Filtering-Correlation-Id: 2910ac8b-68a9-4e8f-cbd2-08db3ab71d62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CGxjmd2xup7L9WjX75UTvjxyStC6eQj/aOm4kZYgwr1OTOmWcE18MjVl5AHTA12Rta87jq1BfySovZl6SOsxBx957uvEGaiUvqkw6W8gZZIdzD2NBKx+TBog7v2Yl/W5DVw37cYCYkRrdZf4q3icFbVUsJXIb2fXHwwwycUFW/AvQMiD+2oWt8wUidfZisuOzuSbyPFt1FUyDu17Wy2x40X7Dz+goBhgsQz8poHlI64RBAPeLk9W+9gbh5sYxOUQzWSs90eOmoJDoJ8Cci9uJdxEXCopyjkeZ1yZ8RIla8t/HChgPEGKjNqjfwo7GNSFHv2P3XYi/e67RPVMZXnYcTJkMffXcTawcUeqyRiqzfWfHPLnHZFinNzonNWXN9R5jGxnHxU+kEWL+0t4j43ZtH1VF7aT8VXj2HzUHInF5UUPJ7jxIp0jo8LQ8YVrgWNtET6E0QN1iOVfAnbpQNys4Eruq77K6ojktoOedn/XlxdNkqVOD7MnxaufA2h3GIqcLxyrhh9wXylahlwvzjbG9sgLgkMGWKCIQbvZV8LEPVOZVp4K7tpw4DNjPjyxo47Vwy1hy4uDwNT96qynbSU4FDmzSO7Rid8IrtfLUD14aoYm7ufEKFkDjHrBv9ROBViafM9Wij5NH8fXdYtF10P08GGs+vZ5K9IK7Q04GcqpDUIJwPu/n1t4MD06BY9+dBPMArSAzUpUisx84//8/BijSlPGOYBNKD/JWCIHpt8MmW4= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(2906002)(40460700003)(36756003)(54906003)(478600001)(26005)(8936002)(2616005)(4744005)(81166007)(47076005)(356005)(82740400003)(44832011)(16526019)(1076003)(7416002)(86362001)(5660300002)(186003)(40480700001)(336012)(426003)(36860700001)(70586007)(8676002)(70206006)(4326008)(82310400005)(110136005)(7696005)(316002)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 18:03:54.9028 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2910ac8b-68a9-4e8f-cbd2-08db3ab71d62 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.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6988 X-Spam-Status: No, score=0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The CXL driver plans to use cper_print_aer() for restricted CXL host (RCH) logging. cper_print_aer() is not exported and as a result is not available to the CXL driver or other loadable modules. Export cper_print_aer() making it available to CXL and other loadable modules. Signed-off-by: Terry Bowman Cc: Mahesh J Salgaonkar Cc: "Oliver O'Halloran" Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Reviewed-by: Jonathan Cameron --- drivers/pci/pcie/aer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index f6c24ded134c..7a25b62d9e01 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -812,6 +812,7 @@ void cper_print_aer(struct pci_dev *dev, int aer_severity, trace_aer_event(dev_name(&dev->dev), (status & ~mask), aer_severity, tlp_header_valid, &aer->header_log); } +EXPORT_SYMBOL_GPL(cper_print_aer); #endif /** From patchwork Tue Apr 11 18:03:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bowman, Terry" X-Patchwork-Id: 1767759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=GuKX/iEP; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Pwv1b3K8Bz1yXv for ; Wed, 12 Apr 2023 04:06:59 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbjDKSG4 (ORCPT ); Tue, 11 Apr 2023 14:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230300AbjDKSGz (ORCPT ); Tue, 11 Apr 2023 14:06:55 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::60c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CFF36E86; Tue, 11 Apr 2023 11:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M46oy+YV3e7UEe1zBeJwESept1jLMuX0htCKf7Z2bxJ6/s3cP2PIOGcxb4JFQiKrkxtSHHJrBmmz6mfSdo6TjoWDH/H1LC/eNGrn+L9mO/Z9n5MwBDXBbNcz5GLjHcChYxG/ONj0jjWiWjrAO9PSSC1nTLnzGBTPV28KRBX2TrzrpVyBMdoOluO8DxIq4djheEn06X4AjqJgjV2j2OmMvyNRjKE7vtlqQ+sKWlYV39rAFbMVmC/pau7/H9WueGNVP94ZXL6qOFPjo+XnDN4lRWRXsDZbYuaQrKrSRf4yhGE6f1Ch0fWD1BDFJ0htApfrMN9iRVYN7qqBW1xZqbo+2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=L4ZCRrCWSpGRon5DPUy2i9yAnHrELFU55+UIaeoiKNk=; b=n2tpFdonLsYRsMPKB9iKtOPHh8TMrMw8EPDgenFmYFZ4FBdMi8DQqV+145mhf1TkddVqkpif6EASi9rMCH3jljTC9tEXS3GCAjojXT4FE8xQEewLyfcRq9b0mnO3XqW6zkuDTxL1RaVnwPKxzad2jnkVPNRsKrgs/5TwxW3v+HVwO4PntDoTd4r8+9O1UebAXljpvVQcwp782P4knHET1PbqS/DjZsU30OjktMP0OUnlzB3/FtQtwu0lhKgxSswguyJy09yyj0nSuqu/TNN8v2sa2boGSg8Aso2syh8ZnuAwGdDLTO7hU1OTch/6XZELn+KwxlmqAg2NQH5jSAaT/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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 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=L4ZCRrCWSpGRon5DPUy2i9yAnHrELFU55+UIaeoiKNk=; b=GuKX/iEP5UMHAlZgtoehfc5/yfO+DpYWb2dAuN3VF5yI3KRas25NVkTVxqLK82YczL+hzrnhmalaqPM5nvHcnMAJeZ8m+u35V43rdbMBkHFLHqCtA7PymcsUFbTPcf2RluibNGBO8zX35SrAGwzFsUgXCxxzLggYAgJFHRXwRvs= Received: from BN9P223CA0030.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::35) by BY5PR12MB4131.namprd12.prod.outlook.com (2603:10b6:a03:212::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.34; Tue, 11 Apr 2023 18:04:37 +0000 Received: from BN8NAM11FT105.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::4b) by BN9P223CA0030.outlook.office365.com (2603:10b6:408:10b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.40 via Frontend Transport; Tue, 11 Apr 2023 18:04:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) 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.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT105.mail.protection.outlook.com (10.13.176.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.26 via Frontend Transport; Tue, 11 Apr 2023 18:04:36 +0000 Received: from ethanolx7ea3host.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.2375.34; Tue, 11 Apr 2023 13:04:35 -0500 From: Terry Bowman To: , , , , , , , CC: , , , , Oliver O'Halloran , Mahesh J Salgaonkar , , Subject: [PATCH v3 5/6] PCI/AER: Forward RCH downstream port-detected errors to the CXL.mem dev handler Date: Tue, 11 Apr 2023 13:03:01 -0500 Message-ID: <20230411180302.2678736-6-terry.bowman@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411180302.2678736-1-terry.bowman@amd.com> References: <20230411180302.2678736-1-terry.bowman@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: BN8NAM11FT105:EE_|BY5PR12MB4131:EE_ X-MS-Office365-Filtering-Correlation-Id: cfb8d8ab-f159-4f87-e6e8-08db3ab73643 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0SGQNGoS+upoqTqw25eWvqc01KDWnJIhSbtrpBrny5SAnUnv0MsVG0IJBWafPX7dF1H5M887rhrOLFC2qMrVxyYGUWSet+Od+9IRQbrn2DPs9mP+g7JmvMoDd5CAPHHYdrhn/0/PlZDlLatMD9V5WeXZeLNuJ3DRvW9Qx1KrH0hQFuyB6uMT/MQAX2kn162lyrsw/o6hA9qtiRLUeSgpfV5eGfO3UbO4YlyCsJgiHkH8U3Nu9fNpkBEWNjSNtdJHL9v0pQab9X8pnxaKoSUbVIUa8ueh8GeV0j9B8qLpkPasXst4evuSswNSYeyYu8EWzcSmT8ctourzLRpNcW7eo3wupFY9YzwztnOf0Isqp2+NFdYqdQtM9JOXg9gkkQFVkqH9yXZ+Ewkq1/UUsWaKAfbIrdXkcAtKaJK5sIOawoelIRc0xozrDeB2P3RXmkUj9RApJxOPlZ8oEYQ61u0N2NZOfBusBcAORGPaTecs5DH3zHJI8FnDH3jEVhoq1amMtMYVO9A9fkKQjZIltrG/gYwNlbDhza8ZMqJysGI2/26NytRnLDMf5a2Abg/+RVa1a+Fd+EdZhwX2itgVIQH0/eBF3HZrKLqY7SrYJWJstBIs4DoGRgmRH6VKE3IiaE4G+PA8auXQM6QMpy3tcxmRTXJrVRn+ILH+vhUOb5pbB/gs9w+JJI4REJ2WAdK/DDjetARroK5aB32tmQF4mk2UOC/sJW9lwmKoYh0kOsnhRoE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(8936002)(966005)(40480700001)(41300700001)(40460700003)(7696005)(426003)(2616005)(336012)(83380400001)(47076005)(316002)(82310400005)(110136005)(82740400003)(54906003)(36860700001)(81166007)(356005)(36756003)(44832011)(6666004)(5660300002)(7416002)(16526019)(8676002)(4326008)(478600001)(186003)(86362001)(70206006)(1076003)(70586007)(26005)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 18:04:36.6434 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfb8d8ab-f159-4f87-e6e8-08db3ab73643 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.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT105.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4131 X-Spam-Status: No, score=0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Robert Richter In Restricted CXL Device (RCD) mode a CXL device is exposed as an RCiEP, but CXL downstream and upstream ports are not enumerated and not visible in the PCIe hierarchy. Protocol and link errors are sent to an RCEC. Restricted CXL host (RCH) downstream port-detected errors are signaled as internal AER errors, either Uncorrectable Internal Error (UIE) or Corrected Internal Errors (CIE). The error source is the id of the RCEC. A CXL handler must then inspect the error status in various CXL registers residing in the dport's component register space (CXL RAS cap) or the dport's RCRB (AER ext cap). [1] Errors showing up in the RCEC's error handler must be handled and connected to the CXL subsystem. Implement this by forwarding the error to all CXL devices below the RCEC. Since the entire CXL device is controlled only using PCIe Configuration Space of device 0, Function 0, only pass it there [2]. These devices have the Memory Device class code set (PCI_CLASS_MEMORY_CXL, 502h) and the existing cxl_pci driver can implement the handler. In addition to errors directed to the CXL endpoint device, the handler must also inspect the CXL downstream port's CXL RAS and PCIe AER external capabilities that is connected to the device. Since CXL downstream port errors are signaled using internal errors, the handler requires those errors to be unmasked. This is subject of a follow-on patch. The reason for choosing this implementation is that a CXL RCEC device is bound to the AER port driver, but the driver does not allow it to register a custom specific handler to support CXL. Connecting the RCEC hard-wired with a CXL handler does not work, as the CXL subsystem might not be present all the time. The alternative to add an implementation to the portdrv to allow the registration of a custom RCEC error handler isn't worth doing it as CXL would be its only user. Instead, just check for an CXL RCEC and pass it down to the connected CXL device's error handler. With this approach the code can entirely be implemented in the PCIe AER driver and is independent of the CXL subsystem. The CXL driver only provides the handler. [1] CXL 3.0 spec, 12.2.1.1 RCH Downstream Port-detected Errors [2] CXL 3.0 spec, 8.1.3 PCIe DVSEC for CXL Devices Co-developed-by: Terry Bowman Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Cc: "Oliver O'Halloran" Cc: Bjorn Helgaas Cc: Mahesh J Salgaonkar Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-pci@vger.kernel.org --- drivers/pci/pcie/Kconfig | 8 ++++++ drivers/pci/pcie/aer.c | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig index 228652a59f27..b0dbd864d3a3 100644 --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig @@ -49,6 +49,14 @@ config PCIEAER_INJECT gotten from: https://git.kernel.org/cgit/linux/kernel/git/gong.chen/aer-inject.git/ +config PCIEAER_CXL + bool "PCI Express CXL RAS support" + default y + depends on PCIEAER && CXL_PCI + help + This enables CXL error handling for Restricted CXL Hosts + (RCHs). + # # PCI Express ECRC # diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 7a25b62d9e01..171a08fd8ebd 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -946,6 +946,65 @@ static bool find_source_device(struct pci_dev *parent, return true; } +#ifdef CONFIG_PCIEAER_CXL + +static bool is_cxl_mem_dev(struct pci_dev *dev) +{ + /* + * A CXL device is controlled only using PCIe Configuration + * Space of device 0, Function 0. + */ + if (dev->devfn != PCI_DEVFN(0, 0)) + return false; + + /* Right now there is only a CXL.mem driver */ + if ((dev->class >> 8) != PCI_CLASS_MEMORY_CXL) + return false; + + return true; +} + +static bool is_internal_error(struct aer_err_info *info) +{ + if (info->severity == AER_CORRECTABLE) + return info->status & PCI_ERR_COR_INTERNAL; + + return info->status & PCI_ERR_UNC_INTN; +} + +static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info); + +static int cxl_handle_error_iter(struct pci_dev *dev, void *data) +{ + struct aer_err_info *e_info = (struct aer_err_info *)data; + + if (!is_cxl_mem_dev(dev)) + return 0; + + /* pci_dev_put() in handle_error_source() */ + dev = pci_dev_get(dev); + if (dev) + handle_error_source(dev, e_info); + + return 0; +} + +static void cxl_handle_error(struct pci_dev *dev, struct aer_err_info *info) +{ + /* + * CXL downstream port errors are signaled as RCEC internal + * errors. Forward them to all CXL devices below the RCEC. + */ + if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC && + is_internal_error(info)) + pcie_walk_rcec(dev, cxl_handle_error_iter, info); +} + +#else +static inline void cxl_handle_error(struct pci_dev *dev, + struct aer_err_info *info) { } +#endif + /** * handle_error_source - handle logging error into an event log * @dev: pointer to pci_dev data structure of error source device @@ -957,6 +1016,8 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info) { int aer = dev->aer_cap; + cxl_handle_error(dev, info); + if (info->severity == AER_CORRECTABLE) { /* * Correctable error does not need software intervention. From patchwork Tue Apr 11 18:03:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bowman, Terry" X-Patchwork-Id: 1767760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=e+LB4dOW; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Pwv3D0Dq0z1yXv for ; Wed, 12 Apr 2023 04:08:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbjDKSIW (ORCPT ); Tue, 11 Apr 2023 14:08:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbjDKSIO (ORCPT ); Tue, 11 Apr 2023 14:08:14 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2074.outbound.protection.outlook.com [40.107.212.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D7586E90; Tue, 11 Apr 2023 11:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VIjwjJSQA1vN8iO0862himxM4p6zRzygQnvCL2KVDgqbgF6sMCdPY6ChV4+G6PcSH7TXNcSKMj9BqquJwSl8r4u0ajL3dKEQ3M3OJfSPhohT5XeXNky1BlDQobbiBd4Wzc6oi5z8OvpCg+6Fe9HsYdH6cznmrbl1ZL8p0+rmB8TeaqqZrA5pBetiAjopCo5RVQ/OUFOs53DIyt7r9cJvinxSBvaPtdeB8vPtw0IedTltFcz8blPSXbQLH8FEYXn1ZLOkKAde9AmWreaGKd2Lb6X57LBlkbNfp2iSKwNNBv3vdQX3fCZjHkNXmLFUlvD2tmraXVCG8UFwtGsnCRVWIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=o2zFiMs2oIqp2Cdsmd91Xau6Ybwk/eHR8N/sswJ3q5w=; b=QPeEBp1J76sxjxDvvebDyUE6dDKNVS3ZyMM57FqLAzADMOx/jbvk21wgGY6/trehTcfkEcDPQmkJl84WpXt5VheVvdyqBlqXIO+WCDI4nXYTYSpqLWc7nOVBWjYwGRf+UUTMAqhJ5jfacw4f/pndTVQ3dg4G88VmVuxkujgBQZrySCf9UxFM/tkVw5y0E3ffL+HVHgprOO/7bR6AtwotOM1NM2LU53QMT/tFLnRj2sre56640ztjtPUFqrn7VvGBimGXbkv1oQUtnKqhqvxrqVyf8bpngE6mVqbsHwbjYaEhMstV59yWExbiv+fNRvrjVGq/VcxGVQtoIho0LdT9ZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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 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=o2zFiMs2oIqp2Cdsmd91Xau6Ybwk/eHR8N/sswJ3q5w=; b=e+LB4dOWTtUba/lCdS/fki7n7bXhzeYN8XSppVLF7hI/MjlCJNrY+q4AGLYKh2xjMv/6aG04mY1RomA+79QXqXKLVP3aNdREgAAN0K03wvVDiKbu8JJNzO/xJIjUEt4TxD1Bb+Zl7hxcOLz0ZaN891BuWgueytzfrfjyAd0eiSY= Received: from BN9PR03CA0696.namprd03.prod.outlook.com (2603:10b6:408:ef::11) by MN0PR12MB6032.namprd12.prod.outlook.com (2603:10b6:208:3cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.34; Tue, 11 Apr 2023 18:04:49 +0000 Received: from BN8NAM11FT114.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::76) by BN9PR03CA0696.outlook.office365.com (2603:10b6:408:ef::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.40 via Frontend Transport; Tue, 11 Apr 2023 18:04:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) 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.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT114.mail.protection.outlook.com (10.13.177.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.28 via Frontend Transport; Tue, 11 Apr 2023 18:04:49 +0000 Received: from ethanolx7ea3host.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.2375.34; Tue, 11 Apr 2023 13:04:48 -0500 From: Terry Bowman To: , , , , , , , CC: , , , , Oliver O'Halloran , Mahesh J Salgaonkar , , Subject: [PATCH v3 6/6] PCI/AER: Unmask RCEC internal errors to enable RCH downstream port error handling Date: Tue, 11 Apr 2023 13:03:02 -0500 Message-ID: <20230411180302.2678736-7-terry.bowman@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411180302.2678736-1-terry.bowman@amd.com> References: <20230411180302.2678736-1-terry.bowman@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: BN8NAM11FT114:EE_|MN0PR12MB6032:EE_ X-MS-Office365-Filtering-Correlation-Id: ad78fed2-a404-40a9-905f-08db3ab73e0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4/c+xi/etY6MLRknICeekGbnE6bJxjNwp6pnt699UyTwdTs6N4zTSLLZav23gOPlFY0OJFZlksGJ4WeL04X3kAaE/mW3DFu2uVDWeftbFegM8swQ75SbvjitlrHq7czWB0IcgC5VmfqkBWr6KU8nPvsiwcEH+D9JyszdZlItcmdtYszyFHINa28INo+4vI0RxGzRLQPTEBUcRBfoAco5X8hIihmlVw8D6nl5C5W82B0xdKjDJdaBdluY5txM+5G9tUHdN67/kaSeYKoaJxV5fmVRfkaOpLmwd5zC4gw28+O/AmNWGbXFXI09TNlkbMW6go+LEwE/fmk9oGdnknHu7UwZtlc1am6VKYqfBzKR9QAtYG9qx3wh36E+63ysNiEFVcsrLdYIYVS26ciFYSRo+UOSvckLYrNvBXthggOomfCgsovrgwGBd3Aa2EEblWkuplsJalj4uQlox7lTYfIwx3QnDCszseAnFeEB8kY+rC30HhmGOicRc1KapYG6iGh5qr1g/rfgWM1vFSIOQThYJ5LQSEd6LCyBYYjrOPLK/NFUUX35TxRlqVORcYPlTpjHEX+C45xvXZqusK2D7rsoW2SgTU12ExvAwUbm+CP+2mp6P6H46Ja3RLbX1W5Sh1nEZWhSqgM2u91DE1dN4zQJ3+2eTe/jUnfoi2padZbxa1orT96pFRiG6ghZ1UC3ZTom90ucwBbmVDmget8FWesMX6ZI+zOvHGD/WjYem3kOHVn0vPrTA04JBdTz5ndraZ0kEilaiCF84ierqoYqB05T6A== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(346002)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(426003)(2906002)(26005)(336012)(16526019)(186003)(1076003)(2616005)(70206006)(47076005)(83380400001)(41300700001)(70586007)(8676002)(54906003)(7416002)(478600001)(110136005)(5660300002)(8936002)(40480700001)(7696005)(44832011)(6666004)(316002)(4326008)(81166007)(356005)(36860700001)(82740400003)(36756003)(82310400005)(86362001)(36900700001)(309714004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 18:04:49.6869 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad78fed2-a404-40a9-905f-08db3ab73e0c 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.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT114.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6032 X-Spam-Status: No, score=0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Robert Richter RCEC AER corrected and uncorrectable internal errors (CIE/UIE) are disabled by default. [1][2] Enable them to receive CXL downstream port errors of a Restricted CXL Host (RCH). [1] CXL 3.0 Spec, 12.2.1.1 - RCH Downstream Port Detected Errors [2] PCIe Base Spec 6.0, 7.8.4.3 Uncorrectable Error Mask Register, 7.8.4.6 Correctable Error Mask Register Co-developed-by: Terry Bowman Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Cc: "Oliver O'Halloran" Cc: Bjorn Helgaas Cc: Mahesh J Salgaonkar Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-pci@vger.kernel.org --- drivers/pci/pcie/aer.c | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 171a08fd8ebd..3973c731e11d 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -1000,7 +1000,79 @@ static void cxl_handle_error(struct pci_dev *dev, struct aer_err_info *info) pcie_walk_rcec(dev, cxl_handle_error_iter, info); } +static bool cxl_error_is_native(struct pci_dev *dev) +{ + struct pci_host_bridge *host = pci_find_host_bridge(dev->bus); + + if (pcie_ports_native) + return true; + + return host->native_aer && host->native_cxl_error; +} + +static int handles_cxl_error_iter(struct pci_dev *dev, void *data) +{ + int *handles_cxl = data; + + *handles_cxl = is_cxl_mem_dev(dev) && cxl_error_is_native(dev); + + return *handles_cxl; +} + +static bool handles_cxl_errors(struct pci_dev *rcec) +{ + int handles_cxl = 0; + + if (!rcec->aer_cap) + return false; + + if (pci_pcie_type(rcec) == PCI_EXP_TYPE_RC_EC) + pcie_walk_rcec(rcec, handles_cxl_error_iter, &handles_cxl); + + return !!handles_cxl; +} + +static int __cxl_unmask_internal_errors(struct pci_dev *rcec) +{ + int aer, rc; + u32 mask; + + /* + * Internal errors are masked by default, unmask RCEC's here + * PCI6.0 7.8.4.3 Uncorrectable Error Mask Register (Offset 08h) + * PCI6.0 7.8.4.6 Correctable Error Mask Register (Offset 14h) + */ + aer = rcec->aer_cap; + rc = pci_read_config_dword(rcec, aer + PCI_ERR_UNCOR_MASK, &mask); + if (rc) + return rc; + mask &= ~PCI_ERR_UNC_INTN; + rc = pci_write_config_dword(rcec, aer + PCI_ERR_UNCOR_MASK, mask); + if (rc) + return rc; + + rc = pci_read_config_dword(rcec, aer + PCI_ERR_COR_MASK, &mask); + if (rc) + return rc; + mask &= ~PCI_ERR_COR_INTERNAL; + rc = pci_write_config_dword(rcec, aer + PCI_ERR_COR_MASK, mask); + + return rc; +} + +static void cxl_unmask_internal_errors(struct pci_dev *rcec) +{ + if (!handles_cxl_errors(rcec)) + return; + + if (__cxl_unmask_internal_errors(rcec)) + dev_err(&rcec->dev, "cxl: Failed to unmask internal errors"); + else + dev_dbg(&rcec->dev, "cxl: Internal errors unmasked"); +} + #else +static inline void cxl_unmask_internal_errors(struct pci_dev *dev) { } static inline void cxl_handle_error(struct pci_dev *dev, struct aer_err_info *info) { } #endif @@ -1397,6 +1469,7 @@ static int aer_probe(struct pcie_device *dev) return status; } + cxl_unmask_internal_errors(port); aer_enable_rootport(rpc); pci_info(port, "enabled with IRQ %d\n", dev->irq); return 0;