From: Bjorn Helgaas <helgaas@kernel.org>
To: Xi Ruoyao <xry111@xry111.site>
Cc: "Mario Limonciello" <mario.limonciello@amd.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Ziyao Li" <liziyao@uniontech.com>,
niecheng1@uniontech.com, zhanjun@uniontech.com,
guanwentao@uniontech.com, "Kexy Biscuit" <kexybiscuit@aosc.io>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
loongarch@lists.linux.dev, kernel@uniontech.com,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Lain Fearyncess Yang" <fsf@live.com>,
"Ayden Meng" <aydenmeng@yeah.net>,
"Mingcong Bai" <jeffbai@aosc.io>,
stable@vger.kernel.org, "Huacai Chen" <chenhuacai@kernel.org>,
"Huacai Chen" <chenhuacai@loongson.cn>
Subject: Re: [PATCH v8] PCI: loongson: Override PCIe bridge supported speeds for Loongson-3C6000 series
Date: Tue, 19 May 2026 16:52:22 -0500 [thread overview]
Message-ID: <20260519215222.GA18171@bhelgaas> (raw)
In-Reply-To: <9d815df3b33a63223112b97440c01247935363c1.camel@xry111.site>
On Tue, May 19, 2026 at 10:23:22AM +0800, Xi Ruoyao wrote:
> On Mon, 2026-05-18 at 13:53 -0500, Mario Limonciello wrote:
> > > > Also, the amdgpu driver reads the value by pcie_get_speed_cap() in
> > > > amdgpu_device_partner_bandwidth(), for its dynamic adjustment of PCIe
> > > > clocks and lanes in power management. We hope this patch can prevent
> > > > similar problems in future driver changes (similar checks may be
> > > > implemented in other GPU, storage controller, NIC, etc. drivers).
> > >
> > > Why is this paragraph here? Is there code in
> > > amdgpu_device_partner_bandwidth() that wouldn't be needed after this
> > > patch?
> >
> > I don't think that would be the case as this patch is a pure quirk for
> > one device.
> >
> > The policy we have in amdgpu_device_partner_bandwidth() takes into
> > account specifically the topology of dGPUs that have integrated PCI
> > switches.
> >
> > We need to look at the speed and width of the link partner connected to
> > the switch not between the switch and the GPU PCI device.
>
> Yes, the paragraph was intended to explain why the lower speed only
> manifests on some (not all) PCIe devices, for example amdgpu, with the
> incorrect LinkCap2 from hardware.
>
> > > This patch updates pdev->supported_speeds, which is used by
> > > pcie_get_speed_cap(), which is in turn used by
> > > amdgpu_device_partner_bandwidth().
> > >
> > > Is the point just that users of pcie_get_speed_cap() (currently just
> > > amdgpu, radeon, and sysfs) will now see the correct maximum link speed
> > > for Loongson-3C6000 bridges?
> > >
> > > And the "checks" you refer to would be the tests in
> > > amdgpu_device_get_pcie_info() that use the results of
> > > pcie_get_speed_cap()?
> >
> > I think I agree with Bjorn to drop the paragraph, it just adds confusion
> > to the reader.
> >
> > You can have a sentence along the lines of "Updating the speeds to the
> > correct actual support of the hardware avoids quirks in drivers
> > consuming the speed information".
>
> Yes, it will seem better.
>
> Bjorn: do you need a v9 or would you just amend the message in your
> tree?
I amended the commit log:
...
As a result, since commit 774c71c52aa4 ("PCI/bwctrl: Enable only if more
than one speed is supported"), bwctrl will be disabled if there's only
one 2.5 GT/s value in vector 'supported_speeds'.
Manually override the 'supported_speeds' field for affected PCIe bridges
with those found on the upstream bus to correctly reflect the supported
link speeds. Updating the speeds to reflect what the hardware actually
supports avoids quirks in drivers consuming the speed information.
prev parent reply other threads:[~2026-05-19 21:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 10:17 [PATCH v8] PCI: loongson: Override PCIe bridge supported speeds for Loongson-3C6000 series Xi Ruoyao
2026-04-27 2:17 ` Ping: " Xi Ruoyao
2026-05-12 11:36 ` Manivannan Sadhasivam
2026-05-18 17:21 ` Bjorn Helgaas
2026-05-18 18:53 ` Mario Limonciello
2026-05-19 2:23 ` Xi Ruoyao
2026-05-19 21:52 ` Bjorn Helgaas [this message]
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=20260519215222.GA18171@bhelgaas \
--to=helgaas@kernel.org \
--cc=aydenmeng@yeah.net \
--cc=bhelgaas@google.com \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=fsf@live.com \
--cc=guanwentao@uniontech.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jeffbai@aosc.io \
--cc=kernel@uniontech.com \
--cc=kexybiscuit@aosc.io \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=liziyao@uniontech.com \
--cc=loongarch@lists.linux.dev \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=mario.limonciello@amd.com \
--cc=niecheng1@uniontech.com \
--cc=robh@kernel.org \
--cc=stable@vger.kernel.org \
--cc=xry111@xry111.site \
--cc=zhanjun@uniontech.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).