From patchwork Sun Jun 23 03:39:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 13708478 X-Patchwork-Delegate: bhelgaas@google.com 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 284A32F3E; Sun, 23 Jun 2024 03:40:02 +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=1719114003; cv=none; b=ga0iv+pWQBc0XGUwRSc+4T0u8pKTGQjRKASpGXv3dYu/iFkJh3dICsafssmII5lmFnay2UYUYHzLT8lOwe4GTEeqSXAdrq8bnhepjhIf6kfw657vXlsmnyg5Cc6oU/cwPUQN/sqwI7rmLDmJMfYSP7q0fVkUNpc7wh7VcykmvxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719114003; c=relaxed/simple; bh=Qc3CeTYvV1MZkceXws1jwevQaWSoCuVCP2eU2GhHEuU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WBxJINT7iRMMB2uupnuNYIrAuh13Epo8IwIeWfXbIbXGfUy/ub8XWVQOfwNU7tzOivPEnfCPgUSlLGUgIZoGkUuQuFnTW0qaWN9suKaYGZdpYVmrah9iXSH9cEj93qiVboaTLJUNEsR+aBst3zrFHb8SzUEOocYCMLYe0ysz348= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D82DC2BD10; Sun, 23 Jun 2024 03:39:59 +0000 (UTC) From: Huacai Chen To: Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring Cc: linux-pci@vger.kernel.org, Jianmin Lv , Xuefeng Li , Huacai Chen , Jiaxun Yang , Huacai Chen , stable@vger.kernel.org Subject: [PATCH] PCI: PM: Fix PCIe MRRS restoring for Loongson Date: Sun, 23 Jun 2024 11:39:40 +0800 Message-ID: <20240623033940.1806616-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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)) { int max_mrrs = pcie_get_readrq(dev); if (rq > max_mrrs) {