Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Łukasz Buśko" <lukasz.busko@guns4hire.cc>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH] mediatek: mt7988: give each PCIe host its PEXTP clock (BPi-R4 Pro 8X, BE14 WiFi module)
Date: Sun, 29 Nov 2026 13:20:05 +0000	[thread overview]
Message-ID: <sashiko-outbox-239626@kernel.org> (raw)
In-Reply-To: <WPbvQ5bN1rWZUCz7EPql9EZIfTCossuyvgobtVAYvP1JM0m-RohvumoDmBdEAz2H593XEGyTh9T8zn_BYb7OlKc7LePH1RQbjjCel2mu86s=@guns4hire.cc>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] arm64: dts: mediatek: commit adds OpenWrt patch files instead
  of patching tree
- [Medium] dt-bindings: PCI: mediatek: mt7988 PEXTP mux added to MAC
  instead of clk tree
- [Low] mediatek: mt7988: commit changelog contains email greeting and
  quilt patch list
--

commit 8239227460147312c96d3389ca6f78c52b062fbe
Author: Łukasz Buśko <lukasz.busko@guns4hire.cc>

> mediatek: mt7988: give each PCIe host its PEXTP clock (BPi-R4 Pro 8X, BE14 WiFi module)
> 
> Hi,
> Its my first time to commit patch. Email body+attachment.
> 
> Each MT7988 PCIe port feeds its SerDes through a per-port transceiver PHY
> driven by the topckgen pextp_p<n>_sel mux. The hosts are described with
> the mediatek,mt7986-pcie fallback, whose schema pins a host to exactly
> four clocks, so nothing ever claims that mux and clk.c keeps it off as an
> unused clock for the whole uptime:
> 
>   pextp_p0_sel  0  0  0  26000000  ...  N  deviceless
> 
> mtk_pcie_parse_port() collects the clocks of a host node with
> devm_clk_bulk_get_all() and mtk_pcie_power_up() enables them before the
> LTSSM is started, so the host runs its state machine against a PHY with
> no reference clock. That is never reported as a missing clock, only as a
> link failure:
> 
>   mtk-pcie-gen3 11300000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
> 
> - 991 dt-bindings: PCI: mediatek-gen3 add mediatek,mt7988-pcie, paired
>   with the mediatek,mt8192-pcie fallback, and pin its clocks to the four
>   infracfg clocks plus pextp_clk.
> - 992 DTS: describe <&topckgen CLK_TOP_PEXTP_Pn_SEL> "pextp_clk" on each
>   of the four hosts and move them onto the new compatible.
> 
> The driver needs no change: the hosts already bind through the
> mediatek,mt8192-pcie entry of mtk_pcie_of_match[], so this only
> describes the clock the driver has been collecting all along.
> 
> On a BPi-R4 Pro 8X with the BE14/MT7996 module both PCIe links come back
> on every boot - 11300000 enumerates 14c3:7990 (mt7996e) and 11310000
> 14c3:7991 (mt7996e_hif) - with the 2.4 GHz, 5 GHz/160 MHz and 6
> GHz/320 MHz BSS up, and pextp_p0_sel/p1_sel read `2 2 ... Y
> pcie@11300000` / `pcie@11310000` while the two unused ports stay off.
> 
> Signed-off-by: Łukasz Buśko <lukasz.busko@guns4hire.cc>

[Severity: Low]
The commit message includes a conversational email greeting ("Hi, Its my
first time to commit patch...") and lists OpenWrt quilt patch numbers
("991", "992").  Personal notes for reviewers belong below the "---"
tearline so they are not recorded in the permanent git history, and each
patch should have its own self-contained commit changelog.

> diff --git a/target/linux/mediatek/patches-6.18/991-dt-bindings-PCI-mediatek-add-MT7988-with-its-PEXTP-r.patch b/target/linux/mediatek/patches-6.18/991-dt-bindings-PCI-mediatek-add-MT7988-with-its-PEXTP-r.patch
> new file mode 100644
> index 0000000000000..a7b1ba09159f2
> --- /dev/null
> +++ b/target/linux/mediatek/patches-6.18/991-dt-bindings-PCI-mediatek-add-MT7988-with-its-PEXTP-r.patch
> @@ -0,0 +1,67 @@
> +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> +From: Łukasz Buśko <lukasz.busko@guns4hire.cc>
> +Date: Sat, 17 Oct 2026 09:10:00 +0200
> +Subject: [PATCH] dt-bindings: PCI: mediatek: add MT7988 with its PEXTP
> + reference clock

[Severity: High]
Does this commit add two OpenWrt quilt patch files under
target/linux/mediatek/patches-6.18/ instead of modifying the kernel
source files directly?

The Linux kernel build system does not process target/linux/, so
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml and
arch/arm64/boot/dts/mediatek/mt7988a.dtsi remain unmodified in the tree
and compiled DTBs still lack the PEXTP clocks.  Also, the embedded diffs
were generated against an older 6.18 tree and do not apply cleanly to the
current files (for example, mediatek-pcie-gen3.yaml also has
mediatek,mt7981-pcie and mediatek,mt8189-pcie in the compatible enum, and
pcie2 in mt7988a.dtsi has phys and phy-names properties).  Please apply
the binding and DTS changes directly to the kernel tree as two separate
commits.

[ ... ]

> +--- a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
> ++++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
> +@@ -49,6 +49,7 @@ properties:
> +       - items:
> +           - enum:
> +               - mediatek,mt7986-pcie
> ++              - mediatek,mt7988-pcie
> +               - mediatek,mt8188-pcie
> +               - mediatek,mt8195-pcie
> +           - const: mediatek,mt8192-pcie
> +@@ -268,6 +269,36 @@ allOf:
> + 
> +         resets:
> +           minItems: 1
> ++          maxItems: 2
> ++
> ++        reset-names:
> ++          minItems: 1
> ++          maxItems: 2
> ++
> ++        mediatek,pbus-csr: false
> ++
> ++  - if:
> ++      properties:
> ++        compatible:
> ++          contains:
> ++            enum:
> ++              - mediatek,mt7988-pcie
> ++    then:
> ++      properties:
> ++        clocks:
> ++          minItems: 5
> ++          maxItems: 5
> ++
> ++        clock-names:
> ++          items:
> ++            - const: pl_250m
> ++            - const: tl_26m
> ++            - const: peri_26m
> ++            - const: top_133m
> ++            - const: pextp_clk

[Severity: Medium]
Should CLK_TOP_PEXTP_P0_SEL..P3_SEL be parented in the MT7988 clock
driver (or assigned to the PHY nodes) rather than added as a required
fifth clock on the PCIe MAC binding?

In drivers/clk/mediatek/clk-mt7988-infracfg.c, the analogous USB PIPE
gates are parented to their topckgen muxes, whereas the PCIe PIPE gates
(which each PCIe node already claims as "pl_250m") are parented directly
to "top_xtal":

drivers/clk/mediatek/clk-mt7988-infracfg.c:
	GATE_INFRA3(CLK_INFRA_USB_PIPE, "infra_usb_pipe", "sspxtp_sel", 10),
	GATE_INFRA3(CLK_INFRA_USB_PIPE_CK_P1, "infra_usb_pipe_ck_p1", "usb_phy_sel", 11),
	...
	GATE_INFRA3(CLK_INFRA_PCIE_PIPE_P0, "infra_pcie_pipe_ck_p0", "top_xtal", 24),
	GATE_INFRA3(CLK_INFRA_PCIE_PIPE_P1, "infra_pcie_pipe_ck_p1", "top_xtal", 25),
	GATE_INFRA3(CLK_INFRA_PCIE_PIPE_P2, "infra_pcie_pipe_ck_p2", "top_xtal", 26),
	GATE_INFRA3(CLK_INFRA_PCIE_PIPE_P3, "infra_pcie_pipe_ck_p3", "top_xtal", 27),

Requiring a new mediatek,mt7988-pcie compatible with 5 clocks on the MAC
node breaks compatibility with existing 4-clock mt7988a.dtsi device
trees, whereas parenting CLK_INFRA_PCIE_PIPE_P0..P3 to
"pextp_p0_sel".."pextp_p3_sel" in clk-mt7988-infracfg.c (or describing
the reference clock on the PHY) would enable the mux when the port powers
up without changing the PCIe MAC binding.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/WPbvQ5bN1rWZUCz7EPql9EZIfTCossuyvgobtVAYvP1JM0m-RohvumoDmBdEAz2H593XEGyTh9T8zn_BYb7OlKc7LePH1RQbjjCel2mu86s=@guns4hire.cc?part=1

      reply	other threads:[~2026-11-29 13:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261129123118.187289-1-lukasz.busko@guns4hire.cc>
2026-11-29 13:07 ` [PATCH] mediatek: mt7988: give each PCIe host its PEXTP clock (BPi-R4 Pro 8X, BE14 WiFi module) Łukasz Buśko
2026-11-29 13:20   ` sashiko-bot [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=sashiko-outbox-239626@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukasz.busko@guns4hire.cc \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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