linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jia, Fang" <fang.jia@windriver.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: phy: fixed link 1000 or 100 set with autoneg off
Date: Mon, 23 Oct 2023 16:34:28 +0800	[thread overview]
Message-ID: <9dd0e0b8-751b-170a-7c8f-bc084efae69b@windriver.com> (raw)
In-Reply-To: <c23dcdb0-f493-453d-82b9-b498f4d3c88b@gmail.com>



On 10/23/23 15:52, Heiner Kallweit wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> On 23.10.2023 09:01, Jia, Fang wrote:
>> Hi Experts,
>>
>> We use NXP LS1046 board and face an issue about the eth interface speed.
>>
>> 1) Scenario
>>
>> we set fixed link 1000Mb/s in device tree.
>>
>> However, after we set the auto-neg off, then the eth1's speed changed to 10M and Duplex changed to Half.
>> The value of /sys/class/net/eth1/speed is 10 and /sys/class/net/eth1/duplex is half
>>
> Why do you set aneg to off? Leave aneg on, that's the only supported
> mode in swphy. 1000Mbps requires aneg anyway per standard.

Thanks very much for your reply.

Actually, due to some reason, the phydev's default aneg state is off.
And we just found if use ethtool to set, it had the same result.

We also found that when we set speed to 100, same result.

So we can assume that swphy only supports the aneg on, no matter the 
speed setting. Am I right ?

> 
>> 2) Log is as following.
>>
>> # ifconfig eth1 up
>> # ethtool eth1
>> Settings for eth1:
>>          Supported ports: [ MII ]
>>          Supported link modes:   1000baseT/Full
>>          Supported pause frame use: Symmetric Receive-only
>>          Supports auto-negotiation: Yes
>>
>>          Supported FEC modes: Not reported
>>
>>          Advertised link modes:  1000baseT/Full
>>          Advertised pause frame use: Symmetric Receive-only
>>
>>          Advertised auto-negotiation: Yes
>>          Advertised FEC modes: Not reported
>>          Speed: 1000Mb/s
>>          Duplex: Full
>>          Port: MII
>>          PHYAD: 1
>>          Transceiver: internal
>>          Auto-negotiation: on
>>          Supports Wake-on: d
>>          Wake-on: d
>>          Current message level: 0xffffffff (-1)
>>                                 drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
>>          Link detected: yes
>>
>> # ethtool -s eth1 autoneg off
>> # ethtool eth1
>> Settings for eth1:
>>          Supported ports: [ MII ]
>>          Supported link modes:   1000baseT/Full
>>          Supported pause frame use: Symmetric Receive-only
>>          Supports auto-negotiation: Yes
>>          Supported FEC modes: Not reported
>>          Advertised link modes:  1000baseT/Full
>>          Advertised pause frame use: Symmetric Receive-only
>>          Advertised auto-negotiation: No
>>          Advertised FEC modes: Not reported
>>          Speed: 10Mb/s
>>          Duplex: Half
>>          Port: MII
>>          PHYAD: 1
>>          Transceiver: internal
>>          Auto-negotiation: off
>>          Supports Wake-on: d
>>          Wake-on: d
>>          Current message level: 0xffffffff (-1)
>>                                 drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
>>          Link detected: yes
>>
>> 3) After code tracing, we found that:
>>
>> phy_state_machine()
>>      state PHY_RUNNING: phy_check_link_status()
>>          phy_read_status()
>>              genphy_read_status()
>>                  genphy_read_status_fixed()
>>
>> In genphy_read_status_fixed(), the speed and duplex changed.
>> It seems like the bmcr value is always 0x1000 from swphy_read_reg().
>>
>> After revert the commit 726097d6d6d(net: phy: improve auto-neg emulation in swphy), then the Speed and Duplex shown comes back to 1000M and Full.
>>
>> Could you please take a look it ? Can we revert this commit, is there any side impact ?
>>
>> Best Regards,
>> Fang
> 

  reply	other threads:[~2023-10-23  8:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  7:01 phy: fixed link 1000 or 100 set with autoneg off Jia, Fang
2023-10-23  7:42 ` Bagas Sanjaya
2023-10-23  7:52 ` Heiner Kallweit
2023-10-23  8:34   ` Jia, Fang [this message]
2023-10-23 14:28     ` Andrew Lunn
2023-10-26  2:41       ` Jia, Fang
2023-10-23 14:57   ` David Laight

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=9dd0e0b8-751b-170a-7c8f-bc084efae69b@windriver.com \
    --to=fang.jia@windriver.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).