linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next 3/4] net: phy: broadcom: add cable test support
Date: Sun, 10 May 2020 16:51:26 +0200	[thread overview]
Message-ID: <51bddbc3bdd10c81aad0e79ee4552e68@walle.cc> (raw)
In-Reply-To: <20200510144410.GI362499@lunn.ch>

Am 2020-05-10 16:44, schrieb Andrew Lunn:
> On Sun, May 10, 2020 at 12:37:13AM +0200, Michael Walle wrote:
>> Most modern broadcom PHYs support ECD (enhanced cable diagnostics). 
>> Add
>> support for it in the bcm-phy-lib so they can easily be used in the 
>> PHY
>> driver.
>> 
>> There are two access methods for ECD: legacy by expansion registers 
>> and
>> via the new RDB registers which are exclusive. Provide functions in 
>> two
>> variants where the PHY driver can from. To keep things simple for now,
> 
> can from ?

can choose from. Should I send a new patch? Will DaveM fix minor typos, 
if
he commits it?

> 
>> +static int bcm_phy_report_length(struct phy_device *phydev, int 
>> result,
>> +				 int pair)
>> +{
>> +	int val;
>> +
>> +	val = __bcm_phy_read_exp(phydev,
>> +				 BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS + pair);
>> +	if (val < 0)
>> +		return val;
>> +
>> +	if (val == BCM54XX_ECD_LENGTH_RESULTS_INVALID)
>> +		return 0;
>> +
>> +	/* intra-pair shorts report twice the length */
>> +	if (result == BCM54XX_ECD_FAULT_TYPE_CROSS_SHORT)
>> +		val >>= 1;
> 
> You mentioned this before. This seems odd. The pulse travelled the
> same distance as for an open or shorted cable. The whole of time
> domain reflectrometry is based on some sort of echo and you always
> need to device by two. So why this special case?

Well, I don't know why this is special. But one thing which is
different is that you listen on all pairs for the pulse instead of
just the one where you've sent it (which seems to be a bit trickier
otherwise the cheapo AT8031 would support it, too). Maybe they
screwed that. In any case, I can try it with a 100m cable just
to be sure.

-michael

  reply	other threads:[~2020-05-10 14:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09 22:37 [PATCH net-next 0/4] net: phy: broadcom: cable tester support Michael Walle
2020-05-09 22:37 ` [PATCH net-next 1/4] net: phy: broadcom: add exp register access methods without buslock Michael Walle
2020-05-09 23:47   ` Florian Fainelli
2020-05-10 14:32   ` Andrew Lunn
2020-05-09 22:37 ` [PATCH net-next 2/4] net: phy: broadcom: add bcm_phy_modify_exp() Michael Walle
2020-05-09 23:48   ` Florian Fainelli
2020-05-10 14:33   ` Andrew Lunn
2020-05-09 22:37 ` [PATCH net-next 3/4] net: phy: broadcom: add cable test support Michael Walle
2020-05-10  0:09   ` Florian Fainelli
2020-05-10  2:20   ` kbuild test robot
2020-05-10 14:44   ` Andrew Lunn
2020-05-10 14:51     ` Michael Walle [this message]
2020-05-09 22:37 ` [PATCH net-next 4/4] net: phy: bcm54140: add cable diagnostics support Michael Walle
2020-05-10  0:05   ` kbuild test robot
2020-05-10  0:09   ` Florian Fainelli
2020-05-10  5:37   ` kbuild test robot
2020-05-10 14:44   ` Andrew Lunn
2020-05-10 18:21 ` [PATCH net-next 0/4] net: phy: broadcom: cable tester support Jakub Kicinski

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=51bddbc3bdd10c81aad0e79ee4552e68@walle.cc \
    --to=michael@walle.cc \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /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).