Re: [PATCH v1 1/4] net: ag71xx: port to phylink

From: Oleksij Rempel
Date: Wed Oct 16 2019 - 08:24:19 EST


On Wed, Oct 16, 2019 at 02:12:16PM +0200, Andrew Lunn wrote:
> On Mon, Oct 14, 2019 at 08:15:46AM +0200, Oleksij Rempel wrote:
> > The port to phylink was done as close as possible to initial
> > functionality.
> > Theoretically this HW can support flow control, practically seems to be not
> > enough to just enable it. So, more work should be done.
> >
> > Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
>
> Hi Oleksij
>
> Please include Russell King in Cc: in future.

He was included in To:. Do you mean, I need to move him from To to Cc?

> > -static void ag71xx_phy_link_adjust(struct net_device *ndev)
> > +static void ag71xx_mac_validate(struct phylink_config *config,
> > + unsigned long *supported,
> > + struct phylink_link_state *state)
> > {
> > - struct ag71xx *ag = netdev_priv(ndev);
> > + __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
> > +
> > + if (state->interface != PHY_INTERFACE_MODE_NA &&
> > + state->interface != PHY_INTERFACE_MODE_GMII &&
> > + state->interface != PHY_INTERFACE_MODE_MII) {
> > + bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
> > + return;
> > + }
> > +
> > + phylink_set(mask, MII);
> > +
> > + /* flow control is not supported */
> >
> > - ag71xx_link_adjust(ag, true);
> > + phylink_set(mask, 10baseT_Half);
> > + phylink_set(mask, 10baseT_Full);
> > + phylink_set(mask, 100baseT_Half);
> > + phylink_set(mask, 100baseT_Full);
> > +
> > + phylink_set(mask, 1000baseT_Full);
> > + phylink_set(mask, 1000baseX_Full);
>
> Can the MAC/PHY dynamically switch between MII and GMII? Maybe you
> should only add 1G support when interface is GMII?

OK, good point.

> > @@ -1239,6 +1255,13 @@ static int ag71xx_open(struct net_device *ndev)
> > unsigned int max_frame_len;
> > int ret;
> >
> > + ret = phylink_of_phy_connect(ag->phylink, ag->pdev->dev.of_node, 0);
> > + if (ret) {
> > + netif_info(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n",
> > + ret);
>
> netif_info seems wrong. _err()?

Yes, will fix it.

Regards,
Oleksij.

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |