All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Huacai Chen" <chenhuacai@loongson.cn>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	linux-pci@vger.kernel.org, "Jianmin Lv" <lvjianmin@loongson.cn>,
	"Xuefeng Li" <lixuefeng@loongson.cn>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	HougeLangley <hougelangley1987@gmail.com>,
	"Thorsten Leemhuis" <regressions@leemhuis.info>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"WANG Xuerui" <kernel@xen0n.name>
Subject: Re: [PATCH V2 1/2] PCI: loongson: Improve the MRRS quirk for LS7A
Date: Tue, 31 Jan 2023 19:54:31 +0800	[thread overview]
Message-ID: <CAAhV-H6L3V8M4igCWBH=PzuDcoH0KreWkfqHexQwB2v+2TSi=A@mail.gmail.com> (raw)
In-Reply-To: <20230131001601.GA1718721@bhelgaas>

Hi, Bjorn,

On Tue, Jan 31, 2023 at 8:16 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Fri, Jan 06, 2023 at 05:51:42PM +0800, Huacai Chen wrote:
> > In new revision of LS7A, some PCIe ports support larger value than 256,
> > but their maximum supported MRRS values are not detectable. Moreover,
> > the current loongson_mrrs_quirk() cannot avoid devices increasing its
> > MRRS after pci_enable_device(), and some devices (e.g. Realtek 8169)
> > will actually set a big value in its driver. So the only possible way
> > is configure MRRS of all devices in BIOS, and add a pci host bridge bit
> > flag (i.e., no_inc_mrrs) to stop the increasing MRRS operations.
> >
> > However, according to PCIe Spec, it is legal for an OS to program any
> > value for MRRS, and it is also legal for an endpoint to generate a Read
> > Request with any size up to its MRRS. As the hardware engineers say, the
> > root cause here is LS7A doesn't break up large read requests. In detail,
> > LS7A PCIe port reports CA (Completer Abort) if it receives a Memory Read
> > request with a size that's "too big" ("too big" means larger than the
> > PCIe ports can handle, which means 256 for some ports and 4096 for the
> > others, and of course this is a problem in the LS7A's hardware design).
>
> Can you take a look at
> https://bugzilla.kernel.org/show_bug.cgi?id=216884 ?
>
> That claims to be a regression between v6.1 and v6.2-rc2, and WANG
> Xuerui says this patch is the fix (though AFAICT the submitter has not
> verified this yet).  If so, we should reference that bug here and try
> to get this in v6.2.
Yes, this patch can fix that issue. But I don't think this is a
regression, vanila 6.1 kernel also has this problem, maybe the
reporter uses a patched 6.1 kernel.

Huacai
>
> See below.
>
> > -             if (pci_match_id(bridge_devids, bridge)) {
> > -                     if (pcie_get_readrq(dev) > 256) {
> > -                             pci_info(dev, "limiting MRRS to 256\n");
> > -                             pcie_set_readrq(dev, 256);
> > -                     }
> > -                     break;
> > -             }
>
> > +     if (bridge->no_inc_mrrs) {
> > +             if (rq > pcie_get_readrq(dev))
> > +                     return -EINVAL;
>
> I think the message about limiting MRRS was useful and we should keep
> it.
>
> Bjorn

  reply	other threads:[~2023-01-31 11:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  9:51 [PATCH V2 0/2] PCI: Add two Loongson's LS7A quirks Huacai Chen
2023-01-06  9:51 ` [PATCH V2 1/2] PCI: loongson: Improve the MRRS quirk for LS7A Huacai Chen
2023-01-31  0:16   ` Bjorn Helgaas
2023-01-31 11:54     ` Huacai Chen [this message]
2023-01-06  9:51 ` [PATCH V2 2/2] PCI: Add quirk for LS7A to avoid reboot failure Huacai Chen
2023-01-06 15:38   ` Bjorn Helgaas
2023-01-07  2:25     ` Huacai Chen
2023-01-19 12:25       ` Huacai Chen
2023-01-19 12:50         ` Bjorn Helgaas
2023-01-20 13:31           ` Huacai Chen
2023-01-20 15:36             ` Bjorn Helgaas
2023-01-21 15:10               ` Huacai Chen
2023-01-30 12:35                 ` Thorsten Leemhuis
2023-02-01 22:10                   ` Bjorn Helgaas
2023-01-31  0:01                 ` Bjorn Helgaas
2023-01-31 12:02                   ` 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='CAAhV-H6L3V8M4igCWBH=PzuDcoH0KreWkfqHexQwB2v+2TSi=A@mail.gmail.com' \
    --to=chenhuacai@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=chenhuacai@loongson.cn \
    --cc=helgaas@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=hougelangley1987@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lvjianmin@loongson.cn \
    --cc=regressions@leemhuis.info \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.