Re: [PATCH v3] net: dsa: microchip: call phy_remove_link_mode during probe

2020-07-21 Thread Helmut Grohne
Hi Andrew, Your persistence on this matter is much appreciated. On Mon, Jul 20, 2020 at 11:04:49PM +0200, Andrew Lunn wrote: > > The dev->ports[i].phydev is not actually exposed beyond the driver. The > > driver sets the phydev.speed in a few places and even reads it back in > > one place. It als

Re: [PATCH v3] net: dsa: microchip: call phy_remove_link_mode during probe

2020-07-20 Thread Andrew Lunn
> The dev->ports[i].phydev is not actually exposed beyond the driver. The > driver sets the phydev.speed in a few places and even reads it back in > one place. It also sets phydev.duplex, but never reads it back. It > queries phydev.link, which is statically 0 due to using devm_kzalloc. > > I thin

Re: [PATCH v3] net: dsa: microchip: call phy_remove_link_mode during probe

2020-07-20 Thread Andrew Lunn
Ignoring the part about how to cleanup this internal phydev for the moment. > int ksz9477_switch_register(struct ksz_device *dev) > { > - return ksz_switch_register(dev, &ksz9477_dev_ops); > + int ret, i; > + struct phy_device *phydev; > + > + ret = ksz_switch_register(dev, &ksz9

[PATCH v3] net: dsa: microchip: call phy_remove_link_mode during probe

2020-07-20 Thread Helmut Grohne
When doing "ip link set dev ... up" for a ksz9477 backed link, ksz9477_phy_setup is called and it calls phy_remove_link_mode to remove 1000baseT HDX. During phy_remove_link_mode, phy_advertise_supported is called. Doing so reverts any previous change to advertised link modes e.g. using a udevd .lin