netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Daniel Golle <daniel@makrotopia.org>
Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Mark Lee" <Mark-MC.Lee@mediatek.com>,
	"John Crispin" <john@phrozen.org>, "Felix Fietkau" <nbd@nbd.name>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jianhui Zhao" <zhaojh329@gmail.com>,
	"Bjørn Mork" <bjorn@mork.no>
Subject: Re: [PATCH v4 11/12] net: ethernet: mtk_eth_soc: switch to external PCS driver
Date: Sat, 11 Feb 2023 12:56:47 +0000	[thread overview]
Message-ID: <Y+eQj5LUTt4C5qgP@shell.armlinux.org.uk> (raw)
In-Reply-To: <7886ca664ba6ca712aac127b20380d3d2a1a4d1f.1676071508.git.daniel@makrotopia.org>

On Fri, Feb 10, 2023 at 11:40:22PM +0000, Daniel Golle wrote:
> +		eth->sgmii->dev = eth->dev;
>  		err = mtk_sgmii_init(eth->sgmii, pdev->dev.of_node,
>  				     eth->soc->ana_rgc3);

From what I can tell, it looks like sgmii->dev is only used within
mtk_sgmii_init() and nowhere else, so does it make sense to store
this in the structure rather than passing it as another argument to
this function? Seems a little wasteful for something that is only
used there.

> diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c
> index 67965a6b57a4..f10621fc5baa 100644
> --- a/drivers/net/pcs/pcs-mtk-lynxi.c
> +++ b/drivers/net/pcs/pcs-mtk-lynxi.c
> @@ -146,6 +146,10 @@ static int mtk_pcs_lynxi_config(struct phylink_pcs *pcs, unsigned int mode,
>  		bmcr = 0;
>  
>  	if (mpcs->interface != interface) {
> +		link_timer = phylink_get_link_timer_ns(interface);
> +		if (link_timer < 0)
> +			return link_timer;
> +
>  		/* PHYA power down */
>  		regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
>  				   SGMII_PHYA_PWD, SGMII_PHYA_PWD);
> @@ -168,11 +172,7 @@ static int mtk_pcs_lynxi_config(struct phylink_pcs *pcs, unsigned int mode,
>  		regmap_update_bits(mpcs->regmap, mpcs->ana_rgc3,
>  				   RG_PHY_SPEED_MASK, rgc3);
>  
> -		/* Setup the link timer and QPHY power up inside SGMIISYS */
> -		link_timer = phylink_get_link_timer_ns(interface);
> -		if (link_timer < 0)
> -			return link_timer;
> -
> +		/* Setup the link timer */
>  		regmap_write(mpcs->regmap, SGMSYS_PCS_LINK_TIMER, link_timer / 2 / 8);
>  
>  		mpcs->interface = interface;

I'm guessing you meant to squash that into patch 10 rather than this
patch?

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

  reply	other threads:[~2023-02-11 12:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 23:35 [PATCH v4 00/12] net: ethernet: mtk_eth_soc: various enhancements Daniel Golle
2023-02-10 23:35 ` [PATCH v4 01/12] net: ethernet: mtk_eth_soc: add support for MT7981 SoC Daniel Golle
2023-02-10 23:36 ` [PATCH v4 02/12] dt-bindings: net: mediatek,net: add mt7981-eth binding Daniel Golle
2023-02-10 23:36 ` [PATCH v4 03/12] dt-bindings: arm: mediatek: sgmiisys: Convert to DT schema Daniel Golle
2023-02-10 23:37 ` [PATCH v4 04/12] dt-bindings: arm: mediatek: sgmiisys: add MT7981 SoC Daniel Golle
2023-02-10 23:37 ` [PATCH v4 05/12] net: ethernet: mtk_eth_soc: set MDIO bus clock frequency Daniel Golle
2023-02-10 23:38 ` [PATCH v4 06/12] net: ethernet: mtk_eth_soc: reset PCS state Daniel Golle
2023-02-10 23:38 ` [PATCH v4 07/12] net: ethernet: mtk_eth_soc: only write values if needed Daniel Golle
2023-02-11 12:46   ` Russell King (Oracle)
2023-02-10 23:39 ` [PATCH v4 08/12] net: ethernet: mtk_eth_soc: fix RX data corruption issue Daniel Golle
2023-02-10 23:39 ` [PATCH v4 09/12] net: ethernet: mtk_eth_soc: ppe: add support for flow accounting Daniel Golle
2023-02-10 23:39 ` [PATCH v4 10/12] net: pcs: add driver for MediaTek SGMII PCS Daniel Golle
2023-02-11 12:53   ` Russell King (Oracle)
2023-02-10 23:40 ` [PATCH v4 11/12] net: ethernet: mtk_eth_soc: switch to external PCS driver Daniel Golle
2023-02-11 12:56   ` Russell King (Oracle) [this message]
2023-02-10 23:40 ` [PATCH v4 12/12] net: dsa: mt7530: use " Daniel Golle
2023-02-11 13:00   ` 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=Y+eQj5LUTt4C5qgP@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Landen.Chao@mediatek.com \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bjorn@mork.no \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    --cc=zhaojh329@gmail.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).