Message ID | 20230208111645.3863534-5-mmaddireddy@nvidia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3395607wrn; Wed, 8 Feb 2023 03:20:58 -0800 (PST) X-Google-Smtp-Source: AK7set/FUr4MVPRAY4l4pdG0Pj7VWrhgbfnqdYaD7ET4aB0E6gQZHc6eLd+mluj0kgsDp5H1qzHJ X-Received: by 2002:a17:90a:f684:b0:231:1701:4ba7 with SMTP id cl4-20020a17090af68400b0023117014ba7mr1263038pjb.2.1675855258300; Wed, 08 Feb 2023 03:20:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675855258; cv=pass; d=google.com; s=arc-20160816; b=D20JKCAaH7I8oLP49gKZmLZoClyIFpWUQ+odE7i67KFj8wggQQV8Tvv+9aEDaDsLD2 uR6mxPRfr1Lg4ndtWh9TeGn5mQ6MJM1B0V4xuHuglEFjrHEW90KaxaLapIS/X66ZA34S Y4jVTfMeDXC0NgjO2cC0qlhBE7R+OjgmpxuFYAsLaNYvORPEnoa+BQjhbCtM8dMHzQJD dwDPv+bWc601tvtbCNPy837CFH6sBKPn7FJzrWKJRron78EiqTUmuJDpV5W/+OkVvwWw Mt5HDHubPqEY0M+qW7QuD5qpOEu+7ns/1U4GsT1S+6RgCTOhTFAWLhvnm1dMu2v1mt9b rzCg== 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=E9TQPOQEHQ870a4qRyfXdcpDFIIS3KkVr+i6XqXCLro=; b=L6s9xWsVK1fuG5srMnI44yvvCQf4fc1knKMBbYmzwTJcuqrzA0w7Des5pVdFYF3y6+ waQsp1hkVvHoMiPpCsT3/rMyu5qhcbNP1KtIxCIu+TB+7Hk8STbpLbyCnHbvjMsuDkpU 4KFpQJ42JJdosaxGdyocghZCOHOjecHe57Z2rzQy7bsfklkxZbVRfq2fcO4Zch4bpXGd G3CmkTmlYQKwLSvZup/LFXl50lXl0xYhlKiGwRv0w9L5UF/Ro9Kla7mAwtkMho8L2NM/ NO4/t4T7IS7Vq8GmO8GAdz9V7il0uMKuHcgDbyuWLKuIic/yKw0Zwo/xDrKPuw8Dodcg 5olQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=HAWciG5B; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c74-20020a63354d000000b004e63b6b399esi17957206pga.570.2023.02.08.03.20.45; Wed, 08 Feb 2023 03:20:58 -0800 (PST) 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=@Nvidia.com header.s=selector2 header.b=HAWciG5B; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbjBHLTe (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Wed, 8 Feb 2023 06:19:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjBHLTE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Feb 2023 06:19:04 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2077.outbound.protection.outlook.com [40.107.244.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EE5647096; Wed, 8 Feb 2023 03:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gVghLZk8wI37w0GD7mVSYFiB2natt1NgRKYqKYabnAyrbkDdYHSc0xVszc71vWPTkWSag3panalKUOEbvUU33Qqut7fw8REyZehfcATgulWvgTWDRaslZKQm5MgUcxy9i7TOimwC1pIZ3l3k3JtMy2f2CA3wxxj6KCYVtKgk2KaFt5kpFBCReMBTGePgEk94cZBkjX3AHP86J01kTPQ1BpWlp2hRfoHpDUDJVV1YB/9/bMIgOPhFYz4pfYP4SYE/FJlE/hHNoJYH8fi8wtbDvxcPSvHRLhc0cV1ejjKHV57KaVpTKOaJfGHouohuGtaFcfck+MyFP1TXcBjyAZbzKQ== 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=E9TQPOQEHQ870a4qRyfXdcpDFIIS3KkVr+i6XqXCLro=; b=UAoRVsJgz2GV/BlvkIMFXTh7mcR+Cs6r70sI3Unn+5RN0YrcYgojvGrjoL7zEikG2kRGd8Di64Lr6bxFmdMQKqhgoxi32RXvZRwfGWwUzVvI5VGNNnaXSf0YP1qLUeLYSGQBGl8syGpf/SBeKuKduH9TwcvDep4k9crYGNyXvI/A4yl8jbUIWCmTvUyI1ujQ+W76VkZ/FOz5rA6Q2y+9h+WAioswCzlez2CJR0YICHX1Gf7ooRiC7i9WgtralEVKoFqo5cE7J41QYPP0GBuJVLCUZEw8WFj2ncTJUGjtEC27M5335IZWHabX//No0rFVr5v8uAacMLbLFIjdX+zJyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=E9TQPOQEHQ870a4qRyfXdcpDFIIS3KkVr+i6XqXCLro=; b=HAWciG5B/e6SffkyBKSbseCgnLP4HACco0ZTvOnxMDIngMeXQ8lOOLrXkQBN/lc2t7wxQsYI+DNusWOvPDNCtYLLL4R5PLzcVQefYVcvfKlcA7H1PoFgvwJi1jmekplKvunSfbGFvUNxe6TGRB/lZ3JYGPoDFngzczINk1gXi2/kLcmtsStn/UhJFnI0b4+VCRXDzjaHjswquIdBF05u48hX00pi3OwZodco7ujnZP85923Euyjw6CkYolOc3SlByn8ipP0rpBAFvYAvkRDKtvJDCtBA2OKgobXgHdRlk5x1+nkQakaqF36+Fiw/UmXywltlVud6WVs63Wsy6RFwlA== Received: from BN9PR03CA0223.namprd03.prod.outlook.com (2603:10b6:408:f8::18) by SN7PR12MB7322.namprd12.prod.outlook.com (2603:10b6:806:299::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Wed, 8 Feb 2023 11:17:51 +0000 Received: from BN8NAM11FT073.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::c2) by BN9PR03CA0223.outlook.office365.com (2603:10b6:408:f8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.18 via Frontend Transport; Wed, 8 Feb 2023 11:17:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT073.mail.protection.outlook.com (10.13.177.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17 via Frontend Transport; Wed, 8 Feb 2023 11:17:51 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 8 Feb 2023 03:17:37 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 8 Feb 2023 03:17:37 -0800 Received: from mmaddireddy-ubuntu.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Wed, 8 Feb 2023 03:17:30 -0800 From: Manikanta Maddireddy <mmaddireddy@nvidia.com> To: <bhelgaas@google.com>, <thierry.reding@gmail.com>, <petlozup@nvidia.com>, <rafael.j.wysocki@intel.com>, <lpieralisi@kernel.org>, <robh@kernel.org>, <jeffy.chen@rock-chips.com> CC: <krzysztof.kozlowski+dt@linaro.org>, <jonathanh@nvidia.com>, <dmitry.osipenko@collabora.com>, <viresh.kumar@linaro.org>, <gregkh@linuxfoundation.org>, <steven.price@arm.com>, <kw@linux.com>, <linux-pci@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>, <linux-pm@vger.kernel.org>, <vidyas@nvidia.com>, Manikanta Maddireddy <mmaddireddy@nvidia.com> Subject: [RFC,v14 4/5] arm64: tegra: Add PCIe port node with PCIe WAKE# for C1 controller Date: Wed, 8 Feb 2023 16:46:44 +0530 Message-ID: <20230208111645.3863534-5-mmaddireddy@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230208111645.3863534-1-mmaddireddy@nvidia.com> References: <20230208111645.3863534-1-mmaddireddy@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT073:EE_|SN7PR12MB7322:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e0acefc-9730-411c-810d-08db09c61e25 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O4c4zBOjRzWgghsS9s35oBFxUCvMCXeG8U/K8BGjpYWckAcllCQRIGb8zNHPK9MDBN9tQrvR3IIvDgVS7tPhb635p3H/rqILO6/pIrOoYgM4q/GZFOxxN3L6yKIAwKKqBkb91mWWbvtX5DdS8712UcwZsCmLsy1ZvLzxgU3tlIWBDR1rUinDyoZWZAIR1f4bbXUfMGGyLTc9Dc1nWeo/bpDw+mQwbXLNH/JgLDH4/bYJYV+aVWpcfOLwU9u153OoFej3opVrq1t5UzF+GAj4ln81a9N+GPrexhMRGZGat+tXc0GSwifG/ASphVBJ4jA1E98I/1spIwp6g+j0k8E7NjJ0pPFZqOb1AJ/fhOtHiLo1902EoLI02ZD+rqQfVsfrk+/ApiUviBYnx3/EIvXkBjevqv+F9rxKha4a0AiLX4a6OngV1mQxJGXaLIl9G5hbNL+3zkV4W/S56D9S34TzsAiPSWCXVJVXdEsA6aey8Ffs1jeixPJjXwPzIOaGzgdB3z5C0sVrmchrtdMuSHI1Hwz6Q9MFzcudnrU6gzNBEh3qEjKilU/D3DCN13KBB/24G2EbDGYmvRzBqexSE87kCNPU7qRlheQNWK7GlMPvJUqJc/adRhSGXtppOy5EGJtTZWzJ6Y2kTbDoZrhODTrh1nMmB0e07MNIY9PMCQHMbDvuK5Oge0VoGXEISSe5vJPfUPnpLAQoANIeJt2yZYTZnw== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199018)(46966006)(36840700001)(40470700004)(36860700001)(36756003)(86362001)(7636003)(82740400003)(356005)(41300700001)(8676002)(4326008)(7416002)(5660300002)(8936002)(110136005)(54906003)(70586007)(70206006)(316002)(82310400005)(40460700003)(40480700001)(2906002)(426003)(47076005)(2616005)(336012)(478600001)(7696005)(186003)(26005)(107886003)(6666004)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 11:17:51.4975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e0acefc-9730-411c-810d-08db09c61e25 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT073.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7322 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757261603530289039?= X-GMAIL-MSGID: =?utf-8?q?1757261603530289039?= |
Series |
Add DT based PCIe wake support in PCI core driver
|
|
Commit Message
Manikanta Maddireddy
Feb. 8, 2023, 11:16 a.m. UTC
Add PCIe port node under the PCIe controller-1 device tree node to support
PCIe WAKE# interrupt for WiFi.
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
---
Changes in v14:
New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin.
.../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++
1 file changed, 11 insertions(+)
Comments
On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: > Add PCIe port node under the PCIe controller-1 device tree node to support > PCIe WAKE# interrupt for WiFi. > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > --- > > Changes in v14: > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > index 8a9747855d6b..9c89be263141 100644 > --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > phys = <&p2u_hsio_3>; > phy-names = "p2u-0"; > + > + pci@0,0 { > + reg = <0x0000 0 0 0 0>; > + #address-cells = <3>; > + #size-cells = <2>; > + ranges; > + > + interrupt-parent = <&gpio>; > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; > + interrupt-names = "wakeup"; > + }; Don't we need to wire this to the PMC interrupt controller and the wake event corresponding to the L2 GPIO? Otherwise none of the wake logic in PMC will get invoked. Thierry
On 2/8/2023 5:07 PM, Thierry Reding wrote: > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: >> Add PCIe port node under the PCIe controller-1 device tree node to support >> PCIe WAKE# interrupt for WiFi. >> >> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> >> --- >> >> Changes in v14: >> New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. >> >> .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >> index 8a9747855d6b..9c89be263141 100644 >> --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >> +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >> @@ -2147,6 +2147,17 @@ pcie@14100000 { >> >> phys = <&p2u_hsio_3>; >> phy-names = "p2u-0"; >> + >> + pci@0,0 { >> + reg = <0x0000 0 0 0 0>; >> + #address-cells = <3>; >> + #size-cells = <2>; >> + ranges; >> + >> + interrupt-parent = <&gpio>; >> + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; >> + interrupt-names = "wakeup"; >> + }; > Don't we need to wire this to the PMC interrupt controller and the wake > event corresponding to the L2 GPIO? Otherwise none of the wake logic in > PMC will get invoked. > > Thierry PCIe wake is gpio based not pmc, only wake support is provided by PMC controller. I verified this patch and able to wake up Tegra from suspend. Petlozu, correct me if my understanding is wrong. Manikanta
On Wed, Feb 08, 2023 at 05:43:35PM +0530, Manikanta Maddireddy wrote: > > On 2/8/2023 5:07 PM, Thierry Reding wrote: > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: > > > Add PCIe port node under the PCIe controller-1 device tree node to support > > > PCIe WAKE# interrupt for WiFi. > > > > > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > > > --- > > > > > > Changes in v14: > > > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. > > > > > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > index 8a9747855d6b..9c89be263141 100644 > > > --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > > phys = <&p2u_hsio_3>; > > > phy-names = "p2u-0"; > > > + > > > + pci@0,0 { > > > + reg = <0x0000 0 0 0 0>; > > > + #address-cells = <3>; > > > + #size-cells = <2>; > > > + ranges; > > > + > > > + interrupt-parent = <&gpio>; > > > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; > > > + interrupt-names = "wakeup"; > > > + }; > > Don't we need to wire this to the PMC interrupt controller and the wake > > event corresponding to the L2 GPIO? Otherwise none of the wake logic in > > PMC will get invoked. > > > > Thierry > PCIe wake is gpio based not pmc, only wake support is provided by PMC > controller. > I verified this patch and able to wake up Tegra from suspend. > Petlozu, correct me if my understanding is wrong. The way that this usually works is that you need to use something like this: interrupt-parent = <&pmc>; interrupts = <1 IRQ_TYPE_LEVEL_LOW>; interrupt-names = "wakeup"; This will then cause the PMC's interrupt chip callbacks to setup all the wake-related interrupts and use the internal wake event tables to forward the GPIO/IRQ corresponding to the PMC wake event to the GPIO controller or GIC, respectively. If you use &gpio as the interrupt parent, none of the PMC logic will be invoked, so unless this is somehow set up correctly by default, the PMC wouldn't be able to wake up the system. Thierry
> > On Wed, Feb 08, 2023 at 05:43:35PM +0530, Manikanta Maddireddy wrote: > > > > On 2/8/2023 5:07 PM, Thierry Reding wrote: > > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy > wrote: > > > > Add PCIe port node under the PCIe controller-1 device tree node to > > > > support PCIe WAKE# interrupt for WiFi. > > > > > > > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > > > > --- > > > > > > > > Changes in v14: > > > > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX > Orin. > > > > > > > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 > +++++++++++ > > > > 1 file changed, 11 insertions(+) > > > > > > > > diff --git > > > > a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > index 8a9747855d6b..9c89be263141 100644 > > > > --- > > > > a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701- > 0000.dt > > > > +++ s > > > > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > > > phys = <&p2u_hsio_3>; > > > > phy-names = "p2u-0"; > > > > + > > > > + pci@0,0 { > > > > + reg = <0x0000 0 0 0 0>; > > > > + #address-cells = <3>; > > > > + #size-cells = <2>; > > > > + ranges; > > > > + > > > > + interrupt-parent = <&gpio>; > > > > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) > IRQ_TYPE_LEVEL_LOW>; > > > > + interrupt-names = "wakeup"; > > > > + }; > > > Don't we need to wire this to the PMC interrupt controller and the > > > wake event corresponding to the L2 GPIO? Otherwise none of the wake > > > logic in PMC will get invoked. > > > > > > Thierry > > PCIe wake is gpio based not pmc, only wake support is provided by PMC > > controller. > > I verified this patch and able to wake up Tegra from suspend. > > Petlozu, correct me if my understanding is wrong. > > The way that this usually works is that you need to use something like > this: > > interrupt-parent = <&pmc>; > interrupts = <1 IRQ_TYPE_LEVEL_LOW>; > interrupt-names = "wakeup"; > > This will then cause the PMC's interrupt chip callbacks to setup all the wake- > related interrupts and use the internal wake event tables to forward the > GPIO/IRQ corresponding to the PMC wake event to the GPIO controller or > GIC, respectively. > > If you use &gpio as the interrupt parent, none of the PMC logic will be > invoked, so unless this is somehow set up correctly by default, the PMC > wouldn't be able to wake up the system. > > Thierry Thierry, Since PMC's IRQ domain is made as parent of GPIO controller's IRQ domain, I think, for GPIO based wakes setting &gpio as the interrupt parent can still invoke PMC logic to program the required registers to enable such wakes. Related commit in this regard: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/gpio/gpio-tegra186.c?id=2a36550567307b881ce570a81189682ae1c9d08d Thanks.
On Thu, Feb 09, 2023 at 10:53:25AM +0000, Petlozu Pravareshwar wrote: > > > > On Wed, Feb 08, 2023 at 05:43:35PM +0530, Manikanta Maddireddy wrote: > > > > > > On 2/8/2023 5:07 PM, Thierry Reding wrote: > > > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy > > wrote: > > > > > Add PCIe port node under the PCIe controller-1 device tree node to > > > > > support PCIe WAKE# interrupt for WiFi. > > > > > > > > > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > > > > > --- > > > > > > > > > > Changes in v14: > > > > > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX > > Orin. > > > > > > > > > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 > > +++++++++++ > > > > > 1 file changed, 11 insertions(+) > > > > > > > > > > diff --git > > > > > a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > > b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > > index 8a9747855d6b..9c89be263141 100644 > > > > > --- > > > > > a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701- > > 0000.dt > > > > > +++ s > > > > > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > > > > phys = <&p2u_hsio_3>; > > > > > phy-names = "p2u-0"; > > > > > + > > > > > + pci@0,0 { > > > > > + reg = <0x0000 0 0 0 0>; > > > > > + #address-cells = <3>; > > > > > + #size-cells = <2>; > > > > > + ranges; > > > > > + > > > > > + interrupt-parent = <&gpio>; > > > > > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) > > IRQ_TYPE_LEVEL_LOW>; > > > > > + interrupt-names = "wakeup"; > > > > > + }; > > > > Don't we need to wire this to the PMC interrupt controller and the > > > > wake event corresponding to the L2 GPIO? Otherwise none of the wake > > > > logic in PMC will get invoked. > > > > > > > > Thierry > > > PCIe wake is gpio based not pmc, only wake support is provided by PMC > > > controller. > > > I verified this patch and able to wake up Tegra from suspend. > > > Petlozu, correct me if my understanding is wrong. > > > > The way that this usually works is that you need to use something like > > this: > > > > interrupt-parent = <&pmc>; > > interrupts = <1 IRQ_TYPE_LEVEL_LOW>; > > interrupt-names = "wakeup"; > > > > This will then cause the PMC's interrupt chip callbacks to setup all the wake- > > related interrupts and use the internal wake event tables to forward the > > GPIO/IRQ corresponding to the PMC wake event to the GPIO controller or > > GIC, respectively. > > > > If you use &gpio as the interrupt parent, none of the PMC logic will be > > invoked, so unless this is somehow set up correctly by default, the PMC > > wouldn't be able to wake up the system. > > > > Thierry > Thierry, > Since PMC's IRQ domain is made as parent of GPIO controller's IRQ domain, > I think, for GPIO based wakes setting &gpio as the interrupt parent can still > invoke PMC logic to program the required registers to enable such wakes. > Related commit in this regard: > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/gpio/gpio-tegra186.c?id=2a36550567307b881ce570a81189682ae1c9d08d Heh... nicely self-owned =). You're right, no need for the detour in DT with those, the GPIO driver will hook up the IRQ hierarchy itself. We already do this for the "power" key in the various gpio-keys, so it should work fine. Sorry for the noise, Thierry
On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: > Add PCIe port node under the PCIe controller-1 device tree node to support > PCIe WAKE# interrupt for WiFi. > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > --- > > Changes in v14: > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > index 8a9747855d6b..9c89be263141 100644 > --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > phys = <&p2u_hsio_3>; > phy-names = "p2u-0"; > + > + pci@0,0 { > + reg = <0x0000 0 0 0 0>; > + #address-cells = <3>; > + #size-cells = <2>; > + ranges; > + > + interrupt-parent = <&gpio>; > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; > + interrupt-names = "wakeup"; WAKE# should be part of the PCIe controller, not device. And the interrupt name should be "wake". - Mani > + }; > }; > > pcie@14160000 { > -- > 2.25.1 >
On 06-12-2023 21:06, Manivannan Sadhasivam wrote: > External email: Use caution opening links or attachments > > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: >> Add PCIe port node under the PCIe controller-1 device tree node to support >> PCIe WAKE# interrupt for WiFi. >> >> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> >> --- >> >> Changes in v14: >> New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. >> >> .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >> index 8a9747855d6b..9c89be263141 100644 >> --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >> +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >> @@ -2147,6 +2147,17 @@ pcie@14100000 { >> >> phys = <&p2u_hsio_3>; >> phy-names = "p2u-0"; >> + >> + pci@0,0 { >> + reg = <0x0000 0 0 0 0>; >> + #address-cells = <3>; >> + #size-cells = <2>; >> + ranges; >> + >> + interrupt-parent = <&gpio>; >> + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; >> + interrupt-names = "wakeup"; > WAKE# should be part of the PCIe controller, not device. And the interrupt name > should be "wake". > > - Mani Hi, Please refer to the discussion in below link, WAKE# is per PCI bridge. https://patchwork.ozlabs.org/project/linux-pci/patch/20171226020806.32710-2-jeffy.chen@rock-chips.com/ I carried wakeup name defined in previous version, but wake seems to be sufficient. Thanks, Manikanta > >> + }; >> }; >> >> pcie@14160000 { >> -- >> 2.25.1 >> > -- > மணிவண்ணன் சதாசிவம்
On Thu, Dec 07, 2023 at 12:54:04PM +0530, Manikanta Maddireddy wrote: > > On 06-12-2023 21:06, Manivannan Sadhasivam wrote: > > External email: Use caution opening links or attachments > > > > > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: > > > Add PCIe port node under the PCIe controller-1 device tree node to support > > > PCIe WAKE# interrupt for WiFi. > > > > > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > > > --- > > > > > > Changes in v14: > > > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. > > > > > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > index 8a9747855d6b..9c89be263141 100644 > > > --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > > > > > phys = <&p2u_hsio_3>; > > > phy-names = "p2u-0"; > > > + > > > + pci@0,0 { > > > + reg = <0x0000 0 0 0 0>; > > > + #address-cells = <3>; > > > + #size-cells = <2>; > > > + ranges; > > > + > > > + interrupt-parent = <&gpio>; > > > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; > > > + interrupt-names = "wakeup"; > > WAKE# should be part of the PCIe controller, not device. And the interrupt name > > should be "wake". > > > > - Mani > Hi, > > Please refer to the discussion in below link, WAKE# is per PCI bridge. > https://patchwork.ozlabs.org/project/linux-pci/patch/20171226020806.32710-2-jeffy.chen@rock-chips.com/ > PCIe Host controller (RC) usually represents host bridge + PCI-PCI bridge. We do not represent the PCI-PCI bridge in devicetree for any platforms, but only RC as a whole. Moreover, PERST# is already defined in RC node. So it becomes confusing if WAKE# is defined in a child node representing bridge. So please move WAKE# to RC node. - Mani > I carried wakeup name defined in previous version, but wake seems to be > sufficient. > > Thanks, > Manikanta > > > > > + }; > > > }; > > > > > > pcie@14160000 { > > > -- > > > 2.25.1 > > > > > -- > > மணிவண்ணன் சதாசிவம்
On 07-12-2023 13:29, Manivannan Sadhasivam wrote: > External email: Use caution opening links or attachments > > > On Thu, Dec 07, 2023 at 12:54:04PM +0530, Manikanta Maddireddy wrote: >> On 06-12-2023 21:06, Manivannan Sadhasivam wrote: >>> External email: Use caution opening links or attachments >>> >>> >>> On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: >>>> Add PCIe port node under the PCIe controller-1 device tree node to support >>>> PCIe WAKE# interrupt for WiFi. >>>> >>>> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> >>>> --- >>>> >>>> Changes in v14: >>>> New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. >>>> >>>> .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ >>>> 1 file changed, 11 insertions(+) >>>> >>>> diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >>>> index 8a9747855d6b..9c89be263141 100644 >>>> --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >>>> +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts >>>> @@ -2147,6 +2147,17 @@ pcie@14100000 { >>>> >>>> phys = <&p2u_hsio_3>; >>>> phy-names = "p2u-0"; >>>> + >>>> + pci@0,0 { >>>> + reg = <0x0000 0 0 0 0>; >>>> + #address-cells = <3>; >>>> + #size-cells = <2>; >>>> + ranges; >>>> + >>>> + interrupt-parent = <&gpio>; >>>> + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; >>>> + interrupt-names = "wakeup"; >>> WAKE# should be part of the PCIe controller, not device. And the interrupt name >>> should be "wake". >>> >>> - Mani >> Hi, >> >> Please refer to the discussion in below link, WAKE# is per PCI bridge. >> https://patchwork.ozlabs.org/project/linux-pci/patch/20171226020806.32710-2-jeffy.chen@rock-chips.com/ >> > PCIe Host controller (RC) usually represents host bridge + PCI-PCI bridge. We do > not represent the PCI-PCI bridge in devicetree for any platforms, but only RC as > a whole. > > Moreover, PERST# is already defined in RC node. So it becomes confusing if > WAKE# is defined in a child node representing bridge. > > So please move WAKE# to RC node. > > - Mani Hi, We can define PCI-PCI bridge in device tree, refer to below device tree which has 3 ports under a controller, with PERST#(reset-gpios) defined per port. https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/apple/t8103.dtsi#n749 Also, of_pci_setup_wake_irq() in below patch is parsing "wakeup" from PCI bridge, not from the host bridge. https://patchwork.ozlabs.org/project/linux-pci/patch/20230208111645.3863534-4-mmaddireddy@nvidia.com/ If a controller has only one port it has to define a PCI bridge under controller device tree node and add wakeup interrupt property, refer to below patch from original author. https://www.spinics.net/lists/linux-pci/msg135569.html Thanks, Manikanta > >> I carried wakeup name defined in previous version, but wake seems to be >> sufficient. >> >> Thanks, >> Manikanta >>>> + }; >>>> }; >>>> >>>> pcie@14160000 { >>>> -- >>>> 2.25.1 >>>> >>> -- >>> மணிவண்ணன் சதாசிவம் > -- > மணிவண்ணன் சதாசிவம்
On Thu, Dec 07, 2023 at 02:23:46PM +0530, Manikanta Maddireddy wrote: > > On 07-12-2023 13:29, Manivannan Sadhasivam wrote: > > External email: Use caution opening links or attachments > > > > > > On Thu, Dec 07, 2023 at 12:54:04PM +0530, Manikanta Maddireddy wrote: > > > On 06-12-2023 21:06, Manivannan Sadhasivam wrote: > > > > External email: Use caution opening links or attachments > > > > > > > > > > > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy wrote: > > > > > Add PCIe port node under the PCIe controller-1 device tree node to support > > > > > PCIe WAKE# interrupt for WiFi. > > > > > > > > > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> > > > > > --- > > > > > > > > > > Changes in v14: > > > > > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX Orin. > > > > > > > > > > .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 11 +++++++++++ > > > > > 1 file changed, 11 insertions(+) > > > > > > > > > > diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > > index 8a9747855d6b..9c89be263141 100644 > > > > > --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts > > > > > @@ -2147,6 +2147,17 @@ pcie@14100000 { > > > > > > > > > > phys = <&p2u_hsio_3>; > > > > > phy-names = "p2u-0"; > > > > > + > > > > > + pci@0,0 { > > > > > + reg = <0x0000 0 0 0 0>; > > > > > + #address-cells = <3>; > > > > > + #size-cells = <2>; > > > > > + ranges; > > > > > + > > > > > + interrupt-parent = <&gpio>; > > > > > + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; > > > > > + interrupt-names = "wakeup"; > > > > WAKE# should be part of the PCIe controller, not device. And the interrupt name > > > > should be "wake". > > > > > > > > - Mani > > > Hi, > > > > > > Please refer to the discussion in below link, WAKE# is per PCI bridge. > > > https://patchwork.ozlabs.org/project/linux-pci/patch/20171226020806.32710-2-jeffy.chen@rock-chips.com/ > > > > > PCIe Host controller (RC) usually represents host bridge + PCI-PCI bridge. We do > > not represent the PCI-PCI bridge in devicetree for any platforms, but only RC as > > a whole. > > > > Moreover, PERST# is already defined in RC node. So it becomes confusing if > > WAKE# is defined in a child node representing bridge. > > > > So please move WAKE# to RC node. > > > > - Mani > > Hi, > > We can define PCI-PCI bridge in device tree, refer to below device tree > which has 3 ports under a controller, > with PERST#(reset-gpios) defined per port. > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/apple/t8103.dtsi#n749 > Hmm. For RCs with single bridge, we never defined a DT node (atleast on Qcom platforms). But I think it is the time to fix them. > Also, of_pci_setup_wake_irq() in below patch is parsing "wakeup" from PCI > bridge, not from the host bridge. > https://patchwork.ozlabs.org/project/linux-pci/patch/20230208111645.3863534-4-mmaddireddy@nvidia.com/ > I didn't say that WAKE# should be parsed from host bridge, it doesn't make sense. But I get your point. > If a controller has only one port it has to define a PCI bridge under > controller device tree node and > add wakeup interrupt property, refer to below patch from original author. > > https://www.spinics.net/lists/linux-pci/msg135569.html > Yes, I agree. Thanks for the clarification. - Mani > Thanks, > Manikanta > > > > > I carried wakeup name defined in previous version, but wake seems to be > > > sufficient. > > > > > > Thanks, > > > Manikanta > > > > > + }; > > > > > }; > > > > > > > > > > pcie@14160000 { > > > > > -- > > > > > 2.25.1 > > > > > > > > > -- > > > > மணிவண்ணன் சதாசிவம் > > -- > > மணிவண்ணன் சதாசிவம்
diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts index 8a9747855d6b..9c89be263141 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts @@ -2147,6 +2147,17 @@ pcie@14100000 { phys = <&p2u_hsio_3>; phy-names = "p2u-0"; + + pci@0,0 { + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + interrupt-parent = <&gpio>; + interrupts = <TEGRA234_MAIN_GPIO(L, 2) IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "wakeup"; + }; }; pcie@14160000 {