On Wed, 5 Jun 2019 at 00:12, Andrew Lunn <and...@lunn.ch> wrote: > > > But now the second question: between a phy_connect and a phy_start, > > shouldn't the PHY be suspended too? Experimentally it looks like it > > still isn't. > > This is not always clear cut. Doing auto-neg is slow. Some systems > want to get networking going as fast as possible. The PHY can be > strapped so that on power up it starts autoneg. That can be finished > by the time linux takes control of the PHY, and it can take over the > results, rather than triggering another auto-neg, which will add > another 3 seconds before the network is up. > > If we power the PHY down, between connect and start, we loose all > this. > > I don't remember anybody submitting patches because the PHY passed > frames to the MAC too early. So i don't think there is much danger > there. > > Andrew
Hi Andrew, Call me paranoid, but I think the assumption you're making is that every time you have an Ethernet link, you want it. Consider the case where you have an Ethernet switch brought up by U-boot (where it does dumb switching, with no STP, nothing) and the system power-cycles in a network with loops. If the operating system has no way to control whether the Ethernet ports are administratively up, anything can happen... I don't think it's a bad idea to err on the safe side here. Even in the case of a regular NIC, packets can go up quite a bit in the MAC, possibly even triggering interrupts on the cores, when the interface should have been otherwise "down". Regards, -Vladimir