Message ID | 20230606071717.8088-1-pshete@nvidia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3206870vqr; Tue, 6 Jun 2023 00:25:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68kDK9tgRva40+VU2HFPIp6EJrwUuaqC90DURhdeNC8hXnNMIff/WTZ0FaPgYFtR0/DGkc X-Received: by 2002:a6b:e31a:0:b0:777:b409:fb67 with SMTP id u26-20020a6be31a000000b00777b409fb67mr1804386ioc.4.1686036357764; Tue, 06 Jun 2023 00:25:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686036357; cv=pass; d=google.com; s=arc-20160816; b=BcN9rSqJtEsPxI4bPfssAUTOhO5su8kuWkYheKZ647VWBhbAv8v1BT0xysoF0el46Q EAhqzyTOF9kDTBLzZABbRDeaLuJjvmAUJqbsn23XiNoJJ/BWNl39CFa/55P87I8ni3xi Nivp6x+slybqEiQ+GuR000kLYRtVHQ997R/wo4/WJPRy4UrWxdqcYy8jLnfj3zx7tOSA vuqUNQh4/+s0JoskF7KIZcd67QLWG86O9QCb4Q1cmnqO88/e4FwWujM3/YxbXKCfTIef Pydy3gtkLO8nr+A0GqNBLawGFFo/Jtv8peqRlbhQbWiiRfPePz+cmgK91QA1e9F383mQ FG/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=M5trypg3Bl1eCB1K4LKqR9nKEOn51CwCSFnFfOf/kUI=; b=JF6Fu//mxf7ZTky3DtlIb0eVHmmG2orvL2zvoZv0ybg8MUnDwgaI2oHpqC8uVkWDSE kBH+2CzTDFD1PaNL0cyQ3SBE8lBBlNLnK/GBhOm2UF9G/BXlfzxGMi0sGseHK7eQW39N mdmy9fXFhypkvQuIV2mmOVZTmF6e3kGvTWLCKc9z7QZnIJiRk58DT8aru+1dNMt5Nxxv eKEe8hK34IawDVinVFi4QjQT35+KOBBQkNjlkRRu6pqP7g1cSCuN/KKii0LDty6HBL+P 3hpYnpMlOrbYjwt80y/EblOnGEKvNFEUk3tN2EBrSA2Tv9OfMsFV4WpbHQjczgwFIgTg fd9w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=bUSOa3WU; 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 x69-20020a638648000000b005347fcb7853si7061329pgd.140.2023.06.06.00.25.45; Tue, 06 Jun 2023 00:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=bUSOa3WU; 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 S236278AbjFFHSc (ORCPT <rfc822;xxoosimple@gmail.com> + 99 others); Tue, 6 Jun 2023 03:18:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236167AbjFFHSG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 6 Jun 2023 03:18:06 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2050.outbound.protection.outlook.com [40.107.101.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F929E7C; Tue, 6 Jun 2023 00:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dnN4NWRLa61xhCjpmU1NKYD/i1mPfXC6c2NK4uP85IhdZU+MFO5NaZahzbBT9srbOv126W4uqWJIJf1ZgkKWat2Ci+kDJQ8wJcb5bbQLZo7PlYsYtuNWXnVTEn+cEgmqDJLDQGVrPPZpOAKBbzFkDthmqR3YhHp+6IOqq258RXZbOGtoGBU9wK7ulu4Cx3/87HvkWHT1uII/6z0ubXeueQvvHXDmNdQnDFLuOhKjgg0l0+Fsda0wsWDWedboKmCXxO+o9nsrc9aO+BgapYYQiEUAJ2yjESC4nNSh0WxlKzmNwvv1MbffjEIBigKNUV9e/6eJFjhliGCiG3Hf2KsVBQ== 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=M5trypg3Bl1eCB1K4LKqR9nKEOn51CwCSFnFfOf/kUI=; b=j0knZiNRsJQz4/EqV8Pmjlj/CVE9iGue3Cj7JJW/PmF5/7DJHedb2ViGgmBM42AzMZJ/tIzPBJKb5ahXM7xP5hxbaBMeZEWzOpNKlKM03T3SJSw1f/4nKFsC0E+6JX9hZtU67xhOiCFYZdPkuUKVZKDER9S+nCXCtUgigwScPf/vc0ntp2xfTvU2VJ4qDhX3sJi7QlV9wzR3egdByZopA+6wYLMzRcoptgIrmiRLUPe56sydsbZ3k1W/jqzXBf2KNFWkIh4TRuRDtvUU7yrbq3qXLUmcQCyJj3vsOZqyFUjxeXLe9KP0OEt7/MWlPgq6WI9xrzErEhRcd7Z+oAEZEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=linaro.org 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=M5trypg3Bl1eCB1K4LKqR9nKEOn51CwCSFnFfOf/kUI=; b=bUSOa3WUsSEqcnn8X6LURyRJIUK7NanCWf8gF/8Ud4PfXMDxb/U0NItKy2FJ+hXG/9wq05/sm2PtZb5qn/KVBHDz1mDvv4c18dTfNkVdHcJNyjDN05G4LzJBmcefH8WWhQWgePo3P1YnrDdRKQuCacBPw72FRLeA3nrZhtekgzyqsLeRUIRwvJqMSVfYNP5VyCvcLJ/SiEbX63C/pijBsUlhd38509SXzj4nVq9FtO8N0d3W+3VvB9ZLNSU2eWWtG/ywEZfc32rldXTDMGAoO9d2Ye48QwOoGYLgs8wY7XHYlmUBMGB9gYVK7f9Wu7V2IVG+U85XF5IPOtmootCYcw== Received: from DS7PR03CA0150.namprd03.prod.outlook.com (2603:10b6:5:3b4::35) by DM4PR12MB6301.namprd12.prod.outlook.com (2603:10b6:8:a5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 07:17:38 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:5:3b4:cafe::4f) by DS7PR03CA0150.outlook.office365.com (2603:10b6:5:3b4::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Tue, 6 Jun 2023 07:17:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.13 via Frontend Transport; Tue, 6 Jun 2023 07:17:37 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 6 Jun 2023 00:17:28 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 6 Jun 2023 00:17:27 -0700 Received: from pshete-ubuntu.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Tue, 6 Jun 2023 00:17:24 -0700 From: Prathamesh Shete <pshete@nvidia.com> To: <linus.walleij@linaro.org>, <brgl@bgdev.pl>, <thierry.reding@gmail.com>, <jonathanh@nvidia.com>, <linux-tegra@vger.kernel.org>, <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <smangipudi@nvidia.com>, <pshete@nvidia.com>, Manish Bhardwaj <mbhardwaj@nvidia.com> Subject: [PATCH] gpio: tegra186: Check PMC driver status before any request Date: Tue, 6 Jun 2023 12:47:17 +0530 Message-ID: <20230606071717.8088-1-pshete@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE33:EE_|DM4PR12MB6301:EE_ X-MS-Office365-Filtering-Correlation-Id: 30ce5e62-005f-4c33-80a7-08db665e1bb3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5T4KY6d/hr/fAHBPOeKTSaxDvmN9I7gA534+0Qi+LaNoM81ZtZGARRh/6JgYQjQtl3EYFE/sTeX9kkk/PQd0uC9PYLbl1KmGu8ZENGAyd+w4HnVAfTAQZ6aRo2YGAK9pbflqTRs3jPrZgSMZyZENU7YLQg5IBtavEdjMgsD0WTRvjUxa6guQoA5STv4G0tHsd/GtUaLQU2v4km26Qtg8ngb4xLNEBs9u6Lp8raM7+jbNzReop9xKUnRMjy4UAinqBrMS/ryrCh2T7ABK8Nok923TDl1wLtxLFbpQpgB1lAqFdqaorMMAP2naC35/5mDhYG1jq/WgLEoY2c35kKjFN7zmo0EAo8PRLTgmrsJOqLu+ESMG1HK3A7k+wC7ByxfJvHkca13Ei/pkT4rL2ifBKpKprwvYXasLZB1f0ozE++5l9hgg4xng6QY1rF77pTNiPJ9llR+L3XBaa6tBzUWDREDYjj2dR6GcMAot03nCcAa4cwh8qUqGe8bLcqEFYBJ4h9sP+FLeE9OEyfAizc1SICMjdDyuthhmx0+O41jCT6Ke90Dzm0bJdDc2tEu4YdoQNGEgWSbzJVxnJn4l2lx4/yPekPfNovZLGK5PS7l9lewVpjjjVybp0Z/yo3NOagkJ7q1vHVhVvNtQs+C9Ij4A1EthVcUz0zo5TK+j2R6Kes78nhYJD9CwheRps9jxHZ9L19Srd6R256kY7GfG3txcZZzBEsW62mOgvyh9zL2ElVk= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(8936002)(8676002)(107886003)(7696005)(478600001)(110136005)(54906003)(41300700001)(5660300002)(6666004)(316002)(1076003)(26005)(70586007)(70206006)(4326008)(2616005)(186003)(83380400001)(40460700003)(2906002)(47076005)(426003)(336012)(7636003)(82740400003)(40480700001)(356005)(36860700001)(86362001)(82310400005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 07:17:37.8733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30ce5e62-005f-4c33-80a7-08db665e1bb3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6301 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, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <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?1767937260149084839?= X-GMAIL-MSGID: =?utf-8?q?1767937260149084839?= |
Series |
gpio: tegra186: Check PMC driver status before any request
|
|
Commit Message
Prathamesh Shete
June 6, 2023, 7:17 a.m. UTC
This patch fixes the issue where even if PMC driver status is disabled still we are trying to look up for the IRQ domain that PMC driver would've registered if it had been enabled. Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com> Signed-off-by: Prathamesh Shete <pshete@nvidia.com> --- drivers/gpio/gpio-tegra186.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
Comments
On 06/06/2023 08:17, Prathamesh Shete wrote: > This patch fixes the issue where even if PMC driver status is > disabled still we are trying to look up for the IRQ domain > that PMC driver would've registered if it had been enabled. It might be clearer to say ... When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. Fix this by checking to see if the PMC device is enabled before attempting to lookup the IRQ domain registered by the PMC. Otherwise ... Reviewed-by: Jon Hunter <jonathanh@nvidia.com> > Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com> > Signed-off-by: Prathamesh Shete <pshete@nvidia.com> > --- > drivers/gpio/gpio-tegra186.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c > index 464b0ea3b6f1..80d08ddde40e 100644 > --- a/drivers/gpio/gpio-tegra186.c > +++ b/drivers/gpio/gpio-tegra186.c > @@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev) > > np = of_find_matching_node(NULL, tegra186_pmc_of_match); > if (np) { > - irq->parent_domain = irq_find_host(np); > - of_node_put(np); > - > - if (!irq->parent_domain) > - return -EPROBE_DEFER; > + if (of_device_is_available(np)) { > + irq->parent_domain = irq_find_host(np); > + of_node_put(np); > + > + if (!irq->parent_domain) > + return -EPROBE_DEFER; > + } else { > + of_node_put(np); > + } > } > > irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
Tue, Jun 06, 2023 at 12:47:17PM +0530, Prathamesh Shete kirjoitti: > This patch fixes the issue where even if PMC driver status is > disabled still we are trying to look up for the IRQ domain > that PMC driver would've registered if it had been enabled. -ENOPARSE. Also mind grammar punctuation.
On 06/06/2023 09:53, Jon Hunter wrote: > > On 06/06/2023 08:17, Prathamesh Shete wrote: >> This patch fixes the issue where even if PMC driver status is >> disabled still we are trying to look up for the IRQ domain >> that PMC driver would've registered if it had been enabled. > > It might be clearer to say ... > > When the PMC device is disabled, probing of the Tegra186 GPIO driver > fails because the IRQ domain that is registered by the PMC driver is not > found. Fix this by checking to see if the PMC device is enabled before > attempting to lookup the IRQ domain registered by the PMC. It could also be worth noting that it is OK to skip the PMC IRQ domain in this case because this only impacts wake-ups and not GPIO functionality in general. Jon
On Tue, Jun 6, 2023 at 9:17 AM Prathamesh Shete <pshete@nvidia.com> wrote: > This patch fixes the issue where even if PMC driver status is > disabled still we are trying to look up for the IRQ domain > that PMC driver would've registered if it had been enabled. > > Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com> > Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Patch applied! Yours, Linus Walleij
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c index 464b0ea3b6f1..80d08ddde40e 100644 --- a/drivers/gpio/gpio-tegra186.c +++ b/drivers/gpio/gpio-tegra186.c @@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev) np = of_find_matching_node(NULL, tegra186_pmc_of_match); if (np) { - irq->parent_domain = irq_find_host(np); - of_node_put(np); - - if (!irq->parent_domain) - return -EPROBE_DEFER; + if (of_device_is_available(np)) { + irq->parent_domain = irq_find_host(np); + of_node_put(np); + + if (!irq->parent_domain) + return -EPROBE_DEFER; + } else { + of_node_put(np); + } } irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,