Re: [PATCH net] net: dsa: mt7530: fix 10M/100M speed on MT7988 switch

From: Daniel Golle
Date: Thu Jan 25 2024 - 11:18:53 EST


On Thu, Jan 25, 2024 at 12:49:19PM +0300, Arınç ÜNAL wrote:
> On 24/01/2024 08:17, Daniel Golle wrote:
> > Setup PMCR port register for actual speed and duplex on internally
> > connected PHYs of the MT7988 built-in switch. This fixes links with
> > speeds other than 1000M.
> >
> > Fixes: ("110c18bfed414 net: dsa: mt7530: introduce driver for MT7988 built-in switch")
> > Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
>
> Acked-by: Arınç ÜNAL <arinc.unal@xxxxxxxxxx>
>
> I'm wondering why we manually set speed and duplex for these interface
> modes in the first place. I don't how it works for
> PHY_INTERFACE_MODE_INTERNAL but, at least for PHY_INTERFACE_MODE_TRGMII and
> 802.3z interfaces, phylink should already supply proper speed and duplex.

It's true that duplex should always be set to full-duplex already by
phylink. However, speed could be 2500MBit/s (2500Base-X) or 2000MBit/s
(?, TRGMII) and we yet need to program the PCR like if it was
1000MBit/s.

Regarding the INTERNAL case: it was added by mistake. In case of
MT7988, all ports of the switch are connected via INTERNAL links,
however, the PHYs still need adjustment of the PCR register just like
on all other MT753x switches and the CPU port is setup elsewhere
anyway.