mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Pawel Dembicki <paweldembicki@gmail.com>
Cc: netdev@vger.kernel.org, Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Stefan Eichenberger <eichest@gmail.com>,
	Dimitri Fedrau <dima.fedrau@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: phy: marvell: implement cable-test for 88E308X/88E609X family
Date: Tue, 26 Mar 2024 15:32:50 +0100	[thread overview]
Message-ID: <88dc994b-a3da-4760-b7e0-c6da593b15d6@lunn.ch> (raw)
In-Reply-To: <20240326141238.2315974-2-paweldembicki@gmail.com>

> +		ret = phy_write(phydev, MII_BMCR, 0xa100);

BMCR_RESET | BMCR_ANENABLE | BMCR_FULLDPLX

You should check i have that correct, but no need for magic values
with this register.

> +static int m88e3082_vct_cable_test_report_trans(int result, u8 distance)
> +{
> +	switch (result) {
> +	case MII_VCT_TXRXPINS_VCTTST_OK:
> +		if (distance == MII_VCT_TXRXPINS_DISTRFLN_MAX)
> +			return ETHTOOL_A_CABLE_RESULT_CODE_OK;
> +		/* Impedance mismatch */
> +		return ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC;

It is possible to add more results code, if you think Impedance
mismatch is useful.

> +	ret = phy_write(phydev, MII_BMCR, priv->m88e3082_vct_reg_backup);
> +	if (ret < 0)
> +		return ret;

I'm not sure this is required. When the cable test is finished, the
PHY state machine is moved to PHY_UP. That will cause
phy_config_aneg() to be called which should set BMCR back to the
correct value.

	Andrew

  reply	other threads:[~2024-03-26 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 14:12 [PATCH net-next 1/2] net: phy: marvell: add basic support of " Pawel Dembicki
2024-03-26 14:12 ` [PATCH net-next 2/2] net: phy: marvell: implement cable-test for " Pawel Dembicki
2024-03-26 14:32   ` Andrew Lunn [this message]
2024-03-27 15:28   ` Simon Horman

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=88dc994b-a3da-4760-b7e0-c6da593b15d6@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dima.fedrau@gmail.com \
    --cc=edumazet@google.com \
    --cc=eichest@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paweldembicki@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

all inboxes | Powered by JetHome®