From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4562418509F; Wed, 26 Jun 2024 15:08:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719414503; cv=none; b=pEOe8rYbeRcXBkjgH2Kn9kghmOms3Jy6UP60F7RD76/ol3FEYp9OE1LnImLhK/6dACDF3KRF+ccIZPQSbjSjx0MIBBDpyLnqpCwacFNIq/6oQNd5GhG3ZkWH3NtqVjY+tfHuXRMqEkxHcHs+nom6CrhaNOh5JnLwmGUX62Dhcs0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719414503; c=relaxed/simple; bh=QPet1PZlyBbbtlEE9TjbBmawH/TuKsCLb0EzxOzVoZU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=s2HSclEnTxpli2ZZ495htIT2BzlrNwSAsTfsj0RzutADRyldHmV/qJc63w4KYe1GycHxQqtgKvQc4APJrTlFGT7+YchMd7HhN0dr8A4+wm1IhttaI8bBsmpjYqY1Qc7Ha28/H/UwRw4BnxQzN4zQjpS4IN22+Drd7mm8nCaxkY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oKLlX19I; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oKLlX19I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99F84C116B1; Wed, 26 Jun 2024 15:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719414502; bh=QPet1PZlyBbbtlEE9TjbBmawH/TuKsCLb0EzxOzVoZU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=oKLlX19IFDMsVZhAio5B06r4zvLtnslkjhVb3qRAA5y1puDvmhES4RBsf7b/eueBF IwSM5Xk8qh5ZfEm3kK/0HQwC5KZP7EOLy5i87fFIuYxYnGHVK5uBNAnEaw+Gcwdasi 8hmLVpwLrdEByXHnQxRMZW6FBtQN8TT5ubHTDDMS5RKaZTVFDWxb7bv0+AW5LmVVfI d8AiRlVyaoeOyv59u51Qao6wI+KNJZHyImUXxBzZmwZQ4ClneYAvb5Idjbmwq8F1Ij L1u3Dy1E4QyaE7pxeL+1viwYbwU/iEBnWN70cve2PrAmc/QPS19bA/vVJIgYTvuess UdN/hnyWSyj0A== Date: Wed, 26 Jun 2024 10:08:20 -0500 From: Bjorn Helgaas To: Huacai Chen Cc: Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , linux-pci@vger.kernel.org, Jianmin Lv , Xuefeng Li , Huacai Chen , Jiaxun Yang , stable@vger.kernel.org Subject: Re: [PATCH] PCI: PM: Fix PCIe MRRS restoring for Loongson Message-ID: <20240626150820.GA1466617@bhelgaas> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240623033940.1806616-1-chenhuacai@loongson.cn> On Sun, Jun 23, 2024 at 11:39:40AM +0800, Huacai Chen wrote: > Don't limit MRRS during resume, so that saved value can be restored, > otherwise the MRRS will become the minimum value after resume. > > Cc: > Fixes: 8b3517f88ff2983f ("PCI: loongson: Prevent LS7A MRRS increases") > Signed-off-by: Jianmin Lv > Signed-off-by: Huacai Chen > --- > drivers/pci/pci.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 35fb1f17a589..bfc806d9e9bd 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -31,6 +31,7 @@ > #include > #include > #include > +#include > #include "pci.h" > > DEFINE_MUTEX(pci_slot_mutex); > @@ -5945,7 +5946,7 @@ int pcie_set_readrq(struct pci_dev *dev, int rq) > > v = FIELD_PREP(PCI_EXP_DEVCTL_READRQ, ffs(rq) - 8); > > - if (bridge->no_inc_mrrs) { > + if (bridge->no_inc_mrrs && (pm_suspend_target_state == PM_SUSPEND_ON)) { I don't think we can check pm_suspend_target_state here. That seems like a layering/encapsulation problem. Are we failing to save this state at suspend? Seems like something we should address more explicitly higher up in the suspend/resume path where we save/restore config space. > int max_mrrs = pcie_get_readrq(dev); > > if (rq > max_mrrs) { > -- > 2.43.0 >