netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, horms@kernel.org,
	kuba@kernel.org, jiri@resnulli.us, pabeni@redhat.com,
	hfdevel@gmx.net, naveenm@marvell.com, jdamato@fastly.com
Subject: Re: [PATCH net-next v8 6/6] net: tn40xx: add phylink support
Date: Mon, 3 Jun 2024 10:22:17 +0100	[thread overview]
Message-ID: <Zl2LSfGqvPUvUoRT@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240603064955.58327-7-fujita.tomonori@gmail.com>

On Mon, Jun 03, 2024 at 03:49:55PM +0900, FUJITA Tomonori wrote:
> @@ -1374,6 +1375,10 @@ static void tn40_stop(struct tn40_priv *priv)
>  static int tn40_close(struct net_device *ndev)
>  {
>  	struct tn40_priv *priv = netdev_priv(ndev);
> +
> +	phylink_stop(priv->phylink);
> +	phylink_disconnect_phy(priv->phylink);

There is no need to pair both of these together - you can disconnect
from the PHY later if it's more convenient.

> +
>  	napi_disable(&priv->napi);
>  	netif_napi_del(&priv->napi);
>  	tn40_stop(priv);
> @@ -1392,6 +1397,14 @@ static int tn40_open(struct net_device *dev)
>  		return ret;
>  	}
>  	napi_enable(&priv->napi);
> +	ret = phylink_connect_phy(priv->phylink, priv->phydev);
> +	if (ret) {
> +		napi_disable(&priv->napi);
> +		tn40_stop(priv);
> +		netdev_err(dev, "failed to connect to phy %d\n", ret);
> +		return ret;
> +	}

Again, no need to pair phylink_connect_phy() close to phylink_start()
if there's somewhere more convenient to place it. Operation with the
PHY doesn't begin until phylink_start() is called.

My review comment last time was purely about where phylink_start()
and phylink_stop() were being called. It's the placement of these
two functions that are key.

Thanks.

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

  reply	other threads:[~2024-06-03  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03  6:49 [PATCH net-next v8 0/6] add ethernet driver for Tehuti Networks TN40xx chips FUJITA Tomonori
2024-06-03  6:49 ` [PATCH net-next v8 1/6] net: tn40xx: add pci " FUJITA Tomonori
2024-06-03  6:49 ` [PATCH net-next v8 2/6] net: tn40xx: add register defines FUJITA Tomonori
2024-06-03  6:49 ` [PATCH net-next v8 3/6] net: tn40xx: add basic Tx handling FUJITA Tomonori
2024-06-03  6:49 ` [PATCH net-next v8 4/6] net: tn40xx: add basic Rx handling FUJITA Tomonori
2024-06-03  6:49 ` [PATCH net-next v8 5/6] net: tn40xx: add mdio bus support FUJITA Tomonori
2024-06-03  6:49 ` [PATCH net-next v8 6/6] net: tn40xx: add phylink support FUJITA Tomonori
2024-06-03  9:22   ` Russell King (Oracle) [this message]
2024-06-03 11:54     ` FUJITA Tomonori
2024-06-03 13:13       ` Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zl2LSfGqvPUvUoRT@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=fujita.tomonori@gmail.com \
    --cc=hfdevel@gmx.net \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).