Subject: Re: [PATCH] net: dsa: mv88e6xxx: Allow MAC configuration for ports with internal PHY

From: Russell King - ARM Linux admin <[email-masked]>
Date: Mon, 22 Jun 2020 19:58:37 +0100

On Mon, Jun 22, 2020 at 08:44:51PM +0200, Daniel Mack wrote:
> On 6/22/20 8:41 PM, Andrew Lunn wrote:
> > On Mon, Jun 22, 2020 at 08:34:43PM +0200, Daniel Mack wrote:
> >> Ports with internal PHYs that are not in 'fixed-link' mode are currently
> >> only set up once at startup with a static config. Attempts to change the
> >> link speed or duplex settings are currently prevented by an early bail
> >> in mv88e6xxx_mac_config(). As the default config forces the speed to
> >> 1000M, setups with reduced link speed on such ports are unsupported.
> > 
> > Hi Daniel
> > 
> > How are you trying to change the speed?
> 
> With ethtool for instance. But all userspace tools are bailing out early
> on this port for the reason I described.

A simple "return" to ignore a call in a void function won't have that
effect.

I don't see an issue here:

# ethtool -s lan1 autoneg off speed 10 duplex half
# ethtool lan1
Settings for lan1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 4
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

libmii.c:v2.11 2/28/2005  Donald Becker ([email-masked])
 http://www.scyld.com/diag/index.html
 MII PHY #4 transceiver registers:
   0000 794d 0141 0eb1 05e1 0000 0004 2001
   0000 0e00 0000 0000 0000 0003 0000 3000
   3360 0c48 6400 0000 0020 0000 0000 0000
   0000 0000 8040 0000 0000 0000 0000 0000.
 Basic mode control register 0x0000: Auto-negotiation disabled!
   Speed fixed at 10 mbps, half-duplex.
 Basic mode status register 0x794d ... 794d.
   Link status: established.
   Capable of  100baseTx-FD 100baseTx 10baseT-FD 10baseT.
   Able to perform Auto-negotiation, negotiation not complete.
 Vendor ID is 00:50:43:--:--:--, model 43 rev. 1.
   No specific information is known about this transceiver type.
 I'm advertising 05e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT
   Advertising no additional info pages.
   IEEE 802.3 CSMA/CD protocol.
 Link partner capability is 0000:.
   Negotiation did not complete.

and traffic passes.

I've also been able to change what is advertised just fine, and the
link comes up as expected - in fact, I was running one of the switch
ports at 10Mbps to one of my machines and using the 'scope on the
ethernet signals over the weekend to debug a problem, which turned
out to be broken RGMII clock delay timings.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!