Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1359814lqp; Mon, 15 Apr 2024 04:23:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0Sz+N+hZz9lheOVHGTc84GGwSCFpT4gvzr6UBDZO+6FgkVl2gKPMFSwDV1cTIS4s1JFIokhLdN9HmJFZgydbqmbdpeWRTiwNr0ktzmg== X-Google-Smtp-Source: AGHT+IHaPPn50VFSoylzkCE9kWByZKC/a5G3oYkiOl7yWlr6YLKQwiWlLDAkQ2Vnygh7ywQ039wL X-Received: by 2002:a05:6358:838c:b0:186:1b05:5182 with SMTP id c12-20020a056358838c00b001861b055182mr7783746rwk.13.1713180202926; Mon, 15 Apr 2024 04:23:22 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s133-20020a63778b000000b005e428bea40esi7680910pgc.0.2024.04.15.04.23.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 04:23:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144981-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=WTl381cz; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-144981-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 72004285DF6 for ; Mon, 15 Apr 2024 11:22:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 165FB5FB85; Mon, 15 Apr 2024 11:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="WTl381cz" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2052.outbound.protection.outlook.com [40.107.93.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B2341E896; Mon, 15 Apr 2024 11:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.52 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713180157; cv=fail; b=ly0QcPepnL3pXQxhFv13EaUwxZ2E8bfY2rtCaig0s7FIt7tBdygaDWb7TTbdCQyMUXvcvKDSjd+XBn1uX2kGLMdcmBy/O9/Oqoq8sxnNAelCzLCEWyj2bMkFc2hSSYcctcZ8+ZMbtrGephXyYOsX9WKnQQAi7S+DtRA/jggKhUc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713180157; c=relaxed/simple; bh=pQNEcgMeP5VHOMEhtli0Kx4MXsigE9saJoMi0VOE1Dk=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=klfsN86quWp2nSdk9PrSc2p3vbSizTpUW9SImndsJeB2Iq/8cg2S+fZIuJ6e1GDppadi3NHNlChLXbSI4Dj37tARud5p6kUL3RQnkwyW7W1TVmQ4kJV5cZFSuFrKbCdxuJSKJGMSEHxmz+jCZhjvTDwSCKBDLa+/iG7KQbdmVMk= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=WTl381cz; arc=fail smtp.client-ip=40.107.93.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K8jUcx2ZkSovekq9Zt40pKHxVOlDGdJkkJ+6WG5L70hWMnvLLjWwotEAFdE4prnluUZeEcCJKZSmJd5LA+bhcZmaCsN9Pq2werjf/VFGCFOSUmNoNBtJMZT/GpjRXK99jsnXLRD3OmSzaSYxNY35vjqGSICaNf1L4B0OqVYyz9PMv4rXd0HE295qq56msXtraJR9Zzf04AuXxdj49QCrdm5rthoQZCbJwnISxVz4lvt3ensrYOSbGIEhHC8KYIP3IaZXdC4xbuKwRzhGHBsxEHBv5WWQu8hEqwwct4ad4IOz3vBQMaOFPZ+9QukDo2GM9Eea9yjOgIAb3IMXkq5wJQ== 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=ZW0/tjjy1Ubg7/v8Q/h05Cbrn5Kh+CxkEitp9J56oE4=; b=Fs1ZRPV3fg74D6hA2mk8/8kvHJ6YGLtgiJpyiW0y6U0z/RB5N1OPAO233CGotVuC4jEqRFL3IRtRe57muGwkpjyIo34p4+/7+C8DVTlL15R5c/w2CIWdVgBNq3l3kKVEDCrwaOGEgahQazZNm9M8d1OcYkBVw4F9O++LhibwFsMoKChKmZXlfw47MRfRLrOPtiqDwP30OMqMvVla9JUC0/dmN+LORw40gSJyhKwudIQy/Mo+5Gx0NKk5oO9LS0MY0dLihykBGhAz40yrQ4HfGSFpvE/AQ9ioiTdJyqJ+OHV2ISV3B3KEYd1eTukeNCKhlQITSy3v2vWwAIGVp6COUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=ZW0/tjjy1Ubg7/v8Q/h05Cbrn5Kh+CxkEitp9J56oE4=; b=WTl381cz5HHAX37HJfkZYCqBuG+LMhDMZLV+zXRnDLnOvv2zjMchrSbkX149bx0cC2b/1cSkDxl0oKQmpePJn7/gBdhuGWGeMi9LrhxVV9gUiLRjjRXEVqSj9hsI9lLslZvV2KO31zkz7B05LU1iwCt6Sha9zu6tuoSmH8J9I5tCaGHsuKL7fB68S6n4GjH9qcp41ZCSM13VonNjvsxIlo1tlM3nDwvZAHIUobtBltlK/qeE1hhnmp4QoE6n5yAnJlax9WEk1qd3sBi0W+uS/KHlkq1Pr1EJQvf8VgEe2oikJUFxjNpIo29Qku7HxHjtG7pThgRziqzB/ORVuPDJQA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from PH8PR12MB6674.namprd12.prod.outlook.com (2603:10b6:510:1c1::18) by PH7PR12MB5805.namprd12.prod.outlook.com (2603:10b6:510:1d1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Mon, 15 Apr 2024 11:22:31 +0000 Received: from PH8PR12MB6674.namprd12.prod.outlook.com ([fe80::780:77f6:e0af:5b5c]) by PH8PR12MB6674.namprd12.prod.outlook.com ([fe80::780:77f6:e0af:5b5c%4]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 11:22:29 +0000 Message-ID: <86039c78-d05f-4bae-b2cb-55bbfca8f798@nvidia.com> Date: Mon, 15 Apr 2024 16:52:08 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2] PCI: tegra194: Fix probe path for Endpoint mode To: Bjorn Helgaas Cc: lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com References: <20240412191402.GA10938@bhelgaas> Content-Language: en-US From: Vidya Sagar In-Reply-To: <20240412191402.GA10938@bhelgaas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MA0PR01CA0081.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ae::8) To PH8PR12MB6674.namprd12.prod.outlook.com (2603:10b6:510:1c1::18) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR12MB6674:EE_|PH7PR12MB5805:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bc8dd16-27e8-4c80-6cb0-08dc5d3e5622 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NuzLvFOx7JdgQfFmuZOvhdFEBLZkkptwpkjUq2RyVeNu24NLkMVKgai/Kaudh2eOSUWIt1/U2jGMuJ0eJNGf/jETeuPn9Rtmeq3cFLr0fxMM0sCqAW5wkapWEJvQkpGm6cGkhTB5LCnAsbDD6x3VcKPwP6g1oIcrNjAGfM+QGeYzMDOw2WJVA3RD7035Y/QHJXrKatgV8eAx8ldbhE1xn2s+CGYY8XhsNvZsIkBFYgWnutO6onm6b8YNG7dG6bj2UZgoTFZpk4nutYwsffyKRplIdonDAsz7c4geFI7UnAbqgMFavynF6+S9jl0V5ZYXcP1tNy8FyaA8A/TrXJ+n9/RklvXdHOXfRba6r8TOAFsaeFyjteJR7pug1jb+BtIincw8r5DkBO2c+RsHO4YSJ5k4mKq1Dcwenf2K4eUwciD9tmVMJfQlLvV1OtBkalN98MEGO3O40U0DE2dgwuIMdhet4Semp3XVYAFpJxRQeYqV9SbXcwVEG3GjJfxHP30vV4NgbvV7olP7BDGeL9dARVveGsodaF7NoVub2OKy5zVdsvugU9MKJueNVJkCiwvhvyI/WsTGLjbb/iqg2xUn1BhOqKjaiDavK8CdvU74wjQYkvXf56zfS0JYCFodve2LDecRqKN7L8gUGa40M4GN5ujNpBJVN47dW0vX7yHuXXY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB6674.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(7416005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N3ZmMlJnMjM4Z0VsTE5mR1NMNEg1TkhUcXcrQkZCbkRZVXdDb0pFQlkyLzNu?= =?utf-8?B?dFVlanJ1ekFUSFplMEVkRUkwVEdFeGVUVEt6Tlh3dnRRaGRtTE9iZTk4WElx?= =?utf-8?B?ZXJhdG1waU5qVGhieVoySTQ3SmtKaUF1N1luZ1dkeFFmT2ZMVnppUXVITFkz?= =?utf-8?B?YWZVdEw5RitBbngvNndCNXo5MzN4d3FXVjNXMjk4U1BYNUZQR1ErbVRhc3g0?= =?utf-8?B?YXQ3cmIxZ29xbEt4RFBXdnErMzliRFF3OFNUMFF4SEtjOUQ0Y2xzSFFTTHpO?= =?utf-8?B?aC8vTjJlTlR3SWcyZzlyZm5qeE13SDJkanFaeXVVRDVTN0haVzZWM25WK3JH?= =?utf-8?B?YmFWNTcwbkdNUlpBdUF5c1d4RDVraVpkY2dheEhFajFG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ossTenant-Network-Message-Id: 9bc8dd16-27e8-4c80-6cb0-08dc5d3e5622 X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB6674.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 11:22:29.8325 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Iz7EOLLIKL37kO5owjT8H7NJMz/gNZRwNvixgFLiijEVurg0me6ZKIB1UOgvt20WnnV0s35H/F2GHk+IVBjlug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5805 It was Jon Hunter (jonathanh@nvidia.com), who identified the issue. Credits to him. I'm merely upstreaming the fix. Thanks, Vidya Sagar On 13-04-2024 00:44, Bjorn Helgaas wrote: > External email: Use caution opening links or attachments > > > On Mon, Apr 08, 2024 at 03:00:53PM +0530, Vidya Sagar wrote: >> Tegra194 PCIe probe path is taking failure path in success case for >> Endpoint mode. Return success from the switch case instead of going >> into the failure path. >> >> Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194") >> Signed-off-by: Vidya Sagar >> Reviewed-by: Jon Hunter >> --- >> v2: >> * Added 'Fixes' and 'Reviewed-by' from Jon Hunter >> >> drivers/pci/controller/dwc/pcie-tegra194.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c >> index 4bba31502ce1..1a8178dc899a 100644 >> --- a/drivers/pci/controller/dwc/pcie-tegra194.c >> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c >> @@ -2273,11 +2273,14 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev) >> ret = tegra_pcie_config_ep(pcie, pdev); >> if (ret < 0) >> goto fail; >> + else >> + return 0; > Wow, how did you ever notice this? It looks like this path would > previously have returned "ret" (which was most likely 0 for success) > but with an extra tegra_bpmp_put() that we shouldn't have done. > > Eagle eyes! > >> break; >> >> default: >> dev_err(dev, "Invalid PCIe device type %d\n", >> pcie->of_data->mode); >> + ret = -EINVAL; >> } >> >> fail: >> -- >> 2.25.1 >>