From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A9A31547DC for ; Mon, 5 Aug 2024 15:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722872155; cv=none; b=tst3EA3nrN0ZTEv73Sd27Ef3j8tElXRnxzSsf8qMCZhIDyLfTim5ejMn5opld74WKbj0WS1nWKYPmjb8TViWU6M7tQZHhpy6XDcpZSBSiYxHGStEtjtpgzSXoogvcPM2ff8OUFGoFDoNBzY+6SxcVI7ginf8TZLFAX71taUDtWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722872155; c=relaxed/simple; bh=v2ERA9o7/xVC+jk2zxDSTBfNpKA5+JJHS1aHhP5v/sg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Kwdfpn1uvdMa74wi+64fdmcjylUlJsuuNQMP5f1xOOIQmribxFqGSC9WlvBpcZkrnAqSGMPuJXU3FEuBZUPELS3S6GbZ8Eao4z/CPMeRpW+Zi0Qr7xNwLNrr9m6AkEyNZT9YS8IfT1hl5S0xbl5mDaiYW1i2aonx1v4/5bdqRTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gbcljqG+; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gbcljqG+" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-70d2b921cd1so9605147b3a.1 for ; Mon, 05 Aug 2024 08:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722872153; x=1723476953; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=kaNxJBlznx6y0vjgoBqt7rcaY0nzk8O5nbByfKyVdkM=; b=gbcljqG+NpDriZ2wzLDdZYfIEhBjzUYwJJA328LRp3T2z+iTq8Iopvkd0vNy6JO8Pz YtGuQzgBNQa6oTBrkt+zv+p6bALdttEp7l2ViQmQ+cVNC4TyT4bwrMHphn+UVka6BHg0 Q5Zpe3IrWZmT0Xrhzm4DsCA5NrVDWyi3tK1zay97gLUBBTdTi1udpXDgCMBBMDTc4QGp u8lRVdvrd8eeKQnLdsmIWVdBu0UqONNipMRiXguERSiY2fJQ9U+/VRowTAkvkA3ZpomX yA3DD65e7H2VfuqHf1KRtNtiWtk//GyQeblOvXdpADkU1OHvbYgyH0g233h6BAlc7L18 cD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722872153; x=1723476953; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kaNxJBlznx6y0vjgoBqt7rcaY0nzk8O5nbByfKyVdkM=; b=J3Onwt0BkGMiqLaXm47w36Sl/LIunOy9SuvELvQMuJca01H9s2k70InvPVPNeMkxZv 5fPGSlHa72rWSYyaEyh6SNLIFM158uSs7ayJ4QQbws/3jfAVvT2yt1+gBLFcDKyC+yPh wt9PKecSy+2qBwnpam3MLNvsizuWt/nzz9SKvJ3ZTdIP0foLnsm2nUK+0qGcavpS7UIo B69pVvCeMcQehBtSn2Gw/8dW37/dnmh8JdMvlZoEddHxrnRDLp/BXnmoALQQBDx86Iop pMZcgXLLS40UvvBwHAX1ccqhsJJlEzA6xoxJtdJeKdLF2eEbRdJUn5hQsnSHEyrG+5ne 5UnQ== X-Forwarded-Encrypted: i=1; AJvYcCUwdx5C/wU/cfSsXoTcH8L9RVzzsMqlduD4ruI2fbNt6CBSk6zgV3wfRIhTGhFtp1Ks+kA8sfaJ6PDjC1wjgdoMbhr7RSsl4nYZ5KLY X-Gm-Message-State: AOJu0Yxl0BgUnLjWoTGyKqU6cWJZAZqjBUfsIz8bzTy4sof0kSrje+4w sfwPk7NNyCTqehCbLmap5d4q38A59vm+dGlDUagdkRybAAg3c04WsVkDh7uxyg== X-Google-Smtp-Source: AGHT+IF/U0Q1PobUn7t5WL8VXgXR+W38KeWOWYVnqFO/t8f7Bw/Vwj5BN+d89aomfHaopFlJNaJ26g== X-Received: by 2002:a05:6a00:21cf:b0:70d:281d:ee8c with SMTP id d2e1a72fcca58-7106cfdca5dmr14410623b3a.18.1722872153206; Mon, 05 Aug 2024 08:35:53 -0700 (PDT) Received: from thinkpad ([120.56.197.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ecfc344sm5543790b3a.151.2024.08.05.08.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 08:35:52 -0700 (PDT) Date: Mon, 5 Aug 2024 21:05:46 +0530 From: Manivannan Sadhasivam To: Hsin-Yi Wang Cc: Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, lukas@wunner.de, mika.westerberg@linux.intel.com Subject: Re: [PATCH v4 3/4] PCI: Decouple D3Hot and D3Cold handling for bridges Message-ID: <20240805153546.GE7274@thinkpad> References: <20240326-pci-bridge-d3-v4-0-f1dce1d1f648@linaro.org> <20240326-pci-bridge-d3-v4-3-f1dce1d1f648@linaro.org> <20240802053302.GB4206@thinkpad> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Aug 02, 2024 at 12:53:42PM -0700, Hsin-Yi Wang wrote: [...] > > > [ 42.202016] mt7921e 0000:01:00.0: PM: calling > > > pci_pm_suspend_noirq+0x0/0x300 @ 77, parent: 0000:00:00.0 > > > [ 42.231681] mt7921e 0000:01:00.0: PCI PM: Suspend power state: D3hot > > > > Here I can see that the port entered D3hot > > > This one is the wifi device connected to the port. > Ah, okay. You could've just shared the logs for the bridge/rootport. > > > [ 42.238048] mt7921e 0000:01:00.0: PM: > > > pci_pm_suspend_noirq+0x0/0x300 returned 0 after 26583 usecs > > > [ 42.247083] pcieport 0000:00:00.0: PM: calling > > > pci_pm_suspend_noirq+0x0/0x300 @ 3196, parent: pci0000:00 > > > [ 42.296325] pcieport 0000:00:00.0: PCI PM: Suspend power state: D0 > > > This is the port suspended with D0. If we hack power_manageable to > only consider D3hot, the state here for pcieport will become D3hot > (compared in below). > > If it's D0 (and s2idle), in resume it won't restore config: > https://elixir.bootlin.com/linux/v6.10/source/drivers/pci/pci-driver.c#L959, > and in resume it would be an issue. > > Comparison: > 1. pcieport can go to D3: > (suspend) > [ 61.645809] mt7921e 0000:01:00.0: PM: calling > pci_pm_suspend_noirq+0x0/0x2f8 @ 1139, parent: 0000:00:00.0 > [ 61.675562] mt7921e 0000:01:00.0: PCI PM: Suspend power state: D3hot > [ 61.681931] mt7921e 0000:01:00.0: PM: > pci_pm_suspend_noirq+0x0/0x2f8 returned 0 after 26502 usecs > [ 61.690959] pcieport 0000:00:00.0: PM: calling > pci_pm_suspend_noirq+0x0/0x2f8 @ 3248, parent: pci0000:00 > [ 61.755359] pcieport 0000:00:00.0: PCI PM: Suspend power state: D3hot > [ 61.761832] pcieport 0000:00:00.0: PM: > pci_pm_suspend_noirq+0x0/0x2f8 returned 0 after 61345 usecs > Why the device state is not saved? Did you skip those logs? > (resume) > [ 65.243981] pcieport 0000:00:00.0: PM: calling > pci_pm_resume_noirq+0x0/0x190 @ 3258, parent: pci0000:00 > [ 65.253122] mtk-pcie-phy 16930000.phy: CKM_38=0x13040500, > GLB_20=0x0, GLB_30=0x0, GLB_38=0x30453fc, GLB_F4=0x1453b000 > [ 65.262725] pcieport 0000:00:00.0: PM: > pci_pm_resume_noirq+0x0/0x190 returned 0 after 175 usecs > [ 65.273159] mtk-pcie-phy 16930000.phy: No calibration info > [ 65.281903] mt7921e 0000:01:00.0: PM: calling > pci_pm_resume_noirq+0x0/0x190 @ 3259, parent: 0000:00:00.0 > [ 65.297108] mt7921e 0000:01:00.0: PM: pci_pm_resume_noirq+0x0/0x190 > returned 0 after 329 usecs > > > 2. pcieport stays at D0 due to power_manageable returns false: > (suspend) > [ 52.435375] mt7921e 0000:01:00.0: PM: calling > pci_pm_suspend_noirq+0x0/0x300 @ 2040, parent: 0000:00:00.0 > [ 52.465235] mt7921e 0000:01:00.0: PCI PM: Suspend power state: D3hot > [ 52.471610] mt7921e 0000:01:00.0: PM: > pci_pm_suspend_noirq+0x0/0x300 returned 0 after 26602 usecs > [ 52.480674] pcieport 0000:00:00.0: PM: calling > pci_pm_suspend_noirq+0x0/0x300 @ 143, parent: pci0000:00 > [ 52.529876] pcieport 0000:00:00.0: PCI PM: Suspend power state: D0 > <-- port is still D0 > [ 52.536056] pcieport 0000:00:00.0: PCI PM: Skipped > > (resume) > [ 56.026298] pcieport 0000:00:00.0: PM: calling > pci_pm_resume_noirq+0x0/0x190 @ 3243, parent: pci0000:00 > [ 56.035379] mtk-pcie-phy 16930000.phy: CKM_38=0x13040500, > GLB_20=0x0, GLB_30=0x0, GLB_38=0x30453fc, GLB_F4=0x1453b000 > [ 56.044776] pcieport 0000:00:00.0: PM: > pci_pm_resume_noirq+0x0/0x190 returned 0 after 13 usecs > [ 56.055409] mtk-pcie-phy 16930000.phy: No calibration info > [ 56.064098] mt7921e 0000:01:00.0: PM: calling > pci_pm_resume_noirq+0x0/0x190 @ 3244, parent: 0000:00:00.0 > [ 56.078962] mt7921e 0000:01:00.0: Unable to change power state from > D3hot to D0, device inaccessible <-- resume failed. This means the port entered D3Cold? This is not expected during s2idle. During s2idle, devices should be put into low power state and their power should be preserved. Who is pulling the plug here? - Mani -- மணிவண்ணன் சதாசிவம்