From patchwork Thu May 27 07:46:10 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: 12283615 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.1 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=ham 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 20190C47089 for ; Thu, 27 May 2021 07:46:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0E1C6113B for ; Thu, 27 May 2021 07:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235071AbhE0HsR (ORCPT ); Thu, 27 May 2021 03:48:17 -0400 Received: from mail-co1nam11on2072.outbound.protection.outlook.com ([40.107.220.72]:11648 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234594AbhE0HsR (ORCPT ); Thu, 27 May 2021 03:48:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZiFcxX6Z9pk1gXIrUhULNPWY/IXKC9Y3C9cScFn2fmmpxeQW+/0vGsMR9QYuBUqzb07sUNKQpuYxvKMSk8Atiq8Q3TsoySOxjOyue6ciYI1VP9B3sOrBrCKr4FLIHtV1UiMvdbZH1Fe+IS0BpKncwpF5Wc0kCZMp9p/FkC2k7ogIyXk+5dJElQ2Ss8FwyHnDXZguejqevWnAS9ePSnRtJJuxvvvWHpGBF2wiep9JSM7xcSwL/CH4cKX18/PWghbFkpomTAqMMKsUMI37LP/nqqCoXN09gaBDVUbtbqG2DqTinJ8fs/cODR6SaQcyJ1T06TBXBMB1t5GYonpm1on/Vw== 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=pwYiYHzRO9TuQvjUemHCBpGmrulkM/eHDZKMQXYIimU=; b=ay4PfPyv439kZYFZdbuduyH/GTfcIbtY47QDGZXBUbcb/uJpBvYlMOAcRLqPxhu1bfLRKCI8x2AzzQGWzqd7zlx/ltPcSRiKhv2ogERRzR1JabHZXNqdnNnrd/iUQ5BO/3aF92Wu4W1pttfrCiJUTRJJaYoNIB5I9QZ5XI3F7jSKzsgWJYJ5OyQYfaOOXQz/bR8yrzqrcXzqskI4cI28pb2/fcdmf2X58E6nmcOPhB1hAJw+pbW/QXUZuAGKDkwo1h+P5zSRnAvG9CMrdD87jR6OLV1nbTEfomRx6PZGdNPuq7ImsYCxuzdjzpl67OZ22KbqSRm+FWQWp9GYHa5U+A== 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=pwYiYHzRO9TuQvjUemHCBpGmrulkM/eHDZKMQXYIimU=; b=CVEfdX6fwSHG3EB3V8zOP/7dulISyBrPU3vQ8S8iRqVQz+JU8z/ORYHtnOdCM1f3JxhWM9L7yd1r762SuKK3ztagb5BykB6KyVkB/YZkRNH21r8G50iBfuzUBAQGjlo4pEP0VxMinzjKi8CFPKtTzKO0/71ar4jZdAd+mnmfppmCQ3Db+aYIKirTC+4Z6zobDcTzfNM5WV0I52SPBC8B1ebhzzqg3BEVOxOfy4L6qTehInRUGvshq5iToajqoVdRRO9Ktfc/ye75QRzchAwZI2QsrnfDLWtAtG/IqRp1/2B20SskdAxP8uKu3rDoAWulYlR1FWmltEMGY66zyeEVFg== Received: from BN9PR03CA0685.namprd03.prod.outlook.com (2603:10b6:408:10e::30) by BY5PR12MB3892.namprd12.prod.outlook.com (2603:10b6:a03:1a2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Thu, 27 May 2021 07:46:43 +0000 Received: from BN8NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10e:cafe::83) by BN9PR03CA0685.outlook.office365.com (2603:10b6:408:10e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Thu, 27 May 2021 07:46:43 +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 BN8NAM11FT036.mail.protection.outlook.com (10.13.177.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 27 May 2021 07:46:43 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 00:46:42 -0700 Received: from buildserver-hdc-comms.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 May 2021 00:46:39 -0700 From: Om Prakash Singh To: , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V1 1/5] PCI: tegra: Fix handling BME_CHGED event Date: Thu, 27 May 2021 13:16:10 +0530 Message-ID: <20210527074614.49149-4-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210527074614.49149-1-omp@nvidia.com> References: <20210527074614.49149-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e04e43d-4d52-443b-24b5-08d920e3925e X-MS-TrafficTypeDiagnostic: BY5PR12MB3892: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AfDywpGYjwRx5af38m22stqVKxSpe0MGfcoXFX2J8zR+1yEfH2Y5zIpFRUlObywbN1zNqxrnv6zzvOYqdQ3UDMPCHd/FW/ovCvcz5d69tt4dTtDQjf0wYPlOGPiXUAXLrwxQUrNlH9scTQw8YXZmvEbkNUIM6hY4oT8R8G6qL/ksFF+AHCqbZF7tOwRid+z4XJPxXo5JDe5DGDZmaHLdDTL6CCCWoRhs6ZmtiMXhmAHpm4Z9MNuI3d4Cb73TU550ey56pu/8EKMbOLm9th8T8s8zYZzDWoG7ygrGdsag23gAYdwm5UmnReLsx/Z5emmI4UtRs2B/+ozHcCefEVv+tOcveWzygSuFpm+eZv2VcUzyxdtd4ZXfN+i7dlwczBQ12YacIYyTU3ZsHaB4bBzSm6hDkf3COiJm2+4QdxME61AqtNc5SsLnOuJQV1igQ+IYt82WRx/TUD0Ditl2fH2tkWHRAyN/NSSckxLq4xMbpNaMwpBKk03QKo/f/uadvSrY56kY9mVFcKPcjmsPvA6jV4ZgaFuX6upiCh1iv8FLwPIeh4qEH8gqubE/3IP+zoq2ut2Z3X8Tm26cDGzyc9pr/H7mp5k32qHlMA9RNf05+sQdzMsk06IAPNflGZs+NOTJhRbkeTtSSk44wo07eg2SmmzfqcrQ0iS6bGWtbIDGIH4= 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)(136003)(396003)(376002)(346002)(39860400002)(46966006)(36840700001)(316002)(8676002)(36860700001)(8936002)(6666004)(426003)(336012)(83380400001)(36756003)(70206006)(6636002)(86362001)(70586007)(54906003)(4326008)(2906002)(478600001)(26005)(82310400003)(107886003)(82740400003)(47076005)(1076003)(7696005)(5660300002)(110136005)(7636003)(356005)(186003)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 07:46:43.3195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e04e43d-4d52-443b-24b5-08d920e3925e 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: BN8NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3892 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 --- drivers/pci/controller/dwc/pcie-tegra194.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index bafd2c6ab3c2..c51d666c9d87 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -615,10 +615,10 @@ 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 val_l0, val, tmp; - val = appl_readl(pcie, APPL_INTR_STATUS_L0); - if (val & APPL_INTR_STATUS_L0_LINK_STATE_INT) { + val_l0 = appl_readl(pcie, APPL_INTR_STATUS_L0); + if (val_l0 & 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); @@ -636,7 +636,7 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg) spurious = 0; } - if (val & APPL_INTR_STATUS_L0_PCI_CMD_EN_INT) { + if (val_l0 & 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); @@ -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); + val_l0); + appl_writel(pcie, val_l0, APPL_INTR_STATUS_L0); } return IRQ_HANDLED; From patchwork Thu May 27 07:46:11 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: 12283617 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.1 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=ham 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 9B49CC4707F for ; Thu, 27 May 2021 07:46:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82160613B5 for ; Thu, 27 May 2021 07:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235124AbhE0HsY (ORCPT ); Thu, 27 May 2021 03:48:24 -0400 Received: from mail-bn7nam10on2055.outbound.protection.outlook.com ([40.107.92.55]:63809 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235130AbhE0HsV (ORCPT ); Thu, 27 May 2021 03:48:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJCmHXu0u1+Mstm47DjW+rvGEA1Q2fABQYk+yV54fNfPTPKqJPbnsusN0I6qN++76FD6MhA/VmvjWHDsmsy+8w3JHbeQKQK+4ohFAGdW9WCkEgmLQnXs8q+52zVZDwjUvdR79taTe4tdB/OXfo2Uqn/IqJ0hmZXfKA0MOxXa1jo57MF5yEzHnf6I1D4HMVJasSfrGoGXMlo6T43PXneSyJkuhPs42NYJ9nZ+u7K1ZgShpidcLiS/XCjYdgksRa3coJAGRwmcv6F8v49gIIueJkkNkuqmr+EbhstaShlrw3BxQE/V09+OWqz4lqEP3FVBEmROn9xl3l8ABIUg3OLoVg== 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=poBoznlKclT7OVyqjX+EPspeaHTBbocMQsmvW4nROls=; b=Gii0qzGli49wUFpsAJysPyungNucOqpVy6jhWcB/eE19dm0SFzv7o5U8yHZCU5SZq2efwN2fK+ENIg1/Mt0g4W6mLq7ET2guPCG0Xg4H1SMBqWaB6aKFHc167ytMfRd1s0+dTxKS620C3mYaeBaloh2D/tS3H+DoEKA6PQS5VtfK1Y0/NNhSG6m5Q4umL4g44zAtL9YXgs57J4DxAqFXZonjJQldBAooKZfKhGALdic03ITF7DK6ryuPFSNQ0hYX3lxm87uztcEPBEvcD5/o0VLmXDUVyJc7M2AH/B0iBQzvLYRyE/F7E3IB72QadWrpWZ56wnYcohC2SJrCFQWp3A== 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=poBoznlKclT7OVyqjX+EPspeaHTBbocMQsmvW4nROls=; b=UEq0eOHKKJxqLvCQJap2KRVQvL/56q1yy7R/HJG9jAr5p0k9Yo+kq8O6JxuBcFInoD+NWQZlxD1oQsXODPk1kHhQ7l7sm/L74D6FnHWNwCYqy8CgmIgNEqNA+XemyCJuE5RKS9QRYVCRRUKj6djWumX45BzDTa6Hoxngkq2Bn+AL7Kc+LeLT1zRpRq0Jyl7wLEBxFgVkMc6eJSp93nAnakRg/d81oBflA4M0wbol+EKD9vGonYJCEk6nCwNvad4hNcCu3sop5ULigw+9vC+Qz5HopJxBQU5aucEER2nAMdXinH52E0VMhJZNgJiFYBaFdoFIzPj9vyUIHtinLRxbYQ== Received: from BN6PR13CA0015.namprd13.prod.outlook.com (2603:10b6:404:10a::25) by BL0PR12MB4738.namprd12.prod.outlook.com (2603:10b6:208:8e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.25; Thu, 27 May 2021 07:46:47 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:404:10a:cafe::a9) by BN6PR13CA0015.outlook.office365.com (2603:10b6:404:10a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.10 via Frontend Transport; Thu, 27 May 2021 07:46:47 +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 BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 27 May 2021 07:46:47 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 00:46:46 -0700 Received: from buildserver-hdc-comms.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 May 2021 00:46:43 -0700 From: Om Prakash Singh To: , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V1 2/5] PCI: tegra: Fix MSI-X programming Date: Thu, 27 May 2021 13:16:11 +0530 Message-ID: <20210527074614.49149-5-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210527074614.49149-1-omp@nvidia.com> References: <20210527074614.49149-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f6f8462-ed7c-4656-ab1c-08d920e394de X-MS-TrafficTypeDiagnostic: BL0PR12MB4738: 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: Ng6QvcrFzASh9ry811dcMnG/VodXYOb3bQ6KMYy8M6SDr2iFlr/mNOrT5sb821cNTYU6UxGp269oublz2qaiBDv0BZTyyOtn+y5X7GfvOBihdffQOmGm7EdlIuIVBSr4XwBcLrkdNB2teExX+EvnIb9PQwCTQNqmt+2KU8myp3zMvu8Fm7hKM7uoX/MA7FREatYQOTHK4aXvY0OlHDJZe1DkDt8BzMCgtNyoyCG92h5YyS2n5YO2nta5DjXxeJ+OZYhXF4bng6F6KseET9vi2frdz58ge3st+qqAU+3ISGVDU4Eu+4a++NTSjJAg3miIk8OVHHar9AQ5xA6TNKxU9apkfd1EVU0EXnMfYMuO0bWwh9JIFxY8rOqfTq8mXf/1DHh5wi2FnZyntPQGeEQvmJz/Z+23RK6wakJ5y+lcnQzuKRNQbFyScdzy6+vu0V5XtttmZHhnUTn5tNnSbvNQuSqofU7Wem8qiqyDAPVxbz5kY6zb0q9pLSkAhO2RIXH6E6bNS7L9bOSXCR55UOEhdeNwD38Hc+FQlEVDK9LN0gZDHEmo3VIV5KLwEfYb5XpMFbEN4wqDCwWrwRJIEwJASxJD1+CWo1X8dwKFSS+K7p1HG4wdAft7ZMEME8mgg9pgjh+5/nUkDvV3/SwH6s2mvc55LOOVMshRJJ67OJ/zERM= 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)(39860400002)(396003)(346002)(136003)(376002)(36840700001)(46966006)(7696005)(478600001)(82740400003)(186003)(6666004)(6636002)(5660300002)(356005)(83380400001)(47076005)(8936002)(36860700001)(8676002)(26005)(36756003)(7636003)(2616005)(86362001)(336012)(70586007)(82310400003)(1076003)(4326008)(2906002)(70206006)(110136005)(316002)(426003)(54906003)(107886003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 07:46:47.5052 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f6f8462-ed7c-4656-ab1c-08d920e394de 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: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4738 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 --- 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 c51d666c9d87..58fc2615014d 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 Thu May 27 07:46:12 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: 12283619 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.1 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 5281BC4707F for ; Thu, 27 May 2021 07:47:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DAF660FF0 for ; Thu, 27 May 2021 07:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235147AbhE0Hsb (ORCPT ); Thu, 27 May 2021 03:48:31 -0400 Received: from mail-dm6nam10on2050.outbound.protection.outlook.com ([40.107.93.50]:53134 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235097AbhE0Hs0 (ORCPT ); Thu, 27 May 2021 03:48:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SfHi0sDg40p9SWqkQRg0jGjGn/OHoILUK2HDF8VCdkw7SFIKzkT4MT6F2K8+3WYEHvsynoxaVySLYqTzE9KEIrcR96rZ6l/wEQZ1AraUpjd+rnBmakB5xXvf6K9dBjC7xtfukHaZwF1xD5IKRye7Nl0S8z3uo6ag8WGGuun6BQL6kL1dtGLEWk05cxQc/r7gICqRAt1v1hvNIloMdVHbAIt6AX1WzfaBk3Rstx3BISDE84ogavBq8WrWKwigwmqUblNIdJOO4Y7VumSRTdUMgYlaDB551qT8dc4oJ8XEY88+mpsGCkjKJuabpLjj2EEE6SSBKb1eU28VJzZcduBvkQ== 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=BHkDEk+PXRjNch4/r18GUZQOtmmMvUrKeYwS6LPpo8E=; b=MJQ6hNxlVVDf5iRTZ2m9irgiebtKLWbh5/Nm6grPpf4gaYbfdi2kdCqDwXwyrUanwx/lmQKTitUCLzai3by7rg17UkM201YikIJjlxBKBMYZfn7sc88sJr/uZk+KsIywg2GHQvIbONSJAPzJR7UeuKYpXZZlBNw/B6UeP09Q0sASGlOtIINnQauRi8SapmPg5KU/Vb15Xu0LDxh8fu8Ot/aV6e06m7/v67ukdW/RIJkICe63F27lkKQxZ4qbhkJflvmZEwUc1Dr+oeQ06MagxWT3GZVxO5EeRAEa1uq8xWOza2HLOm4NNLpnuRbyCh8vc6BafxAwD8aYGpWdPlfB7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=arm.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=BHkDEk+PXRjNch4/r18GUZQOtmmMvUrKeYwS6LPpo8E=; b=T6VlQsvSUGGYCn92AulN/lgT34rVB8Y088/STlc68WCUI3MrZ2Amu+VkoMSlK4a1mbk0BqQ0XjUUCpJfsiA3ZQMAilOuei2Pz3AeflcTkXKFnkN5LIv2OGjQg3/Lsn+g3lVSC7KvTgBCCaympR+1ZGqb5Qu/koFClF0U3n7COgMVKiodAcSSGxTTJANIiuBo87O/Q524TCewOLgsZ07oW13xJSOavps9a5oPUmgwQBqoyC8GcA+Zuc4YObms/mi7ETua4yph5ZTnX/oQmoGg4YvKaOGcq8E1b6Xz6UcQdm01LS4fBKTBpxV72wC/iMQNh1NC/IEnZWNlfYPg4J+qoQ== Received: from BN6PR13CA0025.namprd13.prod.outlook.com (2603:10b6:404:13e::11) by BYAPR12MB2808.namprd12.prod.outlook.com (2603:10b6:a03:69::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Thu, 27 May 2021 07:46:51 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:404:13e:cafe::47) by BN6PR13CA0025.outlook.office365.com (2603:10b6:404:13e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.12 via Frontend Transport; Thu, 27 May 2021 07:46:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; arm.com; dkim=none (message not signed) header.d=none;arm.com; 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 BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 27 May 2021 07:46:51 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 00:46:50 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 07:46:50 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 May 2021 00:46:47 -0700 From: Om Prakash Singh To: , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V1 3/5] PCI: tegra: Disable interrupts before entering L2 Date: Thu, 27 May 2021 13:16:12 +0530 Message-ID: <20210527074614.49149-6-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210527074614.49149-1-omp@nvidia.com> References: <20210527074614.49149-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d3bf50a-5c7d-4b55-011a-08d920e3971e X-MS-TrafficTypeDiagnostic: BYAPR12MB2808: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mf9d6AfQim4uLvrAFCKdIT5zwV4KfP3L92O+GRRIwuTcrk5nM8IJn7LHd0Jg7arhG+QZytpIPARW6zKOdzsBu7j5LBlBcLEItjosGDCEtHbkJJG3iGcXqP9sQMCACx/s2dwpfP2wAlhyatWi902P1UOHrdwUjHlCqYtMouw8YXYIvbz3eyzG/7zUVUXp5XVNY3uvBjjgb5MytCba5kHIkEmXxbUvLdM0bhb8OuornW51duA2SqUjZoOIx2/ThiSWfBi5yBoIlOscJaDXE/xhvtq9tQEs4A6+GOUbHzeC2E8Gx2t5ghQPG8YVBDx4wZdxbhSxSE0DGI7JX6WLwp/s/kJbP5CXNJaBXnH0t3PoFSLYhy2+NeUSoZaT2oyZrykMNfbMmUfqwTCKMuvwNDGhF0J+w8+zjnULS1et9FjgObFsQhCVoJhLhhlqkxte3Pcy1iCwlblb+s7vQeluUNnZW7RWkhxumEg19zBqREhEXYijX4vrkRzlQwc15VPYhxsvLiv6p8ubb4qU3XLHmB/QLWFALzyLm/071tj2sXxRXwYHAMJzLzuZAv3KM2OuxBabZkZHEzecf4G8aLerTwTCTLexKHFbAZyVAW7ERwu/suBGTVUYIgyJDtdSYZk51j3BZHJivwuRKt+UjiqEGHnqjmZuxaVm+XlvHaQvrjPbAQw= 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)(346002)(136003)(376002)(39860400002)(396003)(36840700001)(46966006)(83380400001)(7636003)(26005)(426003)(4326008)(107886003)(6666004)(54906003)(36756003)(316002)(47076005)(110136005)(82310400003)(36860700001)(478600001)(1076003)(5660300002)(186003)(82740400003)(356005)(86362001)(2616005)(8676002)(70206006)(2906002)(336012)(70586007)(8936002)(7696005)(6636002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 07:46:51.2807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d3bf50a-5c7d-4b55-011a-08d920e3971e 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: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2808 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Tegra194 implements suspend_noirq() hook and during the system suspend, the link is taken to L2 state after PME_Turn_off handshake and if it doesn't go into L2, PERST# is asserted. It is observed that with some of the endpoints (Ex:- Marvell SATA controller), the link doesn't go into L2 state and asserting PERST# results in Surprise Link Down error and the corresponding AER interrupt is also raised. Since the system is in noirq phase, this interrupt is not served. Both PME and AER interrupts are served by the same wire interrupt in Tegra194, and since the PCIe sub-system enables wake capability for PME interrupt, having a pending AER interrupt is treated as PME wake interrupt by the system and prevents the system going into the suspend state. To address this issue, the interrupts are disabled before taking the link into L2 state as the interrupts are not expected anyway from the controller afterward. Signed-off-by: Om Prakash Singh --- 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 58fc2615014d..ae62fdc840e6 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 Thu May 27 07:46:13 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: 12283621 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.1 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=ham 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 7C02AC4708A for ; Thu, 27 May 2021 07:47:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60DCB60FF0 for ; Thu, 27 May 2021 07:47:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235116AbhE0Hsd (ORCPT ); Thu, 27 May 2021 03:48:33 -0400 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:56160 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235120AbhE0Hsa (ORCPT ); Thu, 27 May 2021 03:48:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FhQpeIYzcs4t9f4205eiPOVIJDilbeCZWo5ilG5K2xWqtRoyLl0uEVG76ZuMxdw8QE/GwYGhVLEgxmcKR7S8Kjdl1t3nK5kB2Pjo59nTYKCcm48vPIZzhSQla30pMrcc/3VAQpbqxfGdPdhfLY2+q5O0Gcz4zafxvuvoYd6NJXmMMKPDwA7K2ZSlq3QxMkrAiwg+YodwdEi0DXMdu7QxvWFwrJHQCV83ghE+CYhYyM9q1UQgTWi1610x9Cr4As6k3co/jAUPgPKu50x0jmqi9WZiTjtoSKxSD9nBpEXCwFZDCTJNuQw6i6lW6MYcuEGiVgDy1tvfcskfjUGvpScQTQ== 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=+O64TNUwAJmcUqqRZwQ31dHJT+11KJwMxMW/87E1xnQ=; b=XidIjfB4FtJviMCPO5bf+IJOqoF72mOtK/5TGCYtgDU0uY/wAx2RJOogH8gm9ldcTxnziq42/n5gNYSp7LsFn7Js8+635M5IghhzlbFRURyqHkCUp/bFE8vnboEl9Wk5pAyJXAuAuig8KPtEzkHx8AkIP5FJ3coQ0/EsPcf3Cm8+/DUaLlB0xSecW1sAfcp+S2rN5dIdhqUwnswdGeTwZN/QRE55uh9HMbSfIq+lOPG7iRMqLL2NUd6G0CHOcw5605v9h6uiht9jt6tMJpvnfEdAf3wcngfSAoXk3EDWaMWTOa3IlOvVBpZ5RkGVsu6vTp8+qFINn8SV6kOfAKOIzQ== 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=+O64TNUwAJmcUqqRZwQ31dHJT+11KJwMxMW/87E1xnQ=; b=J2YD0zkeKlRexugObintZATwib25fH0ueTrUNOIweBYt+Wv9pxy4bEx2xrLSrA4atvXYj7s7xV/G5nZfFcnQyWskjEVr8nfHNWK9CB6OGazdw+KUGR0hoYVcNS81t3w0vCJADWMp3sSgdOwCTxs91VbGlzJajt4uGZtALxPnbAcJMSkjXOFlqm7x5zMHn8Lr5VgQAeFOLobwSZd4qtpte+gAA2aIuiCsIqwq6tdLdU5tpAwPxuCp8bd495lH+7mj99f7WHwVMrEyNkjn+eLYyQ+OzCczmpRL79wIShLJ5f0j1Y63YD6AOpwOPiTHR9URxEhrDujz3CmJEvajAydAUw== Received: from MWHPR13CA0033.namprd13.prod.outlook.com (2603:10b6:300:95::19) by MN2PR12MB3504.namprd12.prod.outlook.com (2603:10b6:208:d1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Thu, 27 May 2021 07:46:55 +0000 Received: from CO1NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:300:95:cafe::b1) by MWHPR13CA0033.outlook.office365.com (2603:10b6:300:95::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.9 via Frontend Transport; Thu, 27 May 2021 07:46:55 +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 CO1NAM11FT038.mail.protection.outlook.com (10.13.174.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 27 May 2021 07:46:55 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 07:46:53 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 May 2021 00:46:50 -0700 From: Om Prakash Singh To: , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V1 4/5] PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode Date: Thu, 27 May 2021 13:16:13 +0530 Message-ID: <20210527074614.49149-7-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210527074614.49149-1-omp@nvidia.com> References: <20210527074614.49149-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 030a70d5-db68-44d2-1eeb-08d920e3994e X-MS-TrafficTypeDiagnostic: MN2PR12MB3504: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UA7baUBPaoJK1Qyzpllz4FyqdlF6jTGTs9VRAWtaf2GWFBXTK9V4lklj1XyI1VZkF8OKVRlwVcfZi76nlL1DLIYGSlisokTbiygKnwd14rt3iTD+91TyzjqqwmuK2hZHVHqr+E/zccdZcZc7UwP9ifoYoKr8KHDkrtvVQrL3hbpecKKlIdjltLMPk5Qb47JTQKLp/2SlXMnx2X8gpGP+8zeNm6yh5nW7hOiNyjY1Hilv0lQX/38HyrbN/Xk7HsjkvivOPdAB3uETRguJkzVq61EMOlGya5NoqTY0bBA4qit6DU4TneRDTUxRlXooer9cGM4DYdsPLTWzy0RlF0a8eER9NCP3eQtY9sbZweM67GzioTvd9CiXaBPfz6uhFpJuif8+4n/3qwb4nUXl6/X6IQ5zNt5iGUTjAB6V61y9+Vtg8sh2W8zqtRCYyidtZsSu4vTLmC9gI63XTfFn5TsNN3rWB0LwUWifGWAB/a1H16Xb+2TU8Acf30XcWNUpVy7tiTLWIuRuZMDrQwHjKca4NG4btdx5qBu1rF660G4z9F2jkUk+lsEdelsv+K/vD8Ve41EquZi5pKeZj3w9xUr9Vno6kL91KLjBjlw2YZBK8TG2qwttgtXVrSk36U0MjkAcWMLKyvYMZOFs/RzWK6Nq4A== 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)(346002)(39860400002)(136003)(376002)(396003)(36840700001)(46966006)(26005)(4744005)(1076003)(186003)(82310400003)(107886003)(47076005)(70206006)(6636002)(336012)(70586007)(4326008)(426003)(2616005)(83380400001)(316002)(6666004)(8676002)(356005)(36756003)(110136005)(54906003)(36906005)(8936002)(36860700001)(5660300002)(7696005)(7636003)(82740400003)(86362001)(2906002)(15650500001)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 07:46:55.0335 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 030a70d5-db68-44d2-1eeb-08d920e3994e 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: CO1NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3504 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 --- 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 ae62fdc840e6..93c89f2084a7 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, "Tegra PCIe is in EP mode, suspend not allowed"); + return -EPERM; + } + if (!pcie->link_state) return 0; From patchwork Thu May 27 07:46:14 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: 12283635 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.1 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 DE4E7C4708B for ; Thu, 27 May 2021 07:47:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C46926113B for ; Thu, 27 May 2021 07:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234982AbhE0Hsg (ORCPT ); Thu, 27 May 2021 03:48:36 -0400 Received: from mail-dm6nam08on2044.outbound.protection.outlook.com ([40.107.102.44]:17632 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235156AbhE0Hsd (ORCPT ); Thu, 27 May 2021 03:48:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NjnSEi68fnv9zjfudSIPdtA3ZXOc1Ic591h2u5Oy3j0oFW3Ly++QNJKa+eDi+LHtIFrT98jLpBeSAS61Wlig8w9toPiddVjtu+hiCeCxy3y567gVAGsgvr2wT9Vtti7xPWVP0e2tIneVRvKBwUE9kOSCPjDqwY+mP+Ten9XYqmpX+hE9gZ+G4LjjU0/i3EBFOlLCx9WN4Ip0sJm9JPIPWNrFWyOeemSJvHNAnPGffN/O+TDIl8rlSz6CoiC4D2NVd9cFJEXkxtXKS7RlQnRCDrKECvJ1x+6DutXBQBK2PhCOvoi7fn6Y4LU0jqKvlT7OUV8qOF0vnY09S2xK52LdQQ== 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=M1GK2JWWrQSWRsqdJXF260JrFBq7qIyGNr5crXTQ3Kg=; b=XwT7huzkDAGiBPKunsHWScgMOCek4F1+nX4EcK+k9fj3wyEhrRMzL01mxwI8dhlTQiyeYwXN4ORb1TkBBHUIlL9qctLfOE68rsN7s1+C92j7NsnDqRgceb8Xjw1M2AvG1bopOjnwmA8DPu0FcqfWO8vaUrSih57h85YKjvETjKj9L04chr6M/kbtnLCLhe945OivhurR6wS8Hm+rrOKiida8QP9/kWYwmfBb3TT+4Tc5y1g1Oij2coUSeAwAGZlQJQS663LbAvT9RvU11xzmqnwUIyyWjEdx7Fc3TQwJ6wqFtG/Y7dfQFOJKHtSmXfF4fQiM9Lshq9o2cqXRuX04og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) 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=M1GK2JWWrQSWRsqdJXF260JrFBq7qIyGNr5crXTQ3Kg=; b=hoRuG37Fh2IkhY6kEj7zl5gvY9njrMvY7fCkubHzx3o9zje5d4ql3Ayf79Q1cLFmLKLSrZcqYvmJA1m+US3Bzi4DUYjAIktc9quhLi96a9aSwHHLkxhLSraZ051cQKeqrVCBvVOi1Qn3qC/NkjI4s46PZeFgKFGE42IUlAorq7e/qiRxN8bb83RyRbPbw/Vwq8XsZosvo8wav/1wIvpuOKScE1+K0hqrQ1p4jC0BH4NHXRrvKBH6kAqud5uitx5rRDLVOhWL8WnlI/alKeR7B/cBb12DKGLBS8c+ZWnkXoUwt5VgrWEvI+pYh1+IEq/7csqBp7oJ7fj7DUarjYuGag== Received: from BN9PR03CA0126.namprd03.prod.outlook.com (2603:10b6:408:fe::11) by BN6PR12MB1747.namprd12.prod.outlook.com (2603:10b6:404:106::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Thu, 27 May 2021 07:46:59 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fe:cafe::d1) by BN9PR03CA0126.outlook.office365.com (2603:10b6:408:fe::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Thu, 27 May 2021 07:46:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) 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.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 BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 27 May 2021 07:46:58 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 07:46:58 +0000 Received: from buildserver-hdc-comms.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 May 2021 00:46:54 -0700 From: Om Prakash Singh To: , , , , CC: , , , , , Om Prakash Singh Subject: [PATCH V1 5/5] PCI: tegra: Cleanup unused code Date: Thu, 27 May 2021 13:16:14 +0530 Message-ID: <20210527074614.49149-8-omp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210527074614.49149-1-omp@nvidia.com> References: <20210527074614.49149-1-omp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ca89220-311a-4730-a0fe-08d920e39ba5 X-MS-TrafficTypeDiagnostic: BN6PR12MB1747: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:148; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LW6ToLUyjrUIoBA974JiIQhcPP/6SE9qw1j5gXIyFlxgv7S9nEc3jAZB00Ly3N8Wfv65zRuw2rWnCko8gSEDiXaEfpOkU6F8rcWa4f85bSn37uCyPULoeoFwq6vEPiVKrY27axC7HWCJ/UsLNQ3eRbYbIPl6FME+jvjpfo7Um1FR6ru2krL9JtsGNnKugsbYQQ03jAU1F3WDn1GVYFPB2j/aGg2wVtmw5XwjhQgqJ8FWGDyGZtgEZxgX0EAZETzaPJWdczncAMFLBxVmb4O8NQDtzCOJyf2AZ/bDNAGE38Y6hXnJyPg9VJWcFS9ac2j55+mx8TtJ4nGijCGUSChQOi2O9XBF6A0fDxMROBBJaeuaL4b/kTaKQ4TArQjdVZX2YLJQZsu9A4jggIi8duJYGS+4tFPRlHwvg2aJDVZ85QWwuEI5eolbs1/ixzp2jrLXsltcUzogo2A16OtupAggXnXtC0KtEGhSUuJ/vjcR8Y2cXJpR7Dz6ePANnY6qPGS+WMRfxUfTaea/Qe4j4Bcs4HW4g70RbwoUe1wn/wXSS+u3ufYej19N25+fUh368q4d6ikraZPzeD36bw6Trp/CUJ7b5U87bSD0o05cDE0mZ9JHa9oNf77GyBzvR2dbl+eXv38iiFwz7n1GRHN+R9E6DgBeg7yVrAhVY+OV8P6p57U= 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:schybrid04.nvidia.com;CAT:NONE;SFS:(4636009)(396003)(376002)(136003)(346002)(39860400002)(46966006)(36840700001)(1076003)(36860700001)(107886003)(478600001)(47076005)(26005)(186003)(316002)(54906003)(2906002)(336012)(83380400001)(6636002)(36906005)(110136005)(426003)(82310400003)(8676002)(356005)(36756003)(8936002)(2616005)(4326008)(7636003)(82740400003)(7696005)(86362001)(5660300002)(70206006)(4744005)(70586007)(6666004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 07:46:58.8864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ca89220-311a-4730-a0fe-08d920e39ba5 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: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1747 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 --- 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 93c89f2084a7..096aa5306fda 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);