From patchwork Fri May 19 10:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 96385 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1154201vqo; Fri, 19 May 2023 04:18:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gJFeiR8bmqcQ4g6rdY0tVq12vPPtglyV72ttXqMCjjAhoOjOulVdNMM2WuQUPSiGxcGJh X-Received: by 2002:a17:903:124e:b0:1ab:afd:903a with SMTP id u14-20020a170903124e00b001ab0afd903amr2740701plh.24.1684495113711; Fri, 19 May 2023 04:18:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684495113; cv=pass; d=google.com; s=arc-20160816; b=Lm6me22tG/LaJXgdAJJnBiOi0rWtC2NXLiLRPkmwxx8q7B/tGUbiMdc6whuagh/eTe nnAEMFdQ5+7+b0sVYPeByxlDYIQZEcFPoO/O5NvFjGOn9alhvoAbr5CIM1AcOEf91srm FqrztN4m7qUEKU2QYL9eXWbcUcP8GNNLiw4nSwbgoon8JxFW5W6JEVsz5uCjsUP1epCE WNYcRdy6sAUqWsl5fAezg0B0buKEm8yiKD97BPjPsqbDVpyx+tmxxkgjJmhJdxEHIeYg D1nh7+XeEWOcypiln86myVhb9YkmGRjN+faXlnGDinEJ/QlVW18U2kufA3rrWIHud5Vk k4kQ== 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=Ex4dGX1NmePJIH6JHUf9op1FoyIeZ5/0qV3oXXYH6SE=; b=s6iCqZJcU96C+PEkuH5eT9xjjCNHrQluiB+RbEiF00T2yiWMjmif8nd6jcautsbCzJ 356vRRo4Rv42JkrLV/L5vxMuAmMqFTZlSHqbn08o34DYvH8hzK1r4mGhdtbfrv15BVQK +I+nq2PJYZBgohTC5gVT00SB8nIWTUMkdITZ27EjZMV5GfBl72C8pglkALPYLmWKImAh bdFwhD3iC2WDSa+AyQBg0/2RAYZ+UT/I8qR8p1dyMiL3CGK5jT99J7jI4vZKQZ8Yr1LI UpKddNDGxL1Gil9NTylhRIRbQag37T6gPbsCDOLD1dvLCTPdi1TomQQ6W9pxPcO45CQU g2YQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=xkWXlyJR; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a170902ac8800b001ac83d2b070si3327882plr.334.2023.05.19.04.18.18; Fri, 19 May 2023 04:18:33 -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=xkWXlyJR; 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 S231747AbjESLAD (ORCPT + 99 others); Fri, 19 May 2023 07:00:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231772AbjESK7y (ORCPT ); Fri, 19 May 2023 06:59:54 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9D8113; Fri, 19 May 2023 03:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzMJEfay+FHonLVPgbG6oE9gAdExZyQ9N4IgqQz02t8y7mmRHAk0SysHVwmhaOgoDZE01sdhfUA0taCvlRCTn2z+5znR6seKnlJLeqH3AKGex+cUaPqUOeVLBq0N0Pbr+4DHOLuPUHszJa55NXO8zzrh7ct4nYNkZo8BfCAO2hXwya8qgGeYIrP6+ANlrwXrfRhMAeZNmNyDvMDWnBflNcM8cQAlpJBjtNoPgDf1+FnO3iU76vzjksedK4Ge0+ZNSQ5mXMGAuSZ1dotj0mxmfcdanDJNxIK7nOYQ5bxelKyLsqWP01bdmh4pku/Mrv8eD38TwtonWJFALokziVVIOQ== 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=Ex4dGX1NmePJIH6JHUf9op1FoyIeZ5/0qV3oXXYH6SE=; b=VBIIxoewE5qXBkp2vFgMnMINQEYF35pPNrjXb06kEbdvy7eBPubyryzsbwetah9eTCNtDTvl5gwEFhmDMftfCeYJclYSy+wk5dc19Nk7rxwNLuZyEG9nxpGMe/6Z48rI1i6bzSHJ/qhOZUFEgY6+X2Tt33Jcy/6UXi3ik0PRUYNWX81nPX+W7eykbu2genxxwFFFXWVaC4NWzlxI+5+k3DqPlxb6miM7UUcFaLrXomcWFMWw/30jXtJnpUCRkFO8Php+5jA3WAZeNla/OwyRFv9J7s/Tr+ufZr3ME6+VlDJFRQU7rOF7kV0/c25iiTreZKtiICRZTu3sG6zb3FK1UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=Ex4dGX1NmePJIH6JHUf9op1FoyIeZ5/0qV3oXXYH6SE=; b=xkWXlyJRroq5kpFLWuAUoc9beqp6x02Mn6Istl1yDRe18D0BkodzYeHMLGkJf9sykX2rBWdgWa/ErjEd32A4/L07z8N+/Zv4jqNnmlvoZ/wOAVXLvMqOof3FffyDp1+g78l//RwOWo8H+1hryOz9d1efzzGHYe3HrlZjdebAqGo= Received: from MW4PR03CA0140.namprd03.prod.outlook.com (2603:10b6:303:8c::25) by CY8PR12MB8314.namprd12.prod.outlook.com (2603:10b6:930:7b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Fri, 19 May 2023 10:59:50 +0000 Received: from CO1NAM11FT092.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8c:cafe::44) by MW4PR03CA0140.outlook.office365.com (2603:10b6:303:8c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 10:59: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT092.mail.protection.outlook.com (10.13.175.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 10:59:50 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 19 May 2023 05:59:49 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Fri, 19 May 2023 03:59:49 -0700 Received: from xhdthippesw40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 19 May 2023 05:59:46 -0500 From: Thippeswamy Havalige To: , , , , , CC: , , , , , Thippeswamy Havalige Subject: [PATCH v3 1/3] Move and rename error interrupt bits to a common header. Date: Fri, 19 May 2023 16:28:59 +0530 Message-ID: <20230519105901.2399452-2-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230519105901.2399452-1-thippeswamy.havalige@amd.com> References: <20230519105901.2399452-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT092:EE_|CY8PR12MB8314:EE_ X-MS-Office365-Filtering-Correlation-Id: 418cd5bd-a601-4633-c6fd-08db58582af1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BD3ghUu+1/iOuvMH1jxPWHK8GizD0l2HN9O/cBovj0RIyc7zaCblzX4Lbr/WN1AycjuVNsH40yXLXzextzhfG+fmCgMsl98msYFqcliJ1ldD7maawkvzEjODtushQKvmJbdU0soxXGxkMlQwUwiimHHL6dYN5tcxAbSc15nbi8SQOik1/Ng59lUBGbMrkjXOgDrfEv9U2RHUb4KJ/ETQnvI4ztVWtxjwQ0gm8AZ92JZF+tHS5tXwtHxWioQR6q1hwnJCa23mfHlFA3S5OEaMhjkllF/Ns7EUyDIyRGGvI9f4tmPSWpjOGN9j3j2cWB/5VJ7fBi8ZVwHzTqTApwjjmfvlG/x8pIdx5ztcW74jENII2qGmsCttC6pmytiHV0Yd6n9nBfGdGFb7g3+/R1Pw89ejyxQNU11dz9JaIdW2BDSD8OfWjqCssvglzunu9xOJ+fRY5e+Q89rkj8yGfThG3PDAP8BkH+n05eqp+eoSZ0ZeqerfZ8O6j7DcuJd2Qv4jVbsnwcwE2YRnPDdT3MvyJclc2z7QKvQG7zry+xBokGFPJNFhpo4yA6X5ywKJdXEJVHVeh6pZ9KZkaAtIofobfoqzxjQsBNoFEONJY1Cx6HiX+JRYl8xQp0WYh34j5Y527vSLkULNbG4vRubkX0D/Jp0cX70LwKZcHtn1Offb/+q27/s9IH742rXt6cTNhWNzF2dCxDRWcxJ3WCy4dmrlVONQfDMStu2bTYRuihRUCSIaFcYhJZrA2Hfxb5gVCkuGOl7nAiGrBDW4oDNyUwnj3w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(396003)(376002)(136003)(451199021)(36840700001)(46966006)(40470700004)(2906002)(316002)(478600001)(41300700001)(8676002)(4326008)(8936002)(110136005)(54906003)(5660300002)(44832011)(6666004)(70206006)(70586007)(1076003)(26005)(40460700003)(81166007)(186003)(82740400003)(356005)(83380400001)(36860700001)(40480700001)(47076005)(426003)(36756003)(82310400005)(2616005)(336012)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 10:59:50.2193 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 418cd5bd-a601-4633-c6fd-08db58582af1 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT092.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8314 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766321148218316320?= X-GMAIL-MSGID: =?utf-8?q?1766321148218316320?= Move and rename error interrupt bit macros to a common header file for code reusability. Move common linux header files for reusability. Signed-off-by: Thippeswamy Havalige Signed-off-by: Bharat Kumar Gogada --- changes for v3: - changed licensing year to 2023 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 000000000000..e97d27252a08 --- /dev/null +++ b/drivers/pci/controller/pcie-xilinx-common.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * (C) Copyright 2023, 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 4a787a941674..a0f5e1d67b04 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;