public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Guangbin Huang <huangguangbin2@huawei.com>
Cc: davem@davemloft.net, kuba@kernel.org, o.rempel@pengutronix.de,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	lipeng321@huawei.com, chenhao288@hisilicon.com
Subject: Re: [PATCH] net: phy: genphy_loopback: fix loopback failed when speed is unknown
Date: Thu, 31 Mar 2022 14:23:42 +0200	[thread overview]
Message-ID: <YkWdTpCsO8JhiSaT@lunn.ch> (raw)
In-Reply-To: <20220331114819.14929-1-huangguangbin2@huawei.com>

On Thu, Mar 31, 2022 at 07:48:19PM +0800, Guangbin Huang wrote:
> If phy link status is down because link partner goes down, the phy speed
> will be updated to SPEED_UNKNOWN when autoneg on with general phy driver.
> If test loopback in this case, the phy speed will be set to 10M. However,
> the speed of mac may not be 10M, it causes loopback test failed.
> 
> To fix this problem, if speed is SPEED_UNKNOWN, don't configure link speed.

I don't think this explanation is correct.

If speed is UNKNOWN, ctl is just going to have BMCR_LOOPBACK set. That
is very similar to what you are doing. The code then waits for the
link to establish. This is where i guess your problem is. Are you
seeing ETIMEDOUT? Does the link not establish?

Thanks
	Andrew	

  reply	other threads:[~2022-03-31 12:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 11:48 [PATCH] net: phy: genphy_loopback: fix loopback failed when speed is unknown Guangbin Huang
2022-03-31 12:23 ` Andrew Lunn [this message]
2022-03-31 13:57   ` huangguangbin (A)
2022-03-31 14:26     ` Andrew Lunn
2022-04-01  6:40       ` Oleksij Rempel
2022-04-01 12:14         ` Andrew Lunn
2022-04-07 13:54           ` huangguangbin (A)
2022-04-07 14:45             ` Andrew Lunn
2022-04-08  8:18               ` Oleksij Rempel
2022-04-08 13:04                 ` Andrew Lunn

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=YkWdTpCsO8JhiSaT@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=chenhao288@hisilicon.com \
    --cc=davem@davemloft.net \
    --cc=huangguangbin2@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    /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