Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9850699rwr; Thu, 11 May 2023 23:31:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56kuZ7Za2J/QBaK878MVrKEn2TDl2umRvbZiIMwqbbMQ47NdNK9eGg2V+smT3g+n09WTDo X-Received: by 2002:a17:90b:4b07:b0:234:31f3:e00f with SMTP id lx7-20020a17090b4b0700b0023431f3e00fmr23686866pjb.43.1683873092567; Thu, 11 May 2023 23:31:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683873092; cv=pass; d=google.com; s=arc-20160816; b=YwjJ8GuO9EYm9kqYzPWecMuHZbu9AwIWsku9gqEITZz9UJl7V2SoLDSXH806NOCtFv JuFELIbvom7TnDJEp0k5S4VczWq/eR65oED814RV6obm+e+F11jiGR/7Cd2K85Vbfdco nwQkzuubdTWmMarEYqMaW5R77JgABFb8lLShY+RdboGoqdpC6xyRU0QMSfP64LCoeW+M KtF9gdQu+58upv2Q7/jYQwGyeOFY8GG69QlM0U5ULopNRVxqkdwEEW9xEWv67DN5oPpw M8SeLTFpIKI+gY2KhqiCjAIe1gyzPquIkjq2FFY6HA/fx6b1CQYtjg+xNKvxWOmEqW9Q 38pA== 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=ZMfd5zeAWPiO6U3xpBiHIWEGqsh1BgkQfzXu9Pz6u5w=; b=IpjS1hflbRSH5uzBD9OmV0B6XxgF3B7QeVg0BA/MX04VnGQOBPTqWxAABHVBuI86ol B5khSUaCc1q91VTG8d4iIjiVfs2V8MM+uC4mAiB9j02F+tZ6GC0UtGnZnJXtcRGl0s4+ 6uXpUZQLFFUDxXtBxD85owaRn6GJ+NKtCW+GM0nz7RIypi6KmcYE9lAW4lKn/I4jEaC0 qIT00jtQKFTIRTreXnpBzUqZIRXMTXDBXOsK2nERuXjnP6GF6z07dQtK3Mlsr1NxHWST rndVa2F2LJat4EB4yOz6wGCF/0c8iPEFezyeaGLWyC3Pc3U5xsGhkfT7h8ef0j4FQd0t NuIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=VffnGvsw; 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::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo1-20020a17090b1c8100b00244930ffe45si37524498pjb.0.2023.05.11.23.31.18; Thu, 11 May 2023 23:31:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=VffnGvsw; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239938AbjELG16 (ORCPT + 99 others); Fri, 12 May 2023 02:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbjELG1y (ORCPT ); Fri, 12 May 2023 02:27:54 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72DB21BDF; Thu, 11 May 2023 23:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gEqrUv5Wway6vTswXBw75eeKJSEwBMdfJefbbJ1hL0E9dyMU+3lQplY7KHw3HDFJqO8N1VfB0ZbHngj/OndzyTnvWWSF9n6vDkZBtPv7hM+1U0wclQZl6mqss+L37JvZDyCCjKCMuj35g+wyLD1C2d2dwNbuZw1kwpLwBEJLvSuUo7o3DxridTr9ADzYkLpCwVc4+KTqWEE3fthzgirSYjdg11udOC0f6GT5v13pTKCQKPdAFbOC8qlQUbmKvMY6Ou5jV5EQrQrjxdIJ0mY2s2P84rT8YLSbs2IY7UPsGNT/B8IBPGoR32FB8K1gppHLY6DQ2Hu/dgvV8fAL/9O/wQ== 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=ZMfd5zeAWPiO6U3xpBiHIWEGqsh1BgkQfzXu9Pz6u5w=; b=Q/4n2zcYvrLH4h9spVtHcEEas5JZovVkXe3IAC2mjC+yTYkwH1R2UumV14UPItL6amPUMM7Pemg2hB5LYrIaOfq7UxzbETXBPU8MKW4cZI5ShYkwT6W0Irk4cO655KtzYMM6OISHJlZOwml4Ez5+VECypLuZ5D8jaiDNp+H8S1yNWLuGx2oYKTIPuMWFLWl5/kUfin1trMosIZN92Ybp0VLmbXjNgcYrPeo31pPtxo6GyPfPkroqmIA85WzQjQIIgM+3ThylRcwhysRTytYT4wWSARYHr9eWx1Xb3WsqeMqs2wLhO/TcTbD/LiN/cM4DxoAu/0deNU44r3pkdYi3QQ== 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=ZMfd5zeAWPiO6U3xpBiHIWEGqsh1BgkQfzXu9Pz6u5w=; b=VffnGvswvGFUco1pmfdfINHQrZEINe+9xMWurjcISl4YDeL8+w+8EyAPM1b+DLRb5HKpJszXBsbGZY+fN24tCn7Yj7on6pPjVRPEX0nKlZj+dbN45tMG7jQxCuoBHmg7S0GnUMlebhXy41sg3zzu4brYwA1Ljqw72FNvUY5qkNY= Received: from MWH0EPF00056D0B.namprd21.prod.outlook.com (2603:10b6:30f:fff2:0:1:0:b) by CH3PR12MB8901.namprd12.prod.outlook.com (2603:10b6:610:180::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21; Fri, 12 May 2023 06:27:51 +0000 Received: from CO1NAM11FT109.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::204) by MWH0EPF00056D0B.outlook.office365.com (2603:1036:d20::b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.5 via Frontend Transport; Fri, 12 May 2023 06:27: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 CO1NAM11FT109.mail.protection.outlook.com (10.13.174.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.23 via Frontend Transport; Fri, 12 May 2023 06:27:50 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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; Fri, 12 May 2023 01:27:49 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 11 May 2023 23:27:49 -0700 Received: from xhdthippesw40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 12 May 2023 01:27:46 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , , Thippeswamy Havalige Subject: [PATCH v2 1/3] Move error interrupt bits to a common header. Date: Fri, 12 May 2023 11:57:23 +0530 Message-ID: <20230512062725.1208385-2-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230512062725.1208385-1-thippeswamy.havalige@amd.com> References: <20230512062725.1208385-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT109:EE_|CH3PR12MB8901:EE_ X-MS-Office365-Filtering-Correlation-Id: ae4af758-990c-4015-db75-08db52b202a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8b5qaQaehuBSI8nCXL4/KikOiJvrdeXX670zDIQGJfvUvIlEXRo/sLLwnWGv/A5kfqInlbnFQcj4faPC3KjK4rlXCx/HT4egLOKCdYz2IA2i2FDQYh+GlokNVlti8Cv5jtiU9kgMfa6aLv1Dk0YTC+qhzdibFOk25kWo6FFWq9PBbDeG4Gl+vos56DcfcvNHpVbiitj2HJ5MAHD/t0/3kRrUZUblOkvGF4+6F03/xi/6Isnk1y4+5CagUNpuOEbG8MwiyBeoyaCQCgUSN64rdDt4sv39KNd7+9G1409irpdSvkXCZjJUXGv8HKT1UR/8kvt8gjn8LqYqapLaeZi0t1j9yrMfWd5KvLjvE+KKTw/Ok3wxJIWtzW62i9tMiLF5GVASarcmd9R7Ks6cH/B8UekjUu5DOxpQZDOVDB+bURFHRLv1ArAVKfXvaZmSyPcp5tJrHSBD7R8z7JmGjpH79UbrASS0WrHTM9x9/bgw1TCCJHqHz0XTp8wKZ0rGxZUYWABBddDJJ8MaXH9/Qrxjkz4MnfD35aErRuRsW+tgdSvYecBDIelKKWBAdx93ql+oggU+jL/c2lQCs9zJnFeQoGmaL2PFfzDpWnsxwujha+si8bxSb1R4Zx1JjukgTHMeTSir6Hrbtpw1QXliqV3YPbCnP/cr1Q/503NHAR8TFuaVTxNVn0HyenBOZLwiPDpbNfGGbJqrkD8JLUzS1W+Bt346o8uk/8ueLTZUt1j8uYsySJWWC3lUSJImNI9ZV8fW1RcWsYbq6DXk/mW0iTBaaw== 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)(39860400002)(376002)(396003)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(2616005)(83380400001)(336012)(41300700001)(47076005)(6666004)(26005)(186003)(1076003)(426003)(478600001)(40460700003)(110136005)(54906003)(82740400003)(4326008)(40480700001)(70206006)(70586007)(316002)(81166007)(82310400005)(356005)(5660300002)(8936002)(44832011)(8676002)(36756003)(86362001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 06:27:50.2844 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae4af758-990c-4015-db75-08db52b202a1 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: CO1NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8901 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,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, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-kernel@vger.kernel.org Moving error interrupt bit macros to a common header file for code reusability. Signed-off-by: Thippeswamy Havalige Signed-off-by: Bharat Kumar Gogada --- drivers/pci/controller/pcie-xilinx-common.h | 30 +++++++++++++++++++++++ drivers/pci/controller/pcie-xilinx-cpm.c | 38 ++++++----------------------- 2 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 drivers/pci/controller/pcie-xilinx-common.h diff --git a/drivers/pci/controller/pcie-xilinx-common.h b/drivers/pci/controller/pcie-xilinx-common.h new file mode 100644 index 0000000..015dba3 --- /dev/null +++ b/drivers/pci/controller/pcie-xilinx-common.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * (C) Copyright 2019 - 2020, Xilinx, Inc. + */ + +#include +#include +#include + +/* Interrupt registers definitions */ +#define XILINX_PCIE_INTR_LINK_DOWN 0 +#define XILINX_PCIE_INTR_HOT_RESET 3 +#define XILINX_PCIE_INTR_CFG_PCIE_TIMEOUT 4 +#define XILINX_PCIE_INTR_CFG_TIMEOUT 8 +#define XILINX_PCIE_INTR_CORRECTABLE 9 +#define XILINX_PCIE_INTR_NONFATAL 10 +#define XILINX_PCIE_INTR_FATAL 11 +#define XILINX_PCIE_INTR_CFG_ERR_POISON 12 +#define XILINX_PCIE_INTR_PME_TO_ACK_RCVD 15 +#define XILINX_PCIE_INTR_INTX 16 +#define XILINX_PCIE_INTR_PM_PME_RCVD 17 +#define XILINX_PCIE_INTR_SLV_UNSUPP 20 +#define XILINX_PCIE_INTR_SLV_UNEXP 21 +#define XILINX_PCIE_INTR_SLV_COMPL 22 +#define XILINX_PCIE_INTR_SLV_ERRP 23 +#define XILINX_PCIE_INTR_SLV_CMPABT 24 +#define XILINX_PCIE_INTR_SLV_ILLBUR 25 +#define XILINX_PCIE_INTR_MST_DECERR 26 +#define XILINX_PCIE_INTR_MST_SLVERR 27 +#define XILINX_PCIE_INTR_SLV_PCIE_TIMEOUT 28 diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c index 4a787a9..77d95e6 100644 --- a/drivers/pci/controller/pcie-xilinx-cpm.c +++ b/drivers/pci/controller/pcie-xilinx-cpm.c @@ -16,11 +16,9 @@ #include #include #include -#include -#include -#include #include "../pci.h" +#include "pcie-xilinx-common.h" /* Register definitions */ #define XILINX_CPM_PCIE_REG_IDR 0x00000E10 @@ -38,29 +36,7 @@ #define XILINX_CPM_PCIE_IR_ENABLE 0x000002A8 #define XILINX_CPM_PCIE_IR_LOCAL BIT(0) -/* Interrupt registers definitions */ -#define XILINX_CPM_PCIE_INTR_LINK_DOWN 0 -#define XILINX_CPM_PCIE_INTR_HOT_RESET 3 -#define XILINX_CPM_PCIE_INTR_CFG_PCIE_TIMEOUT 4 -#define XILINX_CPM_PCIE_INTR_CFG_TIMEOUT 8 -#define XILINX_CPM_PCIE_INTR_CORRECTABLE 9 -#define XILINX_CPM_PCIE_INTR_NONFATAL 10 -#define XILINX_CPM_PCIE_INTR_FATAL 11 -#define XILINX_CPM_PCIE_INTR_CFG_ERR_POISON 12 -#define XILINX_CPM_PCIE_INTR_PME_TO_ACK_RCVD 15 -#define XILINX_CPM_PCIE_INTR_INTX 16 -#define XILINX_CPM_PCIE_INTR_PM_PME_RCVD 17 -#define XILINX_CPM_PCIE_INTR_SLV_UNSUPP 20 -#define XILINX_CPM_PCIE_INTR_SLV_UNEXP 21 -#define XILINX_CPM_PCIE_INTR_SLV_COMPL 22 -#define XILINX_CPM_PCIE_INTR_SLV_ERRP 23 -#define XILINX_CPM_PCIE_INTR_SLV_CMPABT 24 -#define XILINX_CPM_PCIE_INTR_SLV_ILLBUR 25 -#define XILINX_CPM_PCIE_INTR_MST_DECERR 26 -#define XILINX_CPM_PCIE_INTR_MST_SLVERR 27 -#define XILINX_CPM_PCIE_INTR_SLV_PCIE_TIMEOUT 28 - -#define IMR(x) BIT(XILINX_CPM_PCIE_INTR_ ##x) +#define IMR(x) BIT(XILINX_PCIE_INTR_ ##x) #define XILINX_CPM_PCIE_IMR_ALL_MASK \ ( \ @@ -323,7 +299,7 @@ static void xilinx_cpm_pcie_event_flow(struct irq_desc *desc) } #define _IC(x, s) \ - [XILINX_CPM_PCIE_INTR_ ## x] = { __stringify(x), s } + [XILINX_PCIE_INTR_ ## x] = { __stringify(x), s } static const struct { const char *sym; @@ -359,9 +335,9 @@ static irqreturn_t xilinx_cpm_pcie_intr_handler(int irq, void *dev_id) d = irq_domain_get_irq_data(port->cpm_domain, irq); switch (d->hwirq) { - case XILINX_CPM_PCIE_INTR_CORRECTABLE: - case XILINX_CPM_PCIE_INTR_NONFATAL: - case XILINX_CPM_PCIE_INTR_FATAL: + case XILINX_PCIE_INTR_CORRECTABLE: + case XILINX_PCIE_INTR_NONFATAL: + case XILINX_PCIE_INTR_FATAL: cpm_pcie_clear_err_interrupts(port); fallthrough; @@ -466,7 +442,7 @@ static int xilinx_cpm_setup_irq(struct xilinx_cpm_pcie *port) } port->intx_irq = irq_create_mapping(port->cpm_domain, - XILINX_CPM_PCIE_INTR_INTX); + XILINX_PCIE_INTR_INTX); if (!port->intx_irq) { dev_err(dev, "Failed to map INTx interrupt\n"); return -ENXIO; -- 1.8.3.1