From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2063.outbound.protection.outlook.com [40.107.21.63]) (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 2C45B54728; Mon, 11 Nov 2024 16:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.63 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731341899; cv=fail; b=YX4qu1euJfR26PDHOTfA4ACYfB1E3xI7UcDoMdw5PQly5mM+DLECr/VzZs0jken5Cahj59tBO+V/xllC3hdoKDRPthLZNCtEZKdGLlosdh7P+gQca+Lhmp3G1ysnfge2eDEVC8XrxO72YroenAapdHTJwTQaAZ1R6+/b+E6v1EI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731341899; c=relaxed/simple; bh=nUaSiwQA9OHl+ya2gD7cmHNJqKLoPd07Au3+ChrbYsE=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=MKQecuO14FbaLRSrDBveumIfA80nUTnRzPwSGyMjH/Ae5vT9/0KFXMZjSqDMB3lmOnbV2mDi1lgqkrWE2g+uLJ6oAPXRaTUetVqBIWsM/R7nzWeJjC3lGqiEW+Ou7nMFUuQySnp7JaqSETBellFbb//TKWOWZi7pyXS5MlcAltM= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=FEN5MEFa; arc=fail smtp.client-ip=40.107.21.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="FEN5MEFa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GXrMb99nj7bm19LeyETCNGxOO11rPqlMdT7QYUFUnEsJ/Rz0CApn7u8ftyI+PzonXcZPyof+Att8wcEYyeoH+RXFJfT+AK3j0sY2mj6glciidpl3K+K7mUq1fu6DMY72Wy3IdSJM7mqDNH6FHM0xrvc9GVHALLwOP+ycY61lNAObzFdvWa5ERvHzWeCvgf+4+GYQmAWswInd0PWwOqiU+Bf5DRJBN1moSnd0TI4Hd9EKCsYBbH5tw2L6AS9iZGQoYD3ozD/hCf9QFNmOFEWKXGTcBJIrkb+e+YLckHU6oCld5aaI/GQC9kPsgVtlOIVuSsiYsi7u7ZzIrLM0hp8x7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oCZQthyOH7dZGlaP/X9ZHU0x/q4RyJ8stekV+S7c5io=; b=pH+3tC2pLGos+b8autL9sWRVcN0OireouzeQnAKXLa6zjqTBjIW3HgrR7KES6Top69RIYlORgNSK7gKsZdshk35UUlkxQImAaGJV9CkuchRmDkR8j2Z8WQ4NeQKoUkD5pIOTr3zGCISyMNqWlL8GJtVTmBx2ga0IRybzcCTiBo7VmwKJaydg1nKJnETbR2jcRLbrkngGEFWSdZ1v1zNXN/dkwBJxC8t0LWfCM6fJcw/A8pxK3mRoHaSBVqFpfDmu7sSdHtzdxo+4M9aO9l11WpUdGmwnXKy5jIPJ+YBkWsRmdDgVlXqWxPny8O3EP8ehENgGJR7d/FdKhHACsgwwXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oCZQthyOH7dZGlaP/X9ZHU0x/q4RyJ8stekV+S7c5io=; b=FEN5MEFaC0swCyzhzd54PU02gJ7MjdGCo/ry4dqxQAc9j/78qdpF30un/nAxbR8vikQElINcHndbosETHUgec6TOKZum07UN+zEuMOgJa4TdByOCd6qFwNiINBCaVcx9/Y7XQzjz40gBF5m4rLNLrF3vqvZmxaY9u15P93o/bPEYsHE32JhwO3E3aGwCmbmRD94Q4bFroGo7eTuPpVHGF4Hfljv4WG5YWM2DbLgG2omaB+Ym5Z2oqbqc43hLm7AMUFSIe7ulT0xYEzE72IOBMYAlWluVSgUPUYY7pRecse3UK6fH7qcesl3jZQcQGl466mUlU2yunWOBqeJ3XsKaCA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by DU0PR04MB9371.eurprd04.prod.outlook.com (2603:10a6:10:35a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 16:18:13 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%3]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 16:18:13 +0000 Date: Mon, 11 Nov 2024 11:18:05 -0500 From: Frank Li To: Manivannan Sadhasivam Cc: Hongxing Zhu , Krishna Chaitanya Chundru , Bjorn Helgaas , "jingoohan1@gmail.com" , "bhelgaas@google.com" , "lpieralisi@kernel.org" , "kw@linux.com" , "robh@kernel.org" , "imx@lists.linux.dev" , "kernel@pengutronix.de" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1] PCI: dwc: Clean up some unnecessary codes in dw_pcie_suspend_noirq() Message-ID: References: <20241108002425.GA1631063@bhelgaas> <20241111053322.bh6qhoigqdxui65l@thinkpad> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241111053322.bh6qhoigqdxui65l@thinkpad> X-ClientProxiedBy: SJ0PR05CA0102.namprd05.prod.outlook.com (2603:10b6:a03:334::17) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::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: DB9PR04MB9626:EE_|DU0PR04MB9371:EE_ X-MS-Office365-Filtering-Correlation-Id: 082e2965-d246-4dd8-531c-08dd026c70d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WlI2cUlMWkdwVU1yamlSRk85Rmlab1VEa2EyZzFoQmdOWnFCVmNjaDdiOTda?= =?utf-8?B?UHFiRXdTT2k2NkVhU0xUZUFxTXozbm9XdUVZQ1U2TTZHazh4Yzk4YlB2b2kv?= =?utf-8?B?MnE3ZkxTMXpJU3BpcElTdlVhS2lpYnc3ZUFlNWR1UVI2YmpuUHNhcFRSd0Z3?= =?utf-8?B?UFRTRkozUm1Xak9YenFxOGVqZjhnTUg5Rm43VDZTWjBvQS96bVVZejVFYm4v?= =?utf-8?B?U1Z5VFdRWkt6YkoyZDJhb2hPN2tybStEMUZvZFByejdEN2VCWlVram1yV0F3?= =?utf-8?B?WUw3WjRtVlhJdzlrTWVVcWdMWlhvN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MaXlPdlJBYkIzMjB2cDk1R2JseFJrRm5OcnB3bWNHUlpD?= =?utf-8?B?eWtmbnA0dkdnRmpzMU8rUi9WYWZIZHIvY2JFVEFKNEQvTllmMGJRWDRHRFRl?= =?utf-8?B?dW50Rlc4ZXlWZkV1cVh2VlBSTmN2T0ZBVGVEaEw0RHFEN1piMmgzT0RzOGIv?= =?utf-8?B?MFdlSWo3VEpicDJ5d1JTTkpheHd0a3FEeW5kV2VseWt0alBTUEFPYWQzd1Ro?= =?utf-8?B?RytuVG1tNUE4eHhoU0FZNHRjRmVJeXFUNEhlVXZqNFc3WklVd3V5eHh2MXl2?= =?utf-8?B?VFhvUTlkWk9FZnMvY21zdHQrckJrSllUcTNKa05aMmVpNHYyTWVJeGVmSXll?= =?utf-8?B?TVo0ajFiZ1lrV09RaFF1bUxmQkdscThxVTlZanI0M2dLSEZKRjN6QmpiaVVC?= =?utf-8?B?anZzS3o0Sm4xR2JsNGp0MGV6Sll3dmxHR1dhUDBsUFl6cmFmTlZUM3hVM3ZT?= =?utf-8?B?QzJGSkZHcVVSMGhGU2xGTkgxaEpYcUc3azZWTmxYQmJPbUY5b0d2eGJnYlVU?= =?utf-8?B?T2o1a2JPR3ZsT1dLOHE0TkFxY3ZlMyt0SVhRMDlzRWtjb0lCdzZxOHJsQWRC?= =?utf-8?Q?QuWKJhI36zAWAy0f4rfl05gQDXq7HfghUlU/Y=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Ny9YeGN0b2hSczBDL0FzaW5tNGlTMVhQZ0dOV2lRU0R6cnJCU25qdTkxb3hP?= =?utf-8?B?M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QakE3OGJleDlHZnkw?= =?utf-8?B?RXNUdWNMRWRobGl2VkNWY0Zrblp6a1JHRFJudDNmaThJYVZuemRLK3FkOHls?= =?utf-8?B?NFdzNTBoZW1PWFNnNVIyOWYrU0preXRtUUU0aXB1aURXK0M1N0IyalE4Y0Q4?= =?utf-8?B?K2M3Ym12MXBpWFhKaC85azcrNUd6QTNKbXMxZXgrWEZWbEVla29Vd1RkcCsy?= =?utf-8?B?Z0VnQXZhc3hwRUlsZStGQzVRWUoyVXZsaUllck1oc09LK0hxLytpem82MzQy?= =?utf-8?Q?cFE6Da8ftj/xlBK6EMhvtGixW?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 082e2965-d246-4dd8-531c-08dd026c70d7 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 16:18:13.1611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aY49aUDbBbpf7M2kadhUdqcq7Jc//VXHvT3nOhoU2NKJAALzv7xjRoGa3h77slzWxiAdky6MEVVbLusq4utMEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9371 On Mon, Nov 11, 2024 at 11:03:22AM +0530, Manivannan Sadhasivam wrote: > On Mon, Nov 11, 2024 at 03:29:18AM +0000, Hongxing Zhu wrote: > > > -----Original Message----- > > > From: Krishna Chaitanya Chundru > > > Sent: 2024年11月10日 8:10 > > > To: Bjorn Helgaas ; Manivannan Sadhasivam > > > > > > Cc: Hongxing Zhu ; jingoohan1@gmail.com; > > > bhelgaas@google.com; lpieralisi@kernel.org; kw@linux.com; > > > robh@kernel.org; Frank Li ; imx@lists.linux.dev; > > > kernel@pengutronix.de; linux-pci@vger.kernel.org; > > > linux-kernel@vger.kernel.org > > > Subject: Re: [PATCH v1] PCI: dwc: Clean up some unnecessary codes in > > > dw_pcie_suspend_noirq() > > > > > > > > > > > > On 11/8/2024 5:54 AM, Bjorn Helgaas wrote: > > > > On Thu, Nov 07, 2024 at 11:13:34AM +0000, Manivannan Sadhasivam > > > wrote: > > > >> On Thu, Nov 07, 2024 at 04:44:55PM +0800, Richard Zhu wrote: > > > >>> Before sending PME_TURN_OFF, don't test the LTSSM stat. Since it's > > > >>> safe to send PME_TURN_OFF message regardless of whether the link is > > > >>> up or down. So, there would be no need to test the LTSSM stat before > > > >>> sending PME_TURN_OFF message. > > > >> > > > >> What is the incentive to send PME_Turn_Off when link is not up? > > > > > > > > There's no need to send PME_Turn_Off when link is not up. > > > > > > > > But a link-up check is inherently racy because the link may go down > > > > between the check and the PME_Turn_Off. Since it's impossible for > > > > software to guarantee the link is up, the Root Port should be able to > > > > tolerate attempts to send PME_Turn_Off when the link is down. > > > > > > > > So IMO there's no need to check whether the link is up, and checking > > > > gives the misleading impression that "we know the link is up and > > > > therefore sending PME_Turn_Off is safe." > > > > > > > Hi Bjorn, > > > > > > I agree that link-up check is racy but once link is up and link has gone down > > > due to some reason the ltssm state will not move detect quiet or detect act, it > > > will go to pre detect quiet (i.e value 0f 0x5). > > > we can assume if the link is up LTSSM state will greater than detect act even if > > > the link was down. > > > > > > - Krishna Chaitanya. > > > >>> Remove the L2 poll too, after the PME_TURN_OFF message is sent out. > > > >>> Because the re-initialization would be done in > > > >>> dw_pcie_resume_noirq(). > > > >> > > > >> As Krishna explained, host needs to wait until the endpoint acks the > > > >> message (just to give it some time to do cleanups). Then only the > > > >> host can initiate D3Cold. It matters when the device supports L2. > > > > > > > > The important thing here is to be clear about the *reason* to poll for > > > > L2 and the *event* that must wait for L2. > > > > > > > > I don't have any DesignWare specs, but when dw_pcie_suspend_noirq() > > > > waits for DW_PCIE_LTSSM_L2_IDLE, I think what we're doing is waiting > > > > for the link to be in the L2/L3 Ready pseudo-state (PCIe r6.0, sec > > > > 5.2, fig 5-1). > > > > > > > > L2 and L3 are states where main power to the downstream component is > > > > off, i.e., the component is in D3cold (r6.0, sec 5.3.2), so there is > > > > no link in those states. > > > > > > > > The PME_Turn_Off handshake is part of the process to put the > > > > downstream component in D3cold. I think the reason for this handshake > > > > is to allow an orderly shutdown of that component before main power is > > > > removed. > > > > > > > > When the downstream component receives PME_Turn_Off, it will stop > > > > scheduling new TLPs, but it may already have TLPs scheduled but not > > > > yet sent. If power were removed immediately, they would be lost. My > > > > understanding is that the link will not enter L2/L3 Ready until the > > > > components on both ends have completed whatever needs to be done with > > > > those TLPs. (This is based on the L2/L3 discussion in the Mindshare > > > > PCIe book; I haven't found clear spec citations for all of it.) > > > > > > > > I think waiting for L2/L3 Ready is to keep us from turning off main > > > > power when the components are still trying to dispose of those TLPs. > > > > > > > > So I think every controller that turns off main power needs to wait > > > > for L2/L3 Ready. > > > > > > > > There's also a requirement that software wait at least 100 ns after > > > > L2/L3 Ready before turning off refclock and main power (sec > > > > 5.3.3.2.1). > > Thanks for the comments. > > So, the L2 poll is better kept, since PCIe r6.0, sec 5.3.3.2.1 also recommends > > 1ms to 10ms timeout to check L2 ready or not. > > The v2 of this patch would only remove the LTSSM stat check when issue > > the PME_TURN_OFF message if there are no further comments. > > > > If you unconditionally send PME_Turn_Off message, then you'd end up polling for > L23 Ready, which may result in a timeout and users will see the error message. > This is my concern. Yes, may we can check if entry L2 or link down, so no such message print for link down case. Frank > > - Mani > > -- > மணிவண்ணன் சதாசிவம்