On Tue, May 28, 2019 at 06:11:39PM +0200, Andrew Lunn wrote:
> > One question: are we happy with failing the probe like this, or would it
> > be better to allow the probe to suceed?
> > 
> > As has been pointed out in the C45 MII access patch, we need the PHY
> > to bind to the network driver for the MII bus to be accessible to
> > userspace, so if we're going to have userspace tools to upload the
> > firmware, rather than using u-boot, we need the PHY to be present and
> > bound to the network interface.
> 
> Hi Russell
> 
> It is an interesting question. Failing the probe is the simple
> solution. If we don't fail the probe, we then need to allow the
> attach, but fail all normal operations, with a noisy kernel log.  That
> probably means adding a new state to the state machine, PHY_BROKEN.
> Enter that state if phy_start_aneg() returns an error?

Hi Andrew,

I don't think we need a new state - I think we can trap it in
the link_change_notify() method, and force phydev->state to
PHY_HALTED if it's in phy_is_started() mode.

Maybe something like:

        if (phy_is_started(phydev) && priv->firmware_failed) {
                dev_warn(&phydev->mdio.dev,
                         "PHY firmware failure: link forced down");
                phydev->state = PHY_HALTED;
        }

Or maybe we just need to do that if phydev->state == PHY_UP or
PHY_RESUMING (the two states entered from phy_start())?

Russell.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

Reply via email to