From patchwork Sun Jun 6 08:22:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Om Prakash Singh X-Patchwork-Id: 12301907 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0745EC4743D for ; Sun, 6 Jun 2021 08:22:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFF4161420 for ; Sun, 6 Jun 2021 08:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbhFFIYP (ORCPT ); Sun, 6 Jun 2021 04:24:15 -0400 Received: from mail-co1nam11on2058.outbound.protection.outlook.com ([40.107.220.58]:35169 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230003AbhFFIYO (ORCPT ); Sun, 6 Jun 2021 04:24:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfyM3ZLlZOxO0emvSj1cYHu/rP042UhX4Z17NQd77W+ZmFhZGbXiGRpE+1J/GdfY1vlH0lWJRYQVrGK5JG+VWgSj5Lymeuo1sIQhIhlJkbvKQrTTXBdUsaXZC/z6LZTWQll+cj3uBZEVjM24rKGHHC0aolJkWmBrKBvz5/xnjysOINcPLDqKZyfGRvqHKSlNUrF8S3Z6rhL0w/K6ZqSxBU9wJIyRBU8PstJh8Mpc0DHbEoN8sb4a+dVwGGY4nuo/KbVgftfRtu3jnjcRjxU/8ymIzyIT1GcRhnf1pBU1rTCLZV2fZZPAIOwLMpsC9fJsrAJND8q/YU5aLADMCJ+Tag== 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-SenderADCheck; bh=sZnEPQXIHG9MoWEiFDSr/UJvBI9FLxc04k/qdesXp2Q=; b=Ce4hmmS2vEnADZkycmra7iv3/kNmtYOEb/RbHjV/f6NmJWdAcBMChySJ1XQAnggni4r0eF4Pmnit7jAs5/VdeSMpSu5u5sbFnGCKJXb886CIigkhGSgseme7krDyBXreUV3SIhcOXYM9wL+zMN/N70WbNqQS8QErPaS6YIM9btufquPtwpM9cYr6lObrs51Wr3O+ua1XQJcHo9eJdEVMXNPpBb4pWGHml3Hq3fLP1iKgjp8zD7s50S/hrJcWpD3XvSW6tg8fTMBvKTD0/2/plkEJYjVmyZasYwwHQalFt119oCzROSciONWNj4MzF92iKjovzcoiCOlfKFU11vhwIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZnEPQXIHG9MoWEiFDSr/UJvBI9FLxc04k/qdesXp2Q=; b=TIJcLtgixGmZIt2KBrXIu1NUrPBotz9ugMJmSmxEiUnWFzfbqY/zwZ9JFBhF6SxxtsTIQ+P7VDg+jh3H4wExjuBeM298DgfJwyBO5BjSD5zy0k+ULpvn1w3NbrKeHpWoyHQEIkf4689he0rurPkQdNHummpVeHGEExqDikeYm2FVX3v1wKbDuoDTnwjuq++yHvgvWD1OtMyPQE2kVZm2r6aMcTvbsMtTnSHfohbMGA10ZCoLHmGTkBP8lJZqJj7MXL7qrA5lkT4G/SSIAdrD5ximUZR0hbmtpUiAU1tG5XkhwH+FbYTJMOP4wbiP7rV7wxndW1ezkaztEM4PBocTPw== Received: from BN9PR03CA0140.namprd03.prod.outlook.com (2603:10b6:408:fe::25) by CY4PR12MB1622.namprd12.prod.outlook.com (2603:10b6:910:f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Sun, 6 Jun 2021 08:22:23 +0000 Received: from BN8NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fe:cafe::ed) by BN9PR03CA0140.outlook.office365.com (2603:10b6:408:fe::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT037.mail.protection.outlook.com (10.13.177.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:22 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 6 Jun 2021 01:22:22 -0700 Received: from buildserver-hdc-comms.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 6 Jun 2021 08:22:18 +0000 From: Om Prakash Singh To: , , , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V2 1/5] PCI: tegra: Fix handling BME_CHGED event Date: Sun, 6 Jun 2021 13:52:00 +0530 Message-ID: <20210606082204.14222-2-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210606082204.14222-1-omp@nvidia.com> References: <20210606082204.14222-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be20e93e-d9b6-48bf-217f-08d928c435d8 X-MS-TrafficTypeDiagnostic: CY4PR12MB1622: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tBVI++F/a/Gtfer1iNEH9TwfX0mTj97NHZTZe22z0m4SXA1ojByne2Z+sRJA17582Jd/pQcKVI4TLZVaVdwCH8rSmAlUywNz5Up3lJG0t+qISm03ap3jxpfJkGR40kKN283dQu/Fs6cyAGkX3pnOW//+7Z62WW3zaAWa7H9KVyy5Hz9WEd5bAnvJwKsSeYvvwzvkyxy/WqVFRAl+FOt1B40ctFsP+MbE1/UVeobUG6GcStZiNaHxWAFO8thHabf/WfYisKDvXS3cBOYKCxckHRG6E4F+qqZmYOyYkJY4qyvXsYTgDAgxA/GeRh0ZPtW7FvHsSybb+HcFa7Z2qdcbIPS26mneNminP7jYE/4ijnytKoOM8+xzrSEdfYkHF6UIe/j23N6+xbVxnQuDr3cG55T4y62ObN7D6aiKZUdYwSOHJ0umxihGNG1Qv39kpSkhGY2p6H6g2vOPaYo9Wb4kUbLDtDcRfL8sdXvOxlRauVHyS8Mx86hKH+UbHDG7vIcksNaTSqnpBQVsZ0NX6EawDzJ50K8AJsFUO2FHP/UTeuCVArIPWZ8LGMyRXsXGg/IHhqCjgnTlVAGKolvsEEZwu9oVsUbIdKU1wqy37ettBI7s55HIHFN+sGq+bjrBj6ynKKXqovxf2V8vSnPY/bfXpGLx44GdL02hFWGsews1xAg= X-Forefront-Antispam-Report: CIP:216.228.112.32;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid01.nvidia.com;CAT:NONE;SFS:(4636009)(376002)(39860400002)(396003)(346002)(136003)(46966006)(36840700001)(7696005)(426003)(86362001)(478600001)(8936002)(336012)(36860700001)(5660300002)(36756003)(82310400003)(2616005)(8676002)(47076005)(186003)(1076003)(70206006)(70586007)(26005)(7636003)(83380400001)(4326008)(6666004)(2906002)(356005)(316002)(107886003)(82740400003)(54906003)(110136005)(6636002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2021 08:22:22.9807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be20e93e-d9b6-48bf-217f-08d928c435d8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.32];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1622 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In tegra_pcie_ep_hard_irq(), APPL_INTR_STATUS_L0 is stored in val and again APPL_INTR_STATUS_L1_0_0 is also stored in val. So when execution reaches "if (val & APPL_INTR_STATUS_L0_PCI_CMD_EN_INT)", val is not correct. Signed-off-by: Om Prakash Singh Acked-by: Vidya Sagar --- Changes in V2: - Update variable naming as per comment from Bjorn Helgaas drivers/pci/controller/dwc/pcie-tegra194.c | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index bafd2c6ab3c2..6f388523bffe 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -615,19 +615,19 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) struct tegra_pcie_dw *pcie = arg; struct dw_pcie_ep *ep = &pcie->pci.ep; int spurious = 1; - u32 val, tmp; + u32 status_l0, status_l1, link_status; - val = appl_readl(pcie, APPL_INTR_STATUS_L0); - if (val & APPL_INTR_STATUS_L0_LINK_STATE_INT) { - val = appl_readl(pcie, APPL_INTR_STATUS_L1_0_0); - appl_writel(pcie, val, APPL_INTR_STATUS_L1_0_0); + status_l0 = appl_readl(pcie, APPL_INTR_STATUS_L0); + if (status_l0 & APPL_INTR_STATUS_L0_LINK_STATE_INT) { + status_l1 = appl_readl(pcie, APPL_INTR_STATUS_L1_0_0); + appl_writel(pcie, status_l1, APPL_INTR_STATUS_L1_0_0); - if (val & APPL_INTR_STATUS_L1_0_0_HOT_RESET_DONE) + if (status_l1 & APPL_INTR_STATUS_L1_0_0_HOT_RESET_DONE) pex_ep_event_hot_rst_done(pcie); - if (val & APPL_INTR_STATUS_L1_0_0_RDLH_LINK_UP_CHGED) { - tmp = appl_readl(pcie, APPL_LINK_STATUS); - if (tmp & APPL_LINK_STATUS_RDLH_LINK_UP) { + if (status_l1 & APPL_INTR_STATUS_L1_0_0_RDLH_LINK_UP_CHGED) { + link_status = appl_readl(pcie, APPL_LINK_STATUS); + if (link_status & APPL_LINK_STATUS_RDLH_LINK_UP) { dev_dbg(pcie->dev, "Link is up with Host\n"); dw_pcie_ep_linkup(ep); } @@ -636,11 +636,11 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) spurious = 0; } - if (val & APPL_INTR_STATUS_L0_PCI_CMD_EN_INT) { - val = appl_readl(pcie, APPL_INTR_STATUS_L1_15); - appl_writel(pcie, val, APPL_INTR_STATUS_L1_15); + if (status_l0 & APPL_INTR_STATUS_L0_PCI_CMD_EN_INT) { + status_l1 = appl_readl(pcie, APPL_INTR_STATUS_L1_15); + appl_writel(pcie, status_l1, APPL_INTR_STATUS_L1_15); - if (val & APPL_INTR_STATUS_L1_15_CFG_BME_CHGED) + if (status_l1 & APPL_INTR_STATUS_L1_15_CFG_BME_CHGED) return IRQ_WAKE_THREAD; spurious = 0; @@ -648,8 +648,8 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) if (spurious) { dev_warn(pcie->dev, "Random interrupt (STATUS = 0x%08X)\n", - val); - appl_writel(pcie, val, APPL_INTR_STATUS_L0); + status_l0); + appl_writel(pcie, status_l0, APPL_INTR_STATUS_L0); } return IRQ_HANDLED; From patchwork Sun Jun 6 08:22:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Om Prakash Singh X-Patchwork-Id: 12301909 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 837A0C4743E for ; Sun, 6 Jun 2021 08:22:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7210B613EF for ; Sun, 6 Jun 2021 08:22:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbhFFIYU (ORCPT ); Sun, 6 Jun 2021 04:24:20 -0400 Received: from mail-mw2nam10on2081.outbound.protection.outlook.com ([40.107.94.81]:12896 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230193AbhFFIYT (ORCPT ); Sun, 6 Jun 2021 04:24:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aE/CvRWuSKtDr4zBFiVnVxif280qZNd6PmGm4GS2JsDKyVlVz8dK1MLSlDrrCniDnXGyzsjUunt4oxbu6uaLzUTqJfhzlDArppD0RpYo5xo9LgErhnjCSHC/5qj8UFlDnh+pwUXb7pVNJ9tXqAdYcOZYwvh4Dh1sAkpzuB8qxWGmiwl1O4ylOh6MY3mxYqaF9446Vx68jZMOJQAPo1tj7vQGrvMn0DwxZzPR/iy7ogCslAUda0F6Jqbpz9zuNxMK4vEtGSG1uwFFrbhmT+MaXbcM53hYfTZrDApzvILQZhCuFXqpsL7qLvuDn4qorCtSHPg7CkJZjvauOieygfeLMQ== 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-SenderADCheck; bh=OAD7x2U4YoA6uO9axRlM/TrtprWr7bRT/wwzuH45sbg=; b=AZIwp/q4+r7gN2Ir2Qy7WAC4dSRfDRDQBnYO/WF5VPBMvSCewxmODOkEKonHaxBjIL3sttI+BQs8cxi1U9VrSSHSy0ZDS3LGu2bTBY+8u67uDbIg1b54/gMPVM9L+oHRnBaypkQReQ30ErGeVtJ3rJ3ZqQb5fDqG+w9ZLoHxtv4RscfOtpFX9wzWtaSoa2igX0RVoyfPiYL328nf90YZp6MsV4FTuLLHyRSmoGSMENBUH/2pC9Z3mU6JrpaKvf0hb5Te0dkwHkInNiwJZbYBRg5m6yx7Wa7Ta2Q4o8xiEs4xyvgQZ3jcnDqA5OV5AJyJ2oXxvFyyrfyJFTbT8GroDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OAD7x2U4YoA6uO9axRlM/TrtprWr7bRT/wwzuH45sbg=; b=qiOckdITCK0do/FhLX6D94ABM+FXHWzOuQbIpHyqTGTH+dwWZwJ5TDfuNtnS8wfA1Ps0okWxTYatpXlTW0yU7h8sDbUSzFtjCQpf1Fx39+fTU9kXd+9yfmPZj42BMR7v611QL8jA351ytJIiInTFBHBpT3WqCI+rKZ4eSzV2MPgITstAf5Q19F7ebvRiG936LLxJNZKAEN2oyHEU4X974pPf/Urq/p8iUwgdZh1/X03EgHXSF/eVjbwQklQRmbk0yaDs7v4eNTxbTlO2bwS1I+ctsaoQFO6QriH4GuFZgqSHeg6C2Cct18e55RVUlGG9PSALJm4jYN9WnA2eMfhmMQ== Received: from BN9PR03CA0063.namprd03.prod.outlook.com (2603:10b6:408:fc::8) by BN6PR1201MB0243.namprd12.prod.outlook.com (2603:10b6:405:50::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Sun, 6 Jun 2021 08:22:27 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fc:cafe::16) by BN9PR03CA0063.outlook.office365.com (2603:10b6:408:fc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:26 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 6 Jun 2021 08:22:26 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 6 Jun 2021 08:22:22 +0000 From: Om Prakash Singh To: , , , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V2 2/5] PCI: tegra: Fix MSI-X programming Date: Sun, 6 Jun 2021 13:52:01 +0530 Message-ID: <20210606082204.14222-3-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210606082204.14222-1-omp@nvidia.com> References: <20210606082204.14222-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d34176c4-0ffd-4bcc-23e3-08d928c4382a X-MS-TrafficTypeDiagnostic: BN6PR1201MB0243: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:372; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JX7ujdHGHuCA8Bkjobp+zcIoVRmyN4XAfYXjcxAW7Vx8p867IUOcwng6+39G6hlBlcDLW0D3zDhxCU4Vwg0/7N6n1iT2CtevnfyRCZnrPyA/xhcg9JCJ0V7VmXinVw4zO3bhZmyGtpUqSPzuxu9gXtBQWsKtgzaNOeWUUTpgbkxIDvz68/dFhW8pJvN85WeaDxAcUOS9RcbsA9cTOiDo2qSZgi98GRzi/sHdCmOo0wsM+w62uQ+CUDk1buw3FLnjxlNqBaCR5wrQP+yzg797xpmCtSQ7UNI/TJxtgk2xml9PsLDdlhP3Q6or5Uw17roiXQ/IgWs3ytlBzFPaBsfJqmdI0rOOiNGK+Rty+OKHHi5QWnG6T+Bqvs5yteVv4Jd6E9EE6LA0K9cMcrDqMmEFIBeUXjETjNG/EdhUTpEbfvikd17obau/XuCduucb+aV+qeQhZVPxGdvNZ+fOjpX+zhJvM9Tz2D/aHMhKt32BaIjzDpCQ/vzZpRuwRXLsw24I8H2tkxW9hPTn3FwU43sPUoQh5g8MytDHzluDmE/e065JSuhoFphcEdeM15NxVVerVsuLlWLOGBZSEzyqP6CFMNClktVvgvz7elHtJ61VWcWB9dp+Kbzj7D1nFe3sQ1KUTwSUyge8lyVEUZGX/gdHPA67W+Sfyjm+oxwMiWn4J3c= X-Forefront-Antispam-Report: CIP:216.228.112.34;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid03.nvidia.com;CAT:NONE;SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(46966006)(36840700001)(186003)(356005)(70206006)(82310400003)(54906003)(316002)(4326008)(1076003)(8676002)(8936002)(6666004)(426003)(36906005)(26005)(83380400001)(110136005)(47076005)(7636003)(86362001)(70586007)(36756003)(82740400003)(5660300002)(36860700001)(7696005)(478600001)(6636002)(107886003)(2616005)(2906002)(336012);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2021 08:22:26.8943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d34176c4-0ffd-4bcc-23e3-08d928c4382a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.34];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0243 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Lower order MSI-X address is programmed in MSIX_ADDR_MATCH_HIGH_OFF DBI register instead of higher order address. This patch fixes this programming mistake. Signed-off-by: Om Prakash Singh Acked-by: Vidya Sagar --- Changes in V2: - No change drivers/pci/controller/dwc/pcie-tegra194.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 6f388523bffe..66e00b276cd3 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1863,7 +1863,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie) val = (ep->msi_mem_phys & MSIX_ADDR_MATCH_LOW_OFF_MASK); val |= MSIX_ADDR_MATCH_LOW_OFF_EN; dw_pcie_writel_dbi(pci, MSIX_ADDR_MATCH_LOW_OFF, val); - val = (lower_32_bits(ep->msi_mem_phys) & MSIX_ADDR_MATCH_HIGH_OFF_MASK); + val = (upper_32_bits(ep->msi_mem_phys) & MSIX_ADDR_MATCH_HIGH_OFF_MASK); dw_pcie_writel_dbi(pci, MSIX_ADDR_MATCH_HIGH_OFF, val); ret = dw_pcie_ep_init_complete(ep); From patchwork Sun Jun 6 08:22:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Om Prakash Singh X-Patchwork-Id: 12301911 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 754E9C48BC2 for ; Sun, 6 Jun 2021 08:22:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62CA761421 for ; Sun, 6 Jun 2021 08:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbhFFIYX (ORCPT ); Sun, 6 Jun 2021 04:24:23 -0400 Received: from mail-bn1nam07on2077.outbound.protection.outlook.com ([40.107.212.77]:42209 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230246AbhFFIYW (ORCPT ); Sun, 6 Jun 2021 04:24:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H7mwe/tBFkKRTh0/KeZwlZHSoSZwwHoCUK35maG/eT2zU6Lr+moptMup3A8dpWeofWKRNYOpX2BltSZwYOH/6WasJlmbyvTRJLOWxFxJJ9H1CNj4dQubZ5bylNpkMRdDknJYSnfAoB8NmKLNt8hM93jO05ZZC0Z2lhCRYbE8DZbvbIFSuZQalUOH6wXbMGo18vf74NKThr5elCHaAQCK9q195Ty++iLVRlZk271fTp+2qCWL5GUqFfdCcSCmEpp/jusqxB9hBOX4Gn22qg+uRZps/os562P5IvF0o9eAf6erdXMiQ6eqiRM/28iXUimzb3m8Kc3h+1kX+Rl4B/Fk1A== 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-SenderADCheck; bh=4AnTcmfDtEN/TjF1oFRqXu3GyUM4PYqKx55o48rxdQ8=; b=jjLU9Bsv7k8qIWp3raGSspC7Trx+sHly0dID51jjuUkqYlPLghkPOKe0DwRJvlRDSBlC+0tKRgmEkgfQj6r4IIb7QS2RQulcKo1qOc932Lm9ebDLE9Xfun2R5B/7O1L5kyx5leP0/HqvSVneAnI1swcd2g8cK3qbzxsAczh/BElwr+I6rBd1Cnzd7KLKyX1Eiuftt2qrwDx1WN5+09+WDu4dMAuwIO0zmrDqQS8Hy5SXjOo9f3Y++2W1zDH2sIQ+hNsNgiNeHjH6GIRXWCJOQobXXKAL8PQ11jzsEWCzj0ZlPGtW3GbKMC1ATmmLavnmpD4vs4nMvkujiVI0TgtXBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4AnTcmfDtEN/TjF1oFRqXu3GyUM4PYqKx55o48rxdQ8=; b=YKLTzdWIk5SA2NNHx1e8SaBJN7wS6tHbv4vW5JAi0hY6XB9d+HsqijSM8hCFZ4xzpBM1HR0A61OrxrsKzZyCs8UAhAXtBQez6+21IH6pALJVyxzAIRl4G6CYkOvQYmg5Hw5H7Swgmby2nMwpQPKVCIJ56SafUEXi66Io+ILdSryPf8kL35TDay/np3aMHB9mOuXB+cHaoE5QGp2vzjEnw4K2wqdYXhSJPtmDSNbw4Y2lmvIZP/n40ycJQClUEwO8AE0Dj9yQikzb5tp0dN4GapWHQ+adsNzrqHBBmn1dCNoJVFprtOoiGHx79L145E6sUz8jj9MkweIVUIR4yGHbeg== Received: from DM6PR08CA0056.namprd08.prod.outlook.com (2603:10b6:5:1e0::30) by MN2PR12MB4439.namprd12.prod.outlook.com (2603:10b6:208:262::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Sun, 6 Jun 2021 08:22:31 +0000 Received: from DM6NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::1f) by DM6PR08CA0056.outlook.office365.com (2603:10b6:5:1e0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.21 via Frontend Transport; Sun, 6 Jun 2021 08:22:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by DM6NAM11FT050.mail.protection.outlook.com (10.13.173.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:30 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 6 Jun 2021 08:22:30 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 6 Jun 2021 08:22:29 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 6 Jun 2021 08:22:26 +0000 From: Om Prakash Singh To: , , , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V2 3/5] PCI: tegra: Disable interrupts before entering L2 Date: Sun, 6 Jun 2021 13:52:02 +0530 Message-ID: <20210606082204.14222-4-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210606082204.14222-1-omp@nvidia.com> References: <20210606082204.14222-1-omp@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfe846f1-e990-4bea-89ca-08d928c43a74 X-MS-TrafficTypeDiagnostic: MN2PR12MB4439: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:849; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pMcaMzWJ0Z5xv1JIMMhDP0+x04XRjSsEpXWFPGPh+6luNspHhFP68riKtqu0V+GtWSTWS5bHR0OCESpkHofPaBBw2HWSRMmyLEKBZhGlgqbuZ4gGbf1Ipr8tBcxOTfIhvwNJ2nBt+AubuDTw/lLEvQnrqbPCjbosNB46BW5v+x5vAe1LwUWYGDHiSogT7c0pYTuRhOwEph5AZ012x3KIU7K5wVtqmy/+nFUpdTQK3oCmlKXUmXjJnSyxf4QzauoZ7PGxihqohWlD02OXn3la6KTlHM0vXW35xz8JdAw8sUb2bvjZmAnazQ0LDpXQspzte7lRyLAD+Evg/lw86u+yaErPd1cZLLOBygSXz5uCp/GCHcJJGtKP4OBND6cpd/IPXvhX+lFIWReBT09NV+w6+zJng5jSFXoU9dq8YuGWujmzH8I6MjBlklCeqZhm71MzFND8/hVEwOyIOXUjYACmF6+wqSFTz+JPnYFJFwfmefhs6Wadz68B7m1QFiTcOWqS4NC7x4tUnSzpSr/169tZZlyNTNMcmZFPKzruLamt8W2fLF9+Y/v3hpfBsJhsoPjwv74JvTf1I8NpRu+YmbeNCdvV2bZDLWh3T0MDW2auMbcnUTr2S0U5ziPv565eFFa0CTqmKyOiUM1fj8wAADkYbk6iAdPhGZrbyuZlermQQvA= X-Forefront-Antispam-Report: CIP:216.228.112.35;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid02.nvidia.com;CAT:NONE;SFS:(4636009)(396003)(376002)(346002)(136003)(39860400002)(36840700001)(46966006)(7636003)(26005)(82740400003)(107886003)(110136005)(4326008)(356005)(2906002)(186003)(6636002)(36756003)(8676002)(2616005)(83380400001)(47076005)(66574015)(86362001)(70206006)(6666004)(5660300002)(70586007)(36860700001)(54906003)(1076003)(478600001)(426003)(8936002)(336012)(82310400003)(316002)(36906005)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2021 08:22:30.7913 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfe846f1-e990-4bea-89ca-08d928c43a74 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.35];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4439 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In suspend_noirq() call if link doesn't goto L2, PERST# is asserted to bring link to detect state. However, this is causing surprise link down AER error. Since Kernel is executing noirq suspend calls, AER interrupt is not processed. PME and AER are shared interrupts and PCIe subsystem driver enables wake capability of PME irq during suspend. So this AER will cause suspend failure due to pending AER interrupt. After PCIe link is in L2, interrupts are not expected since PCIe controller will be in reset state. Disable PCIe interrupts before going to L2 state to avoid pending AER interrupt. Signed-off-by: Om Prakash Singh Acked-by: Vidya Sagar --- Changes in V2: - Rephrase the commit message as per comment from Krzysztof Wilczyński drivers/pci/controller/dwc/pcie-tegra194.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 66e00b276cd3..64ec0da31b5b 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1593,6 +1593,16 @@ static void tegra_pcie_dw_pme_turnoff(struct tegra_pcie_dw *pcie) return; } + /* + * PCIe controller exits from L2 only if reset is applied, so + * controller doesn't handle interrupts. But in cases where + * L2 entry fails, PERST# is asserted which can trigger surprise + * link down AER. However this function call happens in + * suspend_noirq(), so AER interrupt will not be processed. + * Disable all interrupts to avoid such a scenario. + */ + appl_writel(pcie, 0x0, APPL_INTR_EN_L0_0); + if (tegra_pcie_try_link_l2(pcie)) { dev_info(pcie->dev, "Link didn't transition to L2 state\n"); /* From patchwork Sun Jun 6 08:22:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Om Prakash Singh X-Patchwork-Id: 12301913 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D58EC4743F for ; Sun, 6 Jun 2021 08:22:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8669E61422 for ; Sun, 6 Jun 2021 08:22:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbhFFIY1 (ORCPT ); Sun, 6 Jun 2021 04:24:27 -0400 Received: from mail-bn8nam12on2065.outbound.protection.outlook.com ([40.107.237.65]:20225 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230258AbhFFIYZ (ORCPT ); Sun, 6 Jun 2021 04:24:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oaqvHSULCbxTAY/tqrEK6QgroFDOp8HnPc8aKlzGg/o6z1KDTHH+t3ZkYVE5C1ZXL3OVEpU2UMOXkq7TFSmNjRLzQeG7DnUabA2lHUD3AYGjHQNcCStaBS4xVaJ4nzbVHJzE6cuNlJxBKoI5oESHn1KTznsnD/YDxfO3fC27O9cL+C7MeaTugNl0xkV9yoLQgbnio5dz/qkaptfh71rRfc06oIaDi/m1/DLgxQQuLRy/M9ugl/8WmuR8cLCz9Wlu35dyd/6bWGWWFpz1NwaJSEq3NzKPzBZV/VZ+mgUetwAxlTllSYbtaFwHv9Q1tPqJCQIwoDrxVs047hXp6b2oaw== 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-SenderADCheck; bh=pJgCjHplD4sKyrbnRleMAJ9aHePNdb0ecqQ4e4Of9Xc=; b=hNp+WO/69dZTvbCp5kv1ouPNAoLbPqgEBBFrjnfP0u6mkS7+yY+HooufVWEzlX6qcjvX9BnxalOBZSnuxRM1+eozK1q8TCKYyJaab21Lm+aC1wstQm0AjR07EUbI08WY7JUmUhjHqfjfOem6yJ0nImZTlZEwqwm6VS1utAe0NyAqOFk+FKM+ax4+HfySMX5bRZMzQYl3y2MhBCGKwgOwpDfNprbrtE7tyTttwxQvAkXHeNITE4ishiDyv+2Lulb05Sf7MAnsn0C4ZOvCNIBlLwXTGi1J/ucpEuvdYf90w44eO/9tFmBV9CaosuXPucwfcwjtfrdJSaRYtCXCcsZlKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pJgCjHplD4sKyrbnRleMAJ9aHePNdb0ecqQ4e4Of9Xc=; b=YgFZGihnoDR+1S9UWJOQ59MsEZtSQibwTbFzhdUyQ764gMJzy620w9+VODt6gi8R27yMbrd+Wxx7Ec3pG6M3GJoJD/j1QymyjZLAEu48RIkxMkch0csTAEmMvSHRotKPy6R9pZCD3pMmVG/RJHpyREbD3nLYXYw46dd5cCMEbslQPXquMKChe7Gp2SpG54miqgiu78oi1FQyBfFoN9Ri5gIPesPOQ2uB+TApUQZ+WQYzYpQMSBa5kwzN6IB7RzTYCxuUQyQlENpN93RJnIpskOMlv/HhFXKOAu7v1JmWfi0pQzZGpDbik5hvCZYL6pF8LQcdk8PXG7JvhR5bmxNEwQ== Received: from MWHPR21CA0049.namprd21.prod.outlook.com (2603:10b6:300:db::11) by BN6PR12MB1442.namprd12.prod.outlook.com (2603:10b6:405:f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.26; Sun, 6 Jun 2021 08:22:35 +0000 Received: from CO1NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:300:db:cafe::e4) by MWHPR21CA0049.outlook.office365.com (2603:10b6:300:db::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.4 via Frontend Transport; Sun, 6 Jun 2021 08:22:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT043.mail.protection.outlook.com (10.13.174.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:34 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 6 Jun 2021 08:22:34 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 6 Jun 2021 08:22:30 +0000 From: Om Prakash Singh To: , , , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V2 4/5] PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode Date: Sun, 6 Jun 2021 13:52:03 +0530 Message-ID: <20210606082204.14222-5-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210606082204.14222-1-omp@nvidia.com> References: <20210606082204.14222-1-omp@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9fd0506-24ca-4fb8-e241-08d928c43cc2 X-MS-TrafficTypeDiagnostic: BN6PR12MB1442: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DzxyfjBVsN8dZRmoMZM1eShbuzTqvjWm8bVw6MVDbc/aFipP4/z0hjhjjiPrCkHpl8wYO4nte3CCTMEVaaTNh8rknqTBYl3as5nOnmmYJ9sy76XeF00CvrQEYzAjC5GtDMjaSvwsegD9g9QYQnQAiQO10PKcHPSiKL5Gx8YB30vQWTx0AN4xow4zsO62JJ4RdgRwiTHBH7zRxYzgB19H91rNAq9eXiAFDuIr/ByVfXJSSjULqPDCnrBalWklEtb8trozZFKpzTtKustWDtZltQtkiWQzsRxG/KU7SH4if+55uYaMpUShHzeb9Ci8ziIGbV6nAfTvk4qnWP7hsH0+aeRrIwm51q38NpbhC81iihYxQh+MGN3fR8AqEXP10EaJuyxXUbB6Kq2L3sor/O6vDEqX1kv+aWavpoGKhi5r2CMU30Ra81f+HmBzTc1iQvjBdNBfnchhIiaGLYPeRMuKxYvCWOvAzuZ9Egx3f46RL8F0GO7FEpr85nccA81DUp1vcxY50tOq6QeupfQ+QHepy6bdzGuVTmkAOUWbAckHXqgm5RTMMn8/ik9mlipTDnFYI8A/tZPkWJuPCayd0HGVMQ5a3hYwrElc2id6NbB1BtyprgFU8yk0H3H8OEAboTjRqoGUN7qLVRdxP7beZPcr7w== X-Forefront-Antispam-Report: CIP:216.228.112.36;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid05.nvidia.com;CAT:NONE;SFS:(4636009)(39860400002)(346002)(396003)(136003)(376002)(36840700001)(46966006)(82740400003)(1076003)(107886003)(4326008)(36860700001)(82310400003)(2906002)(4744005)(83380400001)(426003)(336012)(47076005)(86362001)(15650500001)(8676002)(6666004)(70206006)(478600001)(7696005)(110136005)(186003)(36756003)(26005)(54906003)(36906005)(316002)(8936002)(5660300002)(6636002)(70586007)(356005)(7636003)(2616005)(66574015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2021 08:22:34.5113 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9fd0506-24ca-4fb8-e241-08d928c43cc2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.36];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1442 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When Tegra PCIe is in endpoint mode it should be available for root port. PCIe link up by root port fails if it is in suspend state. So, don't allow Tegra to suspend when endpoint mode is enabled. Signed-off-by: Om Prakash Singh Acked-by: Vidya Sagar --- Changes in V2: - Update return value and error log as per comment from Krzysztof Wilczyński drivers/pci/controller/dwc/pcie-tegra194.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 64ec0da31b5b..ae4c0a29818d 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -2276,6 +2276,11 @@ static int tegra_pcie_dw_suspend_late(struct device *dev) struct tegra_pcie_dw *pcie = dev_get_drvdata(dev); u32 val; + if (pcie->mode == DW_PCIE_EP_TYPE) { + dev_err(dev, "Suspend is not supported in EP mode"); + return -ENOTSUPP; + } + if (!pcie->link_state) return 0; From patchwork Sun Jun 6 08:22:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Om Prakash Singh X-Patchwork-Id: 12301915 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2F88C4743F for ; Sun, 6 Jun 2021 08:22:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB5D561422 for ; Sun, 6 Jun 2021 08:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbhFFIYa (ORCPT ); Sun, 6 Jun 2021 04:24:30 -0400 Received: from mail-mw2nam12on2088.outbound.protection.outlook.com ([40.107.244.88]:58287 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230258AbhFFIY3 (ORCPT ); Sun, 6 Jun 2021 04:24:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgGReczPtyvgjhFBJE2d3XHGoz1FBKyULorCMj+M5J5X4YUDPjj8VrPZb6Ha3a/95IQKF5ftrsy1tPQS6IjhfZfGQwYCtCfRJQH7OJT9x87sDhIGWugdz6Dcnz5l2NZWBrKaqZ+QkiPP9RB31FRLid4meA3KtigfsVW7ZfFx9G9rnCmpO0fCFbZ+GNMlyQ33ORLFOQSzBzfmo666euqUOgqLQDegpIVVdPai0hyODA0r7UVNUQ8v3cTqjs9kPbt+Hz/EYrSb7xHreEcvvJBUCXl9MxU3dq5HJTJj3mWJlCZJZskHajKpOCw3gQT7CRk6sPwJV0UP59D6olYlUtqLaA== 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-SenderADCheck; bh=oG8VmMbc+i3+ywRgNnTrGbHx27HxSK7tNzOpd7aasF4=; b=BYIafJDe3Wu8TdmS4pN4lx8zbHqmLE5JFT3ZkWCj/SH3cFDBriUjEVPaQI3dKMVO7UNOwcSSAoBQ84yEphllzxns69GLVF+tn2yl5EK3+1tc585UuhCejRSgE1smzgsObbWYXiUP/ugdYVeT9yQtiEfJhxfQrc1SSjAJp1xLIgtLqG4yDLKqB4uzQ0IOJCc2Ns+EC3luKwqgelS9EUO7yFlQg+tQKo+ja+kttf1sjvAITnZ/JgDeJqN8wgmf5msvkpnxz3qpw95dF3CGw1YgeGsrz9841bfBkFQYrG39u1kckL4HKEf9BGe8zrxgtUkJhLJ4jEsS4OJZtTo7dwKKIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oG8VmMbc+i3+ywRgNnTrGbHx27HxSK7tNzOpd7aasF4=; b=p9BlpfphdtI57BAKwb9yt27hhnGd7d0TIKFt+SIidIZprbOJ8yiDh6naS/qmiEWPAKHN2yW//CAGI7Rx5o+cyC61aMsM/t9kbjxsgSXJN1gp97RvztpDnSZtrSmRJuGQDwIQu7Vrb/EtLAovjynmaJQHhovE+fzH57X1+la15Vn09U9Dcz+wPxK9sQkyFigImFA6vJGfcA5JLU8L0oZViyA16fWgiw0J9bVdBgSmauDlYNoQ67t8Gip/yzeOqU3iZPxNW4lEh2d1jQ8ZmFm77ak9dhac9J6lxhxbOtLvt7hBY1ML3OtgQutjG+oVJsJ0HBhfoWHULBqOQO/I9M5oRg== Received: from MW4PR04CA0001.namprd04.prod.outlook.com (2603:10b6:303:69::6) by BN6PR12MB1329.namprd12.prod.outlook.com (2603:10b6:404:19::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Sun, 6 Jun 2021 08:22:39 +0000 Received: from CO1NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:303:69:cafe::3b) by MW4PR04CA0001.outlook.office365.com (2603:10b6:303:69::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23 via Frontend Transport; Sun, 6 Jun 2021 08:22:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT034.mail.protection.outlook.com (10.13.174.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4195.22 via Frontend Transport; Sun, 6 Jun 2021 08:22:38 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 6 Jun 2021 08:22:37 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 6 Jun 2021 08:22:34 +0000 From: Om Prakash Singh To: , , , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V2 5/5] PCI: tegra: Cleanup unused code Date: Sun, 6 Jun 2021 13:52:04 +0530 Message-ID: <20210606082204.14222-6-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210606082204.14222-1-omp@nvidia.com> References: <20210606082204.14222-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11619f53-b962-41b4-17f7-08d928c43ef7 X-MS-TrafficTypeDiagnostic: BN6PR12MB1329: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:327; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /I913n5bmvPsL8628QYPRt0KIzNTfU/cRSBOYzxRHuvs4/tHzUSGTbf3xz/O6MlPdTxaovtlKe2sMkZ3a2NgaWHRtpqjlozRUz+rnSl36Vomwx2JIAoiQpJefDC54c+NBdlWETSJzQFvV/y5dGJARcQColmE5FSAG5aMzKfsRHHSh7UCt2tXqEPrtPil1HMXeNk7Qti1nAT2E/xIeNH6vMFJjo3zEY+2a1XBzfA1s/L7kK+8Glu8AM1RIgm1obZs9Cl+Ce6JeiDA6AvuyUlTK/hTT3YJUtaI12VKNoiBYYW0sj1WaiWAyOwqhexiT2IvYryPlgcWZjwu1R+xM68aj0t4j1oM1Q/L3btW0dRYNNwMlPErYMOLXs9LN55AKE87HtAI+1punt/KTIm+1gHQ5+yjJg/MIJmiYIYmKOROmAQht5MFneJApTNx6H78XMIx+8bgk243FqrCogsKKemQiGd0xHbvZQtaxqGMOCPxjKPDdSpSokroV3/4prdN49DdjhxQFyxacdzvFKaUcuSFajB2mjaG0kTF01n19XjTmbODFfGCk9n/vFeS6Qv1qjqyWAn106dM05Q0kX5wGFRgnvrz/z3/9LRVLCkKRm73MLtHKJIhLGzhGwJYAZ4IiQE8bqUIvN1ZPkI4MkFjrzzZ6gcyjlZ68ll4biv2zndxbwQ= X-Forefront-Antispam-Report: CIP:216.228.112.36;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid05.nvidia.com;CAT:NONE;SFS:(4636009)(376002)(346002)(396003)(136003)(39860400002)(46966006)(36840700001)(2616005)(107886003)(426003)(82310400003)(83380400001)(336012)(6666004)(86362001)(7636003)(356005)(54906003)(5660300002)(110136005)(316002)(4744005)(4326008)(82740400003)(8676002)(7696005)(70586007)(36860700001)(36906005)(36756003)(26005)(1076003)(6636002)(186003)(47076005)(2906002)(70206006)(478600001)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2021 08:22:38.3574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11619f53-b962-41b4-17f7-08d928c43ef7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.36];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1329 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused code from function tegra_pcie_config_ep. Signed-off-by: Om Prakash Singh Acked-by: Vidya Sagar --- Changes in V2: - No change drivers/pci/controller/dwc/pcie-tegra194.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index ae4c0a29818d..e9d573c850dd 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -2045,13 +2045,6 @@ static int tegra_pcie_config_ep(struct tegra_pcie_dw *pcie, return ret; } - name = devm_kasprintf(dev, GFP_KERNEL, "tegra_pcie_%u_ep_work", - pcie->cid); - if (!name) { - dev_err(dev, "Failed to create PCIe EP work thread string\n"); - return -ENOMEM; - } - pm_runtime_enable(dev); ret = dw_pcie_ep_init(ep);