linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Huacai Chen <chenhuacai@loongson.cn>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	linux-pci@vger.kernel.org, "Jianmin Lv" <lvjianmin@loongson.cn>,
	"Xuefeng Li" <lixuefeng@loongson.cn>,
	"Huacai Chen" <chenhuacai@gmail.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] PCI: PM: Fix PCIe MRRS restoring for Loongson
Date: Wed, 26 Jun 2024 10:08:20 -0500	[thread overview]
Message-ID: <20240626150820.GA1466617@bhelgaas> (raw)
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: <stable@vger.kernel.org>
> Fixes: 8b3517f88ff2983f ("PCI: loongson: Prevent LS7A MRRS increases")
> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>  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 <asm/dma.h>
>  #include <linux/aer.h>
>  #include <linux/bitfield.h>
> +#include <linux/suspend.h>
>  #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
> 

  reply	other threads:[~2024-06-26 15:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23  3:39 [PATCH] PCI: PM: Fix PCIe MRRS restoring for Loongson Huacai Chen
2024-06-26 15:08 ` Bjorn Helgaas [this message]
2024-07-02  7:04   ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240626150820.GA1466617@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=chenhuacai@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lvjianmin@loongson.cn \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).