Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3958107rdg; Wed, 18 Oct 2023 10:31:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSJf7HjmS3gzEpVph6Gl13pAR1e97c+1x87ppGMJMKRtxfpy/eyfl4WRRtk3gZ6vkpswKG X-Received: by 2002:a05:6a21:999c:b0:17a:f2ed:e921 with SMTP id ve28-20020a056a21999c00b0017af2ede921mr5914007pzb.55.1697650302702; Wed, 18 Oct 2023 10:31:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697650302; cv=pass; d=google.com; s=arc-20160816; b=elyEpmyo+syE7yeVTrWdjvPQFxLuEcVDmAkrpK7Eq3/vko8S/BeoWX47b+ZXYTpAhN 1pb61qGCjxnP38hh5tOI4FMjMAO32XrjVuPphFj7DhIvoC97wSilv3m6MUfGD3NeH0Ju t0p2wuM3OooOeC5dXUb82awQ4r8ahRVnAxrH9GP9eYp1yyGNvT/R5HE+8BK/HmYgsFEU sv7RQ6uxcdH+g8YZy8TbxAw5Y/pCyiFISjAXcpWB1ODXt9QKokWz8juXMtG7Kc+qu3/Q kU/oBVNBN3G+1uLTR+1aVqGBjNn8vAtBiG3LP2yeuIs8jraUajkeAJdSFYifih4SaNfs F5Mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3HBEJ0Wnnrej7ZFG4v4zI4otawjUFMMAynClT7d6q2I=; fh=lT5cDZAkLbHkWUydy57qUVYfuFRX5uHMqaFyamEbyNc=; b=qr19Y+yYxJ1nodevnjdqNDGoZRqTqc6bkGQNvE0AslYCIc2WIa0OqDf1sWKomR5Ir4 96yOYXNsagqcPxk5sK69uOG/OP0i6t6pNgmWNj7MvHc52poMUR20hWRhby35IalRG5PD 4h34agP70RQlSbJRBzj74xEHty1kxcReJrIOunl/pja6lVpDUNkGcQuffweX3tjVxHNt r53JhOqv54hAPCyYfUf0qIz1UPNoJh3cquUrSpVXFB4q/Y1Gwajg+Xk6I0VOPUPpsc5h 0/b85xY9J2naQjnw0ff/AAEy/9ka9MucsvJwRtH8R51ghpkgnVVHA00kypHH2haP1NN2 Q4Kw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2zcRQhfH; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p12-20020a170902bd0c00b001c74d844254si303245pls.101.2023.10.18.10.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:31:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2zcRQhfH; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 63D4282072C3; Wed, 18 Oct 2023 10:31:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231376AbjJRRaQ (ORCPT + 99 others); Wed, 18 Oct 2023 13:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbjJRR3u (ORCPT ); Wed, 18 Oct 2023 13:29:50 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2073.outbound.protection.outlook.com [40.107.93.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55630324B; Wed, 18 Oct 2023 10:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7hgNMDo/E/SzLArtt2/3jeMzuGzGL2Y8Ko0d+zoqD8zoKed+7hg6YW+8QgZWC7CdCgXQtAjplIZgCKlOUMaqOe7VDheNJHowob5PlMxEX7ro0dBd37XYbC4pmIwXxwSPb+d+vk2Iv0rvQYwIo2KKimD3V51UsTd5VthS522/t3AqThX7ugdFql9IMdcJd5Nob30762yns5DpIkM3jhXVDW1BHk6np4WmhsQGcGPuwzosV3H2bw3Xni3KiV3qSu6mbQu4p7EjvRzflr7hfvPONJbzTduxYn9wYy92f5NPxEQGdoRJx1VmvhH4vGQ9yuvzMUL0Cw9NmLAWozxXonaBw== 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=3HBEJ0Wnnrej7ZFG4v4zI4otawjUFMMAynClT7d6q2I=; b=MeH0BjSpwUsuy0zrfUSsX36eiXnKx+aIHF+rF4jDWa77yW9qKI4BQSBKTOmSW2a3TDUTr9QJtvpgwdAs1NCFh4ZcMM/pQeMZ0uo8yUnG+m6JtRCuaNgW5xrgaaA1AF5VTS4HzX1KhbYh5tXVCYpDNlj5RKwkkiR0oRmX+YaThL1PB1DPuaiUPMfzPwXA1FUPZ452rFqWB8gfDtPVCLl7istlkjse92c0tEgoDIeyy0bqIDAuyIIv8o65g1TnQyQ4IVNZ791o33D1320dJOS5SHXyGZNNX12DQad1a3tJiFuWzPSKZ1u0hAtqv/wRVAYf6uocEdRyXXgpbxxvzAJvjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=stgolabs.net 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=3HBEJ0Wnnrej7ZFG4v4zI4otawjUFMMAynClT7d6q2I=; b=2zcRQhfHWTSu4+PnaMsCINsGyaQwbNlhtHUOcWyme4mV3+hJeCke8uKtPGq+mmZV9PKsoZmrt5efbziU0FGUi3qeByxr0Cu8ieFeBuP/OK4tq3PCYZ6zpSg4Qgr6kR0neNsE8/eyETzlhx0sJjz26hjWuMr5YAcb40zXtGO+67U= Received: from PR0P264CA0176.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::20) by IA1PR12MB6329.namprd12.prod.outlook.com (2603:10b6:208:3e5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Wed, 18 Oct 2023 17:19:51 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10a6:100:1c:cafe::bd) by PR0P264CA0176.outlook.office365.com (2603:10a6:100:1c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Wed, 18 Oct 2023 17:19:50 +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 SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Wed, 18 Oct 2023 17:19:48 +0000 Received: from rric.localdomain (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.27; Wed, 18 Oct 2023 12:19:07 -0500 From: Robert Richter To: Davidlohr Bueso , Jonathan Cameron , Dave Jiang , "Alison Schofield" , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams CC: , , Bjorn Helgaas , Terry Bowman , Robert Richter Subject: [PATCH v12 10/20] cxl/pci: Introduce config option PCIEAER_CXL Date: Wed, 18 Oct 2023 19:17:03 +0200 Message-ID: <20231018171713.1883517-11-rrichter@amd.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231018171713.1883517-1-rrichter@amd.com> References: <20231018171713.1883517-1-rrichter@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|IA1PR12MB6329:EE_ X-MS-Office365-Filtering-Correlation-Id: acdd0be0-b800-46e7-c82e-08dbcffe6ec1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /OigQgQc2/+zG/U+E0iQfHzFcOXLo+3owwYu/cCXcUl6Pg3z+6RccBssxFbbV0BsJt6mL4O3TtSJOkqLIjibnYnIZnpGorYMdBXurXfZS+/tjEhE1iS3NjyKxmolwaawfrZJmM6g4MSuilBuFxfC7cinpr7t3XIJU1aXZz7QwmC2pOGQhbBv2g+zpOdBzuhURUQgNoiY8MD7ZgrSjEpdXs6o2sBLfxS7ulDTR0UbCjW6bg9DG51D5wWO1ytvbo/FEZPGbsfHeZgLziZ/+h1NSLQtnAwI3Cjk4xQXlHCb4u/j2Zmmik5rTaU7yLxJ3JvN+iqzDHL49smzAFXQpmaDWJ40GCTGvY+0TSCC/4T7c5AdpqYHk7M2KwqKZj5xoGCmnDssZzcmM2MXgIx4XmIp/2f2faE8X/uIyE9tfrOWX1GqtZRvpQeFBmikY2z/uU7jZsnzzAk6UweL2jBSFBrANzBx1HJiNISZTaoDPK5re3LIEWssmoRGQZNSIotynBx9wdjSaqC5Htulu96fwCPHP+InRfWaF7dzcKHPJyMjzbzY722naH3cqiq1EjVUBpIYPbMN01OjF7rvoLz3flUkE/QoJFBKw4Rv1Aqhf7rp6EaSCUd78+ynkpZjwqsJBVZ+3gYksd96R0dHanOOsPbiO4Gdv5mYH/9mGrbxcqXTV3KSptDsstIq0AfDjq8xyt45X42oV+NrsSMSxUHCec/O3UGV+f9sk56REbWppocvE36VXPqqcMa2+ZpUMVvdGOpcNHxKPhGSOk8K4oqEuM5FGA== 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:ErrorRetry;CAT:NONE;SFS:(13230031)(4636009)(136003)(39860400002)(346002)(396003)(376002)(230922051799003)(186009)(1800799009)(82310400011)(64100799003)(451199024)(40470700004)(36840700001)(46966006)(40460700003)(40480700001)(478600001)(16526019)(2616005)(1076003)(6666004)(41300700001)(336012)(426003)(26005)(316002)(5660300002)(54906003)(70206006)(70586007)(356005)(110136005)(82740400003)(36756003)(83380400001)(36860700001)(81166007)(47076005)(8676002)(8936002)(4326008)(2906002)(7416002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 17:19:48.9112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: acdd0be0-b800-46e7-c82e-08dbcffe6ec1 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: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6329 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:31:33 -0700 (PDT) CXL error handling depends on AER. Introduce config option PCIEAER_CXL in preparation of the AER dport error handling. Also, introduce the stub function devm_cxl_setup_parent_dport() to setup dports. This is in preparation of follow on patches. Note the Kconfg part of the option is added in a later patch to enable it once coding of the feature is complete. Signed-off-by: Robert Richter --- drivers/cxl/core/pci.c | 9 +++++++++ drivers/cxl/cxl.h | 7 +++++++ drivers/cxl/mem.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index c7a7887ebdcf..7c3fbf9815e9 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -718,6 +718,15 @@ static bool cxl_report_and_clear(struct cxl_dev_state *cxlds) return true; } +#ifdef CONFIG_PCIEAER_CXL + +void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport) +{ +} +EXPORT_SYMBOL_NS_GPL(cxl_setup_parent_dport, CXL); + +#endif + pci_ers_result_t cxl_error_detected(struct pci_dev *pdev, pci_channel_state_t state) { diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h index c07064e0c136..cdb2ade6ba29 100644 --- a/drivers/cxl/cxl.h +++ b/drivers/cxl/cxl.h @@ -704,6 +704,13 @@ struct cxl_dport *devm_cxl_add_rch_dport(struct cxl_port *port, struct device *dport_dev, int port_id, resource_size_t rcrb); +#ifdef CONFIG_PCIEAER_CXL +void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport); +#else +static inline void cxl_setup_parent_dport(struct device *host, + struct cxl_dport *dport) { } +#endif + struct cxl_decoder *to_cxl_decoder(struct device *dev); struct cxl_root_decoder *to_cxl_root_decoder(struct device *dev); struct cxl_switch_decoder *to_cxl_switch_decoder(struct device *dev); diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c index 04107058739b..e087febf9af0 100644 --- a/drivers/cxl/mem.c +++ b/drivers/cxl/mem.c @@ -157,6 +157,8 @@ static int cxl_mem_probe(struct device *dev) else endpoint_parent = &parent_port->dev; + cxl_setup_parent_dport(dev, dport); + device_lock(endpoint_parent); if (!endpoint_parent->driver) { dev_err(dev, "CXL port topology %s not enabled\n", -- 2.30.2