public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: MD Danish Anwar <danishanwar@ti.com>
Cc: "Andrew F. Davis" <afd@ti.com>, Suman Anna <s-anna@ti.com>,
	Roger Quadros <rogerq@kernel.org>,
	YueHaibing <yuehaibing@huawei.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	nm@ti.com, ssantosh@kernel.org, srk@ti.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 2/2] net: ti: icssg-prueth: Add ICSSG ethernet driver
Date: Mon, 6 Feb 2023 15:15:21 +0100	[thread overview]
Message-ID: <Y+ELeSQX+GWS5N2p@lunn.ch> (raw)
In-Reply-To: <20230206060708.3574472-3-danishanwar@ti.com>

> +enum mii_mode {
> +	MII_MODE_MII = 0,
> +	MII_MODE_RGMII,
> +	MII_MODE_SGMII

There is no mention of SGMII anywhere else. And in a couple of places,
the code makes the assumption that if it is not RGMII it is MII.

Does the hardware really support SGMII?

> +static int prueth_config_rgmiidelay(struct prueth *prueth,
> +				    struct device_node *eth_np,
> +				    phy_interface_t phy_if)
> +{

...

> +	if (phy_if == PHY_INTERFACE_MODE_RGMII_ID ||
> +	    phy_if == PHY_INTERFACE_MODE_RGMII_TXID)
> +		rgmii_tx_id |= ICSSG_CTRL_RGMII_ID_MODE;
> +
> +	regmap_update_bits(ctrl_mmr, icssgctrl_reg, ICSSG_CTRL_RGMII_ID_MODE, rgmii_tx_id);

Here you are adding the TX delay if the phy-mode indicates it should
be added.

> +static int prueth_netdev_init(struct prueth *prueth,
> +			      struct device_node *eth_node)
> +{

> +	ret = of_get_phy_mode(eth_node, &emac->phy_if);
> +	if (ret) {
> +		dev_err(prueth->dev, "could not get phy-mode property\n");
> +		goto free;
> +	}

> +	ret = prueth_config_rgmiidelay(prueth, eth_node, emac->phy_if);
> +	if (ret)
> +		goto free;
> +

Reading it from DT and calling the delay function.

> +static int prueth_probe(struct platform_device *pdev)
> +{


> +	/* register the network devices */
> +	if (eth0_node) {
> +		ret = register_netdev(prueth->emac[PRUETH_MAC0]->ndev);
> +		if (ret) {
> +			dev_err(dev, "can't register netdev for port MII0");
> +			goto netdev_exit;
> +		}
> +
> +		prueth->registered_netdevs[PRUETH_MAC0] = prueth->emac[PRUETH_MAC0]->ndev;
> +
> +		emac_phy_connect(prueth->emac[PRUETH_MAC0]);

And this is connecting the MAC and the PHY, where emac_phy_connect()
passes emac->phy_if to phylib.

What i don't see anywhere is you changing emac->phy_if to indicate the
MAC has inserted the TX delay, and so the PHY should not.

    Andrew


  reply	other threads:[~2023-02-06 14:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  6:07 [PATCH v4 0/2] Introduce ICSSG based ethernet Driver MD Danish Anwar
2023-02-06  6:07 ` [PATCH v4 1/2] dt-bindings: net: Add ICSSG Ethernet Driver bindings MD Danish Anwar
2023-02-06  7:50   ` Krzysztof Kozlowski
2023-02-06 10:39     ` [EXTERNAL] " Md Danish Anwar
2023-02-06 10:41       ` Krzysztof Kozlowski
2023-02-07  5:07         ` Md Danish Anwar
2023-02-06 13:46   ` Rob Herring
2023-02-07  5:00     ` [EXTERNAL] " Md Danish Anwar
2023-02-06  6:07 ` [PATCH v4 2/2] net: ti: icssg-prueth: Add ICSSG ethernet driver MD Danish Anwar
2023-02-06 14:15   ` Andrew Lunn [this message]
2023-02-07 15:29     ` [EXTERNAL] " Md Danish Anwar
2023-02-07 19:56       ` Roger Quadros
2023-02-08  7:46         ` [EXTERNAL] " Md Danish Anwar
2023-02-08  9:17           ` Roger Quadros
2023-02-08 12:56           ` Andrew Lunn
2023-02-09 10:29             ` [EXTERNAL] " Md Danish Anwar
2023-02-09 12:58               ` Roger Quadros
2023-02-09 13:43                 ` [EXTERNAL] " Md Danish Anwar
2023-02-09 13:54               ` Andrew Lunn
2023-02-10  6:26                 ` [EXTERNAL] " Md Danish Anwar

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+ELeSQX+GWS5N2p@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=afd@ti.com \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=rogerq@kernel.org \
    --cc=s-anna@ti.com \
    --cc=srk@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=yuehaibing@huawei.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