From: Hans Zhang <18255117159@163.com>
To: lpieralisi@kernel.org, kwilczynski@kernel.org,
bhelgaas@google.com, helgaas@kernel.org, heiko@sntech.de,
mani@kernel.org, yue.wang@Amlogic.com
Cc: pali@kernel.org, neil.armstrong@linaro.org, robh@kernel.org,
jingoohan1@gmail.com, khilman@baylibre.com, jbrunet@baylibre.com,
martin.blumenstingl@googlemail.com, cassel@kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org,
linux-rockchip@lists.infradead.org,
Hans Zhang <18255117159@163.com>
Subject: [PATCH v9 0/3] PCI: Configure Root Port MPS during host probing
Date: Wed, 16 Sep 2026 23:39:04 +0800 [thread overview]
Message-ID: <20260916153907.60344-1-18255117159@163.com> (raw)
Current PCIe enumeration configures each device's Maximum Payload Size
(MPS) top-down to match its upstream bridge. Root Ports, however, return
early from pci_configure_mps() because they have no upstream bridge, so
their MPS may remain at firmware defaults and fail to use the controller's
full capability.
There is also a hierarchy problem when a device's MPS Supported (MPSS) is
smaller than the MPS already programmed above it. The existing reduction
only lowers a Root Port. If a Switch is in between, the Switch ports keep
the larger MPS and the endpoint is left mismatched, which can cause
Malformed TLPs.
This series addresses both issues:
1. Patch 1 fixes pci_configure_mps() so that when a device's MPSS is
smaller than the MPS already in use above it, the whole Root Port
hierarchy is reduced as necessary, including Switch ports and
already-programmed sibling devices.
2. Patch 2 safely initializes Root Port MPS to its maximum supported value
during host probing. Patch 1 ensures this larger initial value is
reduced again when downstream devices require a smaller MPS.
PCIE_BUS_TUNE_OFF and PCIE_BUS_PEER2PEER are left untouched.
3. Patch 3 removes the now-redundant Meson PCIe driver MPS programming and
cleans up the resulting dead macros and misleading MRRS helper name.
---
Changes in v9:
- Add patch 1 to reduce the whole Root Port hierarchy when a downstream device
has a smaller MPSS, addressing the Switch case reported by sashiko.
- Patch 2 keeps the Root Port max-MPS initialization, adds error handling, and
relies on patch 1 for later reduction.
- Patch 3 drops PCIE_CAP_MAX_PAYLOAD_SIZE and MAX_PAYLOAD_SIZE, renames
meson_size_to_payload() to meson_size_to_mrrs(), and updates the warning.
Changes in v8:
https://patchwork.kernel.org/project/linux-pci/patch/20260911132145.211380-1-18255117159@163.com/
- Rebase to v7.3-rc1.
Changes in v7:
https://patchwork.kernel.org/project/linux-pci/cover/20251127170908.14850-1-18255117159@163.com/
- Exclude PCIE_BUS_PEER2PEER mode from Root Port MPS configuration
- Remove redundant check for upstream bridge (Root Ports don't have one)
- Improve commit message and code comments as per Bjorn.
Changes for v6:
https://patchwork.kernel.org/project/linux-pci/patch/20251104165125.174168-1-18255117159@163.com/
- Modify the commit message and comments. (Bjorn)
- Patch 1/2 code logic: Add !bridge check to configure MPS only for Root Ports
without an upstream bridge (root bridges), avoiding incorrect handling of
non-root-bridge Root Ports (Niklas).
Changes for v5:
https://patchwork.kernel.org/project/linux-pci/patch/20250620155507.1022099-1-18255117159@163.com/
- Use pcie_set_mps directly instead of pcie_write_mps.
- The patch 1 commit message were modified.
Changes for v4:
https://patchwork.kernel.org/project/linux-pci/patch/20250510155607.390687-1-18255117159@163.com/
- The patch [v4 1/2] add a comment to explain why it was done this way.
- The patch [v4 2/2] have not been modified.
- Drop patch [v3 3/3]. The Maintainer of the pci-aardvark.c file suggests
that this patch cannot be submitted. In addition, Mani also suggests
dropping this patch until this series of issues is resolved.
Changes for v3:
https://patchwork.kernel.org/project/linux-pci/patch/20250506173439.292460-1-18255117159@163.com/
- The new split is patch 2/3 and 3/3.
- Modify the patch 1/3 according to Niklas' suggestion.
Changes for v2:
https://patchwork.kernel.org/project/linux-pci/patch/20250425095708.32662-1-18255117159@163.com/
- According to the Maintainer's suggestion, limit the setting of MPS
changes to platforms with controller drivers.
- Delete the MPS code set by the SOC manufacturer.
---
Hans Zhang (3):
PCI: Match the hierarchy's MPS to a device's MPSS as necessary
PCI: Configure Root Port MPS during host probing
PCI: dwc: Remove redundant MPS configuration
drivers/pci/controller/dwc/pci-meson.c | 25 ++----------
drivers/pci/probe.c | 53 ++++++++++++++++++++++++--
2 files changed, 52 insertions(+), 26 deletions(-)
base-commit: 08df884136f1c1197bab2a27814404fd329d9aac
--
2.34.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next reply other threads:[~2026-09-16 15:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 15:39 Hans Zhang [this message]
2026-09-16 15:39 ` [PATCH v9 1/3] PCI: Match the hierarchy's MPS to a device's MPSS as necessary Hans Zhang
2026-09-16 15:52 ` sashiko-bot
2026-09-16 16:00 ` Hans Zhang
2026-09-16 15:39 ` [PATCH v9 2/3] PCI: Configure Root Port MPS during host probing Hans Zhang
2026-09-16 15:51 ` sashiko-bot
2026-09-16 16:02 ` Hans Zhang
2026-09-16 15:39 ` [PATCH v9 3/3] PCI: dwc: Remove redundant MPS configuration Hans Zhang
2026-09-16 15:44 ` sashiko-bot
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=20260916153907.60344-1-18255117159@163.com \
--to=18255117159@163.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=heiko@sntech.de \
--cc=helgaas@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=jingoohan1@gmail.com \
--cc=khilman@baylibre.com \
--cc=kwilczynski@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=pali@kernel.org \
--cc=robh@kernel.org \
--cc=yue.wang@Amlogic.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
all inboxes | Powered by JetHome®