From patchwork Wed Aug 23 23:43:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13363298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0F2DC88CB9 for ; Wed, 23 Aug 2023 23:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238712AbjHWXnm (ORCPT ); Wed, 23 Aug 2023 19:43:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236932AbjHWXnX (ORCPT ); Wed, 23 Aug 2023 19:43:23 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2077.outbound.protection.outlook.com [40.107.244.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1054C10DB; Wed, 23 Aug 2023 16:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EbcoupKUsGjvypmL5essOVDI7a6z4zH29CRCrS4dwbZS0xMDyTySFNVJ1epJE+fdVK+T1kWMHIQ8csuRj4ulR0wHJWqeKtU/DQCshMwNh2kh11H1Z5ZaKlYPEysrbZcWmFXSJWasmCd2WVq35UCUaaaIqlgHprq7o4gez2magcYoWip+AGfqdSgAIJ5GHfKuqBb/1KMM1NxAnjYtcQe02j5QBZScBrmfxQo41rik4eSf4ZB7ArwimcxJH+qjfRIADN77Fuj57vjOuA8l08GbCk0X+K8lMmb+4oR51uNrBn1zKWOUfbDSGH3HwhdzpNigwdEi18dokJz3NemtKUmb6w== 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=xEQDOtofzDNcuxxkpsvWr6bA/oWY/SgrOHxI+YzZGuw=; b=eAHS/RVDnKMikXtYnCgf38afjJibytjmrCYANj+sauxrW0td0VHtlZYSnldGTZ//UMzKH/pGnVX54/OrY6Z+m5Osh0ws0BXjWYx3yPFiy3RY4soJWZVYISTWwXuQzD2hfo+q7ZKhXDz/ejpuCnM9A/rgGe4pnIuki4k3cTnIy+LhFCrts6R1RoFoy35Yc0kzMt+CWsDSWShmL7gTb2j7QAjHKkdyqROHvGpz1j7F9tqku4qj2/LrQjK/w09kPKFMguZVtXC2yD4YyTiqTYao3xE30QqfEdITKvPWayhqpum0VddCk2bubhUuwVvwr+IRz6zMaDlQ05udGft7szWnTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) 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 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=xEQDOtofzDNcuxxkpsvWr6bA/oWY/SgrOHxI+YzZGuw=; b=x1JMHoE4opoBaVHrCHJIs5bNRm0HxU2FY6cDzlSlAeOovhYkqz4ZlFLbxH/y/A7z2yrhpu6/RxZAMxD1vVSZQLl8niRSEm0qiltFK3MEAg1di3SIUDr64tJMgw5eVRY19jt3HLhL8Rw6w6YVWbU2aPma8HowKFLj3GRrFseAdVY= Received: from CY5PR10CA0015.namprd10.prod.outlook.com (2603:10b6:930:1c::34) by DS7PR12MB6070.namprd12.prod.outlook.com (2603:10b6:8:9e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Wed, 23 Aug 2023 23:43:19 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:930:1c:cafe::f8) by CY5PR10CA0015.outlook.office365.com (2603:10b6:930:1c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.25 via Frontend Transport; Wed, 23 Aug 2023 23:43:19 +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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Wed, 23 Aug 2023 23:43:19 +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.27; Wed, 23 Aug 2023 18:43:17 -0500 From: Smita Koralahalli To: , , CC: Bjorn Helgaas , , Lukas Wunner , Kuppuswamy Sathyanarayanan , Mahesh J Salgaonkar , Alison Schofield , "Vishal Verma" , Ira Weiny , "Ben Widawsky" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , Robert Richter , Smita Koralahalli Subject: [PATCH v4 1/3] cxl/pci: Fix appropriate checking for _OSC while handling CXL RAS registers Date: Wed, 23 Aug 2023 23:43:03 +0000 Message-ID: <20230823234305.27333-2-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230823234305.27333-1-Smita.KoralahalliChannabasappa@amd.com> References: <20230823234305.27333-1-Smita.KoralahalliChannabasappa@amd.com> MIME-Version: 1.0 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: CY4PEPF0000E9DA:EE_|DS7PR12MB6070:EE_ X-MS-Office365-Filtering-Correlation-Id: 15127256-14bb-4600-20a1-08dba432bb03 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vxGWf6s0Ikq6YdrCE1HnjSEiyCxk2QCc4cEMeELWHItQyFJ4IE6i55noODRA+d88ek2dIVqAl8yqbgmJL4vDzJb/pW8ezBkYh+eJo5ffsXd+A/gooxXgzU89JZUNDcH+Bx1Lofx9eoTu45fMw2HozXVQQKk7uV6PYARmtiEww8GywULIks+WLmdVrqqfIooj9I/DHnNb+qfACbFnz/1O8DEcjZThNWfGTwqPPg2ECbDaJ1nzuXC4cArzX2KsHCoWY2R29yM0YqoSy8Y07EdoI1tew9kdnnNzE6PKkGFVprPNH4mwheacnOUwgNHhuVrvB3LgwRKNz7Iyqtx+DigZlKpq0NTMxuifHeahstskwjvYYA2BxvTm7oVjulC8dOLeVCdjEN+bWvKFE6CwD6sv1WvUj0j/D7+tTgZCdOo/TjSPwiKiggjvWGpFAaztxOdz8dfV04JsY3+73XPTef9YL9NrPxCHRSEReLXiwSo9V84eW71ybXe2LbV0ofoIrliVgs30sNdMt5FOY/hlLRUJKRlzbYuraQqoEcVkTsLHg6LruxtP7S6add/JRdpnZsxrQvO2C4P8mBwlMSfBv6ngbK+j3KMj4Uah8UXBPieMNb2m69+P2jHXW3ePznNiwTi09RJHtqA8iwXc+bY6viSPaotYsSVOCsOPPTLNHNv8+ht9PT1w7Rkt69vbxKDEkAhpqzizqRgeXfwEqGhAsWy7v/dvh9zOHFHAU+4pbQOR0zKRzx2YKUaI7x3xvG7JhvIsGE3IM3BEFnTiddZ2xkDlEA== 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:(13230031)(4636009)(136003)(396003)(39860400002)(376002)(346002)(186009)(1800799009)(451199024)(82310400011)(46966006)(36840700001)(40470700004)(54906003)(70586007)(316002)(70206006)(110136005)(8676002)(8936002)(2616005)(4326008)(36756003)(40460700003)(41300700001)(1076003)(356005)(82740400003)(81166007)(478600001)(6666004)(40480700001)(83380400001)(7416002)(2906002)(47076005)(7696005)(36860700001)(86362001)(426003)(336012)(5660300002)(16526019)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2023 23:43:19.4827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15127256-14bb-4600-20a1-08dba432bb03 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6070 Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org cxl_pci fails to unmask CXL protocol errors when CXL memory error reporting is not granted native control. Given that CXL memory error reporting uses the event interface and protocol errors use AER, unmask protocol errors based only on the native AER setting. Without this change end user deployments will fail to report protocol errors in the case where native memory error handling is not granted to Linux. Also, return zero instead of an error code to not block the communication with the cxl device when in native memory error reporting mode. Fixes: 248529edc86f ("cxl: add RAS status unmasking for CXL") Signed-off-by: Smita Koralahalli Reviewed-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang --- v2: Added fixes tag. Included what the patch fixes in commit message. v3: Added "Reviewed-by" tag. v4: "Reviewed-by" tags. Complete rephrase of the commit message based on Dan's comments. Added a comment why the patch is returning zero. --- drivers/cxl/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 1cb1494c28fe..2323169b6e5f 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -541,9 +541,9 @@ static int cxl_pci_ras_unmask(struct pci_dev *pdev) return 0; } - /* BIOS has CXL error control */ - if (!host_bridge->native_cxl_error) - return -ENXIO; + /* BIOS has PCIe AER error control */ + if (!host_bridge->native_aer) + return 0; rc = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &cap); if (rc) From patchwork Wed Aug 23 23:43:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13363297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89929C7EE2C for ; Wed, 23 Aug 2023 23:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238818AbjHWXnn (ORCPT ); Wed, 23 Aug 2023 19:43:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237911AbjHWXnZ (ORCPT ); Wed, 23 Aug 2023 19:43:25 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2086.outbound.protection.outlook.com [40.107.94.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D088010DC; Wed, 23 Aug 2023 16:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V3RyeVVU2OW82ilYPFDeVFCz9G3Gkrkwshqmfyeuw8S9GsXkm3CoHNZIZ23z82ZeIytGP8QKX6ZYH72XhVB/tF0BCo8gWDkKrw1pylqmxV4QaM2mLLkVC8LimVfO+Mo2TM61U/2gMSSbmMNndPWVO5yHxsHme/MRfZgj9pR/HIvc59HLxiYGyl3nP6xWpn7b6x37RGmSlqRV6tBlwyCa1W1i6QK7QqQKkGVFMR6jnsWpxfg/rhBVpxXXus7d9RL9LoPIgknTrdnHX4DvKne61vtPJHw+EzdKUPuk2ofXkC9fWFY+9sFemy5tMZB4S7vcvJOqJTSP9isowiHLTD0Z6A== 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=UwAcZXySfkxrGp64NTqVT3gGZZpUM9lOOGq3FeEf8h8=; b=BczHNsM8+kMuhH22W+cr3nWJMIHXvFruIA/0oI2QlzDeiQrHE0aXrR7jtKku5xL5NckG35vArdqwVkV9cc00D3SRuCX3OMRUeSD7kUoIOFQwL00pX0a2OxgSygM3o7cNIZMPefxVxyf/wzesabe0+r6ju7ayJJnrcQs2ItnchlDzCb+8SbiCX1MYt7nn1s8Pa15dmol5KYVgkTUyEYTW6YsuCrFRGUynFW/U0wgkObgltu4URua7glwijNMPGkHjLCcoA1+4z265W13gHpoR3DibchJoDGvfx23xHaQx+KBd8PKzNGvzVloqn1bnsgTjiWHUMDdCV+LlJtSP9MdQ8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) 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 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=UwAcZXySfkxrGp64NTqVT3gGZZpUM9lOOGq3FeEf8h8=; b=1GOj5j1MDb+MVVY52w90psqiz1NFP1OsIs0F1wMWvoSCxYTjqOAl65wJy96kPt+WCnP3sYM2kqw8UpeGK2VQuqZF1zDFFOyI2J1kkriYb7vo/2YWvd0NdJ/ibUgf+OLjjMPwnrWJd2ntJaO0g/LMeih2PaR0rhTwnVLZ/DHI5IU= Received: from CY5PR10CA0006.namprd10.prod.outlook.com (2603:10b6:930:1c::6) by MN2PR12MB4334.namprd12.prod.outlook.com (2603:10b6:208:1d1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26; Wed, 23 Aug 2023 23:43:20 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:930:1c:cafe::2b) by CY5PR10CA0006.outlook.office365.com (2603:10b6:930:1c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26 via Frontend Transport; Wed, 23 Aug 2023 23:43:20 +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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Wed, 23 Aug 2023 23:43:19 +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.27; Wed, 23 Aug 2023 18:43:18 -0500 From: Smita Koralahalli To: , , CC: Bjorn Helgaas , , Lukas Wunner , Kuppuswamy Sathyanarayanan , Mahesh J Salgaonkar , Alison Schofield , "Vishal Verma" , Ira Weiny , "Ben Widawsky" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , Robert Richter , Smita Koralahalli Subject: [PATCH v4 2/3] PCI/AER: Export pcie_aer_is_native() Date: Wed, 23 Aug 2023 23:43:04 +0000 Message-ID: <20230823234305.27333-3-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230823234305.27333-1-Smita.KoralahalliChannabasappa@amd.com> References: <20230823234305.27333-1-Smita.KoralahalliChannabasappa@amd.com> MIME-Version: 1.0 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: CY4PEPF0000E9DA:EE_|MN2PR12MB4334:EE_ X-MS-Office365-Filtering-Correlation-Id: 1daf0e14-5d2f-4c21-098e-08dba432bb4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DG2/F6DvBc0+VBIt7/OLpfb8iddomoB6PUCH8kUTPBhuxrHXhgv2ye+MxZ/alJYZGXLNzn7kndGDM/eC6vrjcoHjLIIp/2FjnCg2DVJB75n5Wuj4NdlqRW/JMXmKRMM3w+Tv9n9jcrD81JZpr/xANMUBSguFuLCj89hi5DEw2jBQU4xiv6bBGYyF+ILuschvHtKIS1f++LV40YsmuWU2SG3TjjjNdkWfO7x5h4V2+tSzt6Bf8UfRDI6mBfuj5tQgzeceQMvmVfAtZFW+B85RTCWG00/74VQ6dvNxGZgHEhWju69fYeWeMvLx6Ufxx8Hrhvelu8vn7heJDBWBNj8+L3bun2ncxbGQiNmqFwB30LQJ22/Zxg7uQkZQ1eOs1ftRHr7wzOsRiNxMefuFRjUeOpu0ZGpPamGs21Kkj9gGc1PM2thXqSHXgZa8UCJUNjQCuFAykMqBH/esUDlC+BO6fUfL9EMDqTdCS8D8sgwyLRCweL4+lV3qURjpKDuo0JvNsoud6e7Fq3vdOQfi8n5OMhMv23pu7X/5gWoY4lu651re7jZcBce5V1QQC2eD5fOWxjH3bEWsJYJlE2wKz3ti+uL7ELinoxq8KExRDWnqDNCmSpRI06ZFPwkAp3Oj7w/n7tZ2j1BpLlz/W/ufV2Jsl9tZYzMAlwE4HZNJnrGWls+ihS1PUhadRnJtfNuK/xcDlPK/xo/xu3RiLze2XFZzIJEkvgf5so/ohKoXwlOHA1DNsZ+oX9mp1P6QNlmlyje5WlCK6WKm04PHzUY1d42A9w== 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:(13230031)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199024)(82310400011)(186009)(1800799009)(36840700001)(46966006)(40470700004)(478600001)(86362001)(36756003)(54906003)(316002)(7696005)(70586007)(110136005)(70206006)(6666004)(81166007)(41300700001)(8676002)(4326008)(8936002)(5660300002)(82740400003)(1076003)(356005)(26005)(2616005)(16526019)(7416002)(83380400001)(336012)(426003)(40480700001)(40460700003)(47076005)(2906002)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2023 23:43:19.9671 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1daf0e14-5d2f-4c21-098e-08dba432bb4d 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4334 Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org Export and move the declaration of pcie_aer_is_native() to a common header file to be reused by cxl/pci module. Signed-off-by: Smita Koralahalli Acked-by: Bjorn Helgaas Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang --- v2: Fixed $SUBJECT v3: Added "Reviewed-by" tag. v4: "Reviewed-by" tags. EXPORT_SYMBOL_GPL(pcie_aer_is_native) -> EXPORT_SYMBOL_NS_GPL(pcie_aer_is_native, CXL) --- drivers/pci/pcie/aer.c | 1 + drivers/pci/pcie/portdrv.h | 2 -- include/linux/aer.h | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index f6c24ded134c..8ee12827e2d8 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -229,6 +229,7 @@ int pcie_aer_is_native(struct pci_dev *dev) return pcie_ports_native || host->native_aer; } +EXPORT_SYMBOL_NS_GPL(pcie_aer_is_native, CXL); int pci_enable_pcie_error_reporting(struct pci_dev *dev) { diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 58a2b1a1cae4..1f3803bde7ee 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h @@ -29,10 +29,8 @@ extern bool pcie_ports_dpc_native; #ifdef CONFIG_PCIEAER int pcie_aer_init(void); -int pcie_aer_is_native(struct pci_dev *dev); #else static inline int pcie_aer_init(void) { return 0; } -static inline int pcie_aer_is_native(struct pci_dev *dev) { return 0; } #endif #ifdef CONFIG_HOTPLUG_PCI_PCIE diff --git a/include/linux/aer.h b/include/linux/aer.h index 3a3ab05e13fd..94ce49a5f8d5 100644 --- a/include/linux/aer.h +++ b/include/linux/aer.h @@ -45,6 +45,7 @@ struct aer_capability_regs { int pci_enable_pcie_error_reporting(struct pci_dev *dev); int pci_disable_pcie_error_reporting(struct pci_dev *dev); int pci_aer_clear_nonfatal_status(struct pci_dev *dev); +int pcie_aer_is_native(struct pci_dev *dev); #else static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev) { @@ -58,6 +59,7 @@ static inline int pci_aer_clear_nonfatal_status(struct pci_dev *dev) { return -EINVAL; } +static inline int pcie_aer_is_native(struct pci_dev *dev) { return 0; } #endif void cper_print_aer(struct pci_dev *dev, int aer_severity, From patchwork Wed Aug 23 23:43:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13363296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 597D2C71153 for ; Wed, 23 Aug 2023 23:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238835AbjHWXnn (ORCPT ); Wed, 23 Aug 2023 19:43:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237231AbjHWXnY (ORCPT ); Wed, 23 Aug 2023 19:43:24 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C7E10CA; Wed, 23 Aug 2023 16:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FUxpEdeb1wKg9c+OAciEr8KHJ66dFs925Ot4Zx5MdSomgVIAM0hWe+3ZGr+eohi5a24TwGoJ6CMDeaYFRL14mmBjeCzqIzlJLefVBkT6b0ikLmK49TxeYI7mIGo0sg/Bwx0rsGwakxXGriPirgI5PGHX8AQCA/Y4UC5NEYJ1wihkSHtoJ7Vij+x4zKcLULY5Bd/0G8dSzTZL9AbImA2Ytu+pwwcRqs4iRSiyhAajuvsyWT1IiMe/hB1Q920NXT8DDnms5waoI0r1WvBU3y41J8eZbpiwWKnqoNLi25LBXNEOxr/DNG834EbTXt1DhCqomT2E6zjHCGSWodu2foqdCA== 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=pa8LkD68VuMhzP3AVJE3fgnl/waNovkmLFkpeUWMd5Q=; b=LsJNhMROR7C+HNVlb2UxKWUaznXGqp6FL6mqqoy7V8r4ydcaAE/WEqoE7xZwEBfl1vCoL2AUz7AKyAqHVorKL999qJqREXiBlqRXc3h8KqJGtF0oi15SBF1HoIbM5YomNxuQ9wByrkCT9BRmBhPcdN/f0mBNa7x2hXko5IjtH3D3oMrQMORcr+qqEuuy12PfPh0rEvW8mGbXvwbj+z9Utuili/QxJ/u+BRZa5qsxM6I07IkgklK/AMPU06OZvwBO2yjDcH4e3Y4Qku7zz/1LXGbyQH4JtKVkbdSaeNzNqiQIkjbWx5AIVRdakc8pzixMzrvEKAZqPUK9ycWLMB87JQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) 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 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=pa8LkD68VuMhzP3AVJE3fgnl/waNovkmLFkpeUWMd5Q=; b=X2DKeqZ0gmgNA3og/sU2+CpKMBMfkmOkCLubDr+jcIs94bv68y/7ccc4lBdzQ9HWwMVmdDRAujZMRr5ZFOCgeVgL8YJqlk4il19+w4iK8O8Z5Ha81WbB2L5XUgzpqiOs/TDA+lRaRo0s2eUFADI/eIOUue3x80Ly5WuskLeEkIU= Received: from CY5PR10CA0005.namprd10.prod.outlook.com (2603:10b6:930:1c::18) by SJ0PR12MB8139.namprd12.prod.outlook.com (2603:10b6:a03:4e8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Wed, 23 Aug 2023 23:43:20 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:930:1c:cafe::27) by CY5PR10CA0005.outlook.office365.com (2603:10b6:930:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26 via Frontend Transport; Wed, 23 Aug 2023 23:43:20 +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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Wed, 23 Aug 2023 23:43:20 +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.27; Wed, 23 Aug 2023 18:43:19 -0500 From: Smita Koralahalli To: , , CC: Bjorn Helgaas , , Lukas Wunner , Kuppuswamy Sathyanarayanan , Mahesh J Salgaonkar , Alison Schofield , "Vishal Verma" , Ira Weiny , "Ben Widawsky" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , Robert Richter , Smita Koralahalli Subject: [PATCH v4 3/3] cxl/pci: Replace host_bridge->native_aer with pcie_aer_is_native() Date: Wed, 23 Aug 2023 23:43:05 +0000 Message-ID: <20230823234305.27333-4-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230823234305.27333-1-Smita.KoralahalliChannabasappa@amd.com> References: <20230823234305.27333-1-Smita.KoralahalliChannabasappa@amd.com> MIME-Version: 1.0 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: CY4PEPF0000E9DA:EE_|SJ0PR12MB8139:EE_ X-MS-Office365-Filtering-Correlation-Id: eda58d8a-2d44-4c38-1973-08dba432bb9e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPSoNQ3NQmMPVdDQBgioOzWjr95NqMeEK6u5SW3jvSimfw6zKeBWW2jBfi8RcHuykAPs8DDGWLhfEeEGlELxRV6ujoMjGIwL9WghnxQPKDYR8K/w4yvStEvFJ8Aos9IFZaHZw6TyhMOrzLrZi81n1OJU0U0kJBpeM8YcapPo+oyptu1+yakvZLge61oTDbgw5Mcans0D9GeSwXEzd+p20ocVl4t1JNIqjH2hs+gujWGb5HaXHjWNYeenpInRIRAsaLN1Lq+C7LhZdQOjJkCZ5JlwjMBqFOUtSqC29eYBzlLcz6ccIxcTifG9wK06JK0UnmFho0tJBq0ImVYoqWLRD7qvUOY9NWIjx2j7MF95cHkB1mwKPWsKbiFDnwfr3hi2D5EkRlRtOJk0hNnIFI4CNp/slV7BF3S1gFF0JmhMHf4L7wRU5wrOJ3zzgcQtFK6EtgD1lKIxUQ5waNFSmm2YsnuowDp7JUWguujegJEdofvPTujY8Ot7iWWSVgc4GLObA+yR4qqxvFiYwHkC6gSvS2QDRt909YkPmrjInFvVNZuMWdKhyKnWtfw+TcXgK8TlmUWj14hLCp7sLeHRJW5Y2y3hLF/mIxSKXrCh9Pl2AaNV/3cIT98enCpsiwxVl56scTmDj3FgJvk+cMiNGAJHXmq+sQmvWqxmgsf2qltL+94UXhbJ5WMYH/tEPq7DRqBscZfhJ2f3sQc4rqOvLrW4VwY2rQDK3J38bydFBCbPAdBjW+g4M2xV8F816Je9alS9BRQeodhZNZ6A21AnR91yPw== 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:(13230031)(4636009)(376002)(39860400002)(396003)(346002)(136003)(1800799009)(82310400011)(451199024)(186009)(40470700004)(36840700001)(46966006)(40480700001)(2616005)(54906003)(41300700001)(110136005)(81166007)(70586007)(316002)(6666004)(70206006)(40460700003)(7696005)(82740400003)(356005)(1076003)(26005)(16526019)(8676002)(8936002)(5660300002)(36860700001)(47076005)(4326008)(426003)(7416002)(83380400001)(2906002)(336012)(86362001)(36756003)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2023 23:43:20.5140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eda58d8a-2d44-4c38-1973-08dba432bb9e 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8139 Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org Use pcie_aer_is_native() to determine the native AER ownership as the usage of host_bride->native_aer does not cover command line override of AER ownership. Signed-off-by: Smita Koralahalli Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang --- v2: Replaced pcie_aer_is_native() at a later stage for automated backports. v3: Added more context to commit message. Added "Reviewed-by" tag. v4: No changes. Just "Reviewed-by" tags. --- drivers/cxl/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 2323169b6e5f..44a21ab7add5 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -529,7 +529,6 @@ static int cxl_pci_setup_regs(struct pci_dev *pdev, enum cxl_regloc_type type, static int cxl_pci_ras_unmask(struct pci_dev *pdev) { - struct pci_host_bridge *host_bridge = pci_find_host_bridge(pdev->bus); struct cxl_dev_state *cxlds = pci_get_drvdata(pdev); void __iomem *addr; u32 orig_val, val, mask; @@ -542,7 +541,7 @@ static int cxl_pci_ras_unmask(struct pci_dev *pdev) } /* BIOS has PCIe AER error control */ - if (!host_bridge->native_aer) + if (!pcie_aer_is_native(pdev)) return 0; rc = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &cap);