From patchwork Mon Jun 17 20:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bowman, Terry" X-Patchwork-Id: 13701339 X-Patchwork-Delegate: bhelgaas@google.com Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2077.outbound.protection.outlook.com [40.107.92.77]) (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 9DE1EE542; Mon, 17 Jun 2024 20:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718654681; cv=fail; b=FExAF3cMRij72Z+/CoQ2NgcQz/cQ8AzDmRqyg5rqbqp+FxHqz5CnJgLMwI1jOM1UlYHmVgrXqssAB/irdPyiHl/1Z/j+t9PbB4KssTAiGEKoCdK4YHxehhKZ/2Nn40/w8y8ySsD2qJt6SukGlo0DVYshvo+rwJbFvJ9va5142MM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718654681; c=relaxed/simple; bh=iIiWo71BMYN6t41ECHNmO95zl1J+plKfADdgKrkqbuM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gpGCtPDOZW9iP/dym/ROaF9go8Pix+nB/BMqFBPUCFQ4b00cpmcxxa5PKUD7Qraho0qI2PeSY/EsqvClscSclNM/LdzBbgk1sc/F2QxmmKHbplfVwJ76on15pbuwFcLK9LGMfPJ0suhBpZt5KX3oh9nA7pMZjx1QnzwyOpJRHnw= 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=d+4hLdFp; arc=fail smtp.client-ip=40.107.92.77 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="d+4hLdFp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nOhHJqwMb96627X8NvtgHGqBETDBZXsBbO6wOvCDaIiER5kzdDPmTs0DF6fmf6/h5G8HQJ4IY1agFbhzyvLPX7WOgXU1ngNPLB7chlv3Fht1R+Sq4B6eTpSFvVgTgGEvPsu4aTCsvdXnxWj36DBjs63C+x+boAKmX/xvGN3xquFX9adh3f6loQdHgZBn9mKRZ/UIs9+en9lvsPh0Nt9nP6epXE7ngsLj4RYh92BrV4570lO4ZduObObU2+CcFjE8NXlYWyXwQCoC+QVQaTs19rTYq1LtLg6O0OHIL6ozTe49TkhM3b5br1SE/5EactitH0JEVu5YOLymAxw0r3wj7w== 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=l7tuKWOBSNUKoTf6tuLn8VCStoGfSAplcLpQhO77+xE=; b=A6CAPtmCz3/WgNYe/fPU0G4UQabrYa9rgnJNrA9AKiMRt0fYP7fR4MWLxprvsebby/c16GgZx7kaTA3DljsXuy+0zeMO/s+01/cEh+UsgDo1eZ0oH6qjotWF0X2bQwAp7ATdl/h1Y1wG015sbPNHRDBch7TC6NjtjQ/m5UuMmzZmgR3KBp3Hyvbg2PI3GdGLTCDRfoWpqRe33A/rErPGY4XKSpO3DSigOYQ2gVpdday3gOVesO20wT0N676wXgvayyV4iVXnp4l7jj5QUm9aKTvBXxVzlIByN4sEyQAXMfi8YpTJg+AwK3Hb9TI8oNlqUYXKQJYAfRrhAviJpSzY5Q== 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 (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=l7tuKWOBSNUKoTf6tuLn8VCStoGfSAplcLpQhO77+xE=; b=d+4hLdFpZpRa3vEUPtNqjrmMhWOFS7ImTJffyE/zcLWnDIB9AlkLra4Lod/EWboTvraJ5Ox2iTfbYwjFiwo5rEyoF1KghpkDZsNQ/rYOLIQiZ+Z2GAFtAtxIez7acwL2634/bCl/uoNwZKtpq8IdMCr/057lzRZ99LHSvqMfUxM= Received: from SJ0PR03CA0001.namprd03.prod.outlook.com (2603:10b6:a03:33a::6) by DS0PR12MB7771.namprd12.prod.outlook.com (2603:10b6:8:138::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 20:04:36 +0000 Received: from CO1PEPF000044F3.namprd05.prod.outlook.com (2603:10b6:a03:33a:cafe::aa) by SJ0PR03CA0001.outlook.office365.com (2603:10b6:a03:33a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30 via Frontend Transport; Mon, 17 Jun 2024 20: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 CO1PEPF000044F3.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 20:04:35 +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.2507.39; Mon, 17 Jun 2024 15:04:34 -0500 From: Terry Bowman To: , , , , , , , , , , , , , , , CC: Bjorn Helgaas , Subject: [RFC PATCH 1/9] PCI/AER: Update AER driver to call root port and downstream port UCE handlers Date: Mon, 17 Jun 2024 15:04:03 -0500 Message-ID: <20240617200411.1426554-2-terry.bowman@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240617200411.1426554-1-terry.bowman@amd.com> References: <20240617200411.1426554-1-terry.bowman@amd.com> Precedence: bulk X-Mailing-List: linux-pci@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: CO1PEPF000044F3:EE_|DS0PR12MB7771:EE_ X-MS-Office365-Filtering-Correlation-Id: e58444e7-03bc-45b9-5c50-08dc8f08b63a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|7416011|36860700010|1800799021|82310400023|921017; X-Microsoft-Antispam-Message-Info: iD7a1SFXbbi2gOuYIOFa8M/2RtMT0ZA2kuz2Qo5SnypwJZ8/SeCtucrZU02otwHs057ziJLqLqevlYrCdW40mlvCFaxOEBTSAk7ScW8IPM7f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bZI4bU+iKz032F7pW6xA9BSbz4lDXMWu9M10N5N/t6/BJpMmBDzF9Ffk8ru1XxyiYlzSmIssmOCV593QjudLASMhwcpImZ7EPodmuaCqrSZ2CPS3q52sAL4yy0MaUJjCVIHR+EE4XEc5S2IeMRp4y/h+E/rF3yXfpszv2mXLEuJ3OYX6CTwrAmka+wOZOhPiKRyimH1hKlg5mOE2w0un0rtPWoZy+6dXFrHF8kCfU1uKvpVNIzfUhF2TixJoRnKno= 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:(13230037)(376011)(7416011)(36860700010)(1800799021)(82310400023)(921017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 20:04:35.7993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e58444e7-03bc-45b9-5c50-08dc8f08b63a 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: CO1PEPF000044F3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7771 The AER service driver does not currently call a handler for AER uncorrectable errors (UCE) detected in root ports or downstream ports. This is not needed in most cases because common PCIe port functionality is handled by portdrv service drivers. CXL root ports include CXL specific RAS registers that need logging before starting do_recovery() in the UCE case. Update the AER service driver to call the UCE handler for root ports and downstream ports. These PCIe port devices are bound to the portdrv driver that includes a CE and UCE handler to be called. Signed-off-by: Terry Bowman Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org --- drivers/pci/pcie/err.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 705893b5f7b0..a4db474b2be5 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -203,6 +203,26 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, pci_ers_result_t status = PCI_ERS_RESULT_CAN_RECOVER; struct pci_host_bridge *host = pci_find_host_bridge(dev->bus); + /* + * PCIe ports may include functionality beyond the standard + * extended port capabilities. This may present a need to log and + * handle errors not addressed in this driver. Examples are CXL + * root ports and CXL downstream switch ports using AER UIE to + * indicate CXL UCE RAS protocol errors. + */ + if (type == PCI_EXP_TYPE_ROOT_PORT || + type == PCI_EXP_TYPE_DOWNSTREAM) { + struct pci_driver *pdrv = dev->driver; + + if (pdrv && pdrv->err_handler && + pdrv->err_handler->error_detected) { + const struct pci_error_handlers *err_handler; + + err_handler = pdrv->err_handler; + status = err_handler->error_detected(dev, state); + } + } + /* * If the error was detected by a Root Port, Downstream Port, RCEC, * or RCiEP, recovery runs on the device itself. For Ports, that