From: Joris Vaisvila <joey@tinyisr.com>
To: Daniel Golle <daniel@makrotopia.org>
Cc: netdev@vger.kernel.org, horms@kernel.org, pabeni@redhat.com,
kuba@kernel.org, edumazet@google.com, davem@davemloft.net,
olteanv@gmail.com, Andrew Lunn <andrew@lunn.ch>,
devicetree@vger.kernel.org, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Subject: Re: [RFC v3 4/4] net: dsa: initial support for MT7628 embedded switch
Date: Mon, 23 Mar 2026 19:18:30 +0200 [thread overview]
Message-ID: <acFwjuPFiO0QFoJ-@archlinux> (raw)
In-Reply-To: <ab8IHwC4RfHG5wvv@makrotopia.org>
Hi Daniel, thanks for the feedback and suggestions.
On Sat, Mar 21, 2026 at 09:05:35PM +0000, Daniel Golle wrote:
> As mentioned in the binding comment:
> - The MDIO bus is exclusively used to speak with the built-in PHYs.
> - The PHY addresses match the port IDs.
> - Only Clause-22 read/write operations are supported.
> - There is no way to connect an external PHY (no MII interface
> exposed on external pins)
>
> Imho it would hence be much easier to just use DSA's simple .phy_read
> and .phy_write operations instead of registering a bus manually in the
> driver, and even requiring a description of the MDIO bus in device
> tree.
>
> If you want to reserve the option of adding PHY-specific DT properties
> in future (eg. for PHY-controlled LEDs? but afair the LEDs are
> controlled by the switch itself and SoC-level pinctrl), at least set
> `ds->user_mii_bus = bus;` to make the device tree description
> optional. Completely omitting the whole bus definition and changing
> mt7628_mii_read and mt7628_mii_write to be useful as .phy_read and
> .phy_write ops in struct dsa_switch is the better option for simple
> legacy hardware like that imho. See b53 driver, for example.
The LEDs are indeed controlled by the switch, so there doesn't appear to
be anything to configure now or in the future. Using `ds->user_mii_bus`
sounds like a reasonable option to simplify configuration and works fine
on this switch, I was not aware of it earlier.
> @DSA maintainers: correct me if I'm wrong and, for which ever reason,
> using the .phy_read/.phy_write ops is discouraged in new drivers, even
> for dead-simple hardware like that one.
Regarding .phy_read/.phy_write, I was advised against using them in new
drivers in v1 of this RFC. I'm happy to rework this, but would
appreciate clarification from the DSA maintainers on the preferred
direction for hardware like this.
next prev parent reply other threads:[~2026-03-23 17:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 19:43 [RFC v3 0/4] net: dsa: MT7628 embedded switch initial support Joris Vaisvila
2026-03-21 19:43 ` [RFC v3 1/4] dt-bindings: net: dsa: add MT7628 ESW Joris Vaisvila
2026-03-21 19:58 ` Daniel Golle
2026-03-21 19:43 ` [RFC v3 2/4] net: phy: mediatek: add phy driver for MT7628 built-in Fast Ethernet PHYs Joris Vaisvila
2026-03-21 19:43 ` [RFC v3 3/4] net: dsa: initial MT7628 tagging driver Joris Vaisvila
2026-03-21 19:43 ` [RFC v3 4/4] net: dsa: initial support for MT7628 embedded switch Joris Vaisvila
2026-03-21 21:05 ` Daniel Golle
2026-03-23 17:18 ` Joris Vaisvila [this message]
2026-03-23 19:28 ` Andrew Lunn
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=acFwjuPFiO0QFoJ-@archlinux \
--to=joey@tinyisr.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox