Re: [PATCH v5 0/2] PCI: mediatek-gen3: Add 2-lanes mode support + clock
Chen-Yu Tsai <[email protected]>
| Newsgroups | org.infradead.lists.linux-mediatek,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <CAGXv+5G=XDXSeyQww_ihogpPLyv2K0ofK3Ym1W+Jdzs9h176=A@mail.gmail.com> |
On Mon, Aug 10, 2026 at 6:55 PM Christian Marangi (Ansuel) <[email protected]> wrote: > > Il giorno lun 10 ago 2026 alle ore 12:33 Chen-Yu Tsai > <[email protected]> ha scritto: > > > > On Fri, Aug 7, 2026 at 11:21 PM Bjorn Helgaas <[email protected]> wrote: > > > > > > On Fri, Aug 07, 2026 at 11:24:09AM +0800, Chen-Yu Tsai wrote: > > > > On Fri, Aug 7, 2026 at 12:53 AM Christian Marangi <[email protected]> wrote: > > > > > This small series introduce support for 2-lanes mode for Airoha AN7581 > > > > > > > > Just a nitpick, but I would probably name this something else, like > > > > "cross-controller lane-bonding mode" or "lane stealing"? PCIe already > > > > has 2x lanes as a standard feature, so this naming is a bit confusing. > > > > It's not like dual-LVDS display in which LVDS is only a single lane. > > > > > > I suggested the "2-lane" and "x2" terminology because I assumed the > > > result is what the PCIe spec would describe as a "x2 Link" consisting > > > of two Lanes. > > > > > > If that's not the case, maybe "cross-controller lane-bonding mode" or > > > "lane stealing" would be more accurate, but I don't know what those > > > mean, so if we use them I would also like to know what the result > > > looks like in standard PCIe terms. > > > > Benjamin pointed out later in the thread that it is just bifurcation. > > > > Yes but as me, you, Benjamin and Bjorn people who weren't there with the HW > team at times the SoC was created, and given how the internal documentation > these are just assumption and observation... Everyone can be correct and wrong. > > > I would assume "PCIe bifurcation" is a standard term, so maybe we could > > call this "Support un-bifurcated 2-lane operation"? > > > > And how coming from PCIe bifurcation to un-bifurcated 2-lane operation keeps > the standard meaning? > > This terms is equally custom as the previous "cross-controller > lane-bonding mode" > and "lane stealing" > > I want to be honest... I'm not following why we are trying in every > way possible to find > a standard meaning for an highly integrated PCIe controller for a vendor SoC. > It's not like there are devices shipped with PCIe slot where you can > insert whatever > card you want. (there is only a single RFB board but that is really to > debug stuff and > develop) > > The SoC is designed to have WiFi cards attached and only a subset of them. > And some of them require 2 lanes mode to work with this special configuration. > > Even the DT bindings are not that specific to the details... at the > end of the day > everything is modelled as simple as "num-lanes = <2>;" > > And that is effectively what the HW gets configured to. If then a > robbery is done > internally to the HW to get the second lane with probably some criminal act and > some murder then those are just details. But unless we have a correct police > report on that (Documentation) we can't assume someone got shot in the > process. > (sorry for the joke around the stealing thing) > > > On the implementation side, having to reach into the second PCIe controller > > is a bit messy :( > > > > I can assure you vendor hide all kind of bad stuff behind single register... > It's just Airoha that loves to expose godzillion registers and configure > everything clearly... Something that most of the time is better than hiding > everything behind ATF with SCM commands (or even configure stuff > in bootloader from HW strap) > > A bonding solution where 2 controllers are configured and then bonded might > also be problematic as for 2 lanes mode the configuration needs to be done > in the same time segment. (and that would introduce lots of complexity in > both DT and driver for the sake of just having an additional reset and > an additional reg) > > Aside from these 2 point... I'm open to any kind of naming and change > but it seems sad to me to delay this feature for these details that would > only affect the commit description and nothing else... This is currently needed > for Eagle WiFi card to correctly works... With the current code it works but > sometimes it doesn't as the reset and configuration phase is not well defined. > This series fix exactly that to have stable functionality (tested on OpenWrt > from at least half a year) It was not my intention to block this. Having worked on other MediaTek SoCs on which the PCIe gen4 controller, supported by the same driver, can do up to 2 lanes natively, the subject of the cover letter was a bit confusing for me. Now that you've explained it, everything is clear. > > > > > SoC. This is needed for correctly functionality of Eagle WiFi Card > > > > > normally attached to this SoC that require a 2-line PCIe card to > > > > > correctly work (and give the proper performance) > > > > > > > > > > The first 2 patch address a limitation of the PCIe implementation > > > > > where the PERSTOUT reset were indirectly asserted and deasserted > > > > > all at the same time (for all the 3 PCIe card) with PCIe > > > > > enable and disable. > > > > > The 2 patch address this and introduce correct reset to control > > > > > reset line for the relevant PCIe line. > > > > > > > > > > The last 2 patch add additional logic and support to assert > > > > > and deassert the PERSTOUT and also apply the required configuration > > > > > for 2-lanes mode. > > > > > > > > > > 2-lanes mode is implemented in DT by adding the required property > > > > > and by defining the "num-lanes" to 2.