From: Jijie Shao <shaojijie@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <shaojijie@huawei.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<andrew+netdev@lunn.ch>, <horms@kernel.org>,
<shenjian15@huawei.com>, <liuyonglong@huawei.com>,
<chenhao418@huawei.com>, <lantao5@huawei.com>,
<huangdonghua3@h-partners.com>, <yangshuaisong@h-partners.com>,
<huangdengdui@h-partners.com>, <jonathan.cameron@huawei.com>,
<salil.mehta@huawei.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net 1/3] net: hns3: fix loopback test of serdes and phy is failed if duplex is half
Date: Fri, 19 Sep 2025 14:36:58 +0800 [thread overview]
Message-ID: <1e1779f0-def2-4143-8a8c-a11ced956c2a@huawei.com> (raw)
In-Reply-To: <a060e5cf-c1cf-4dfa-b534-ddb72e8652f8@lunn.ch>
on 2025/9/18 0:58, Andrew Lunn wrote:
> On Wed, Sep 17, 2025 at 08:29:52PM +0800, Jijie Shao wrote:
>> If duplex setting is half, mac and phy can not transmit and receive data
>> at the same time.
> Lets think about the fundamentals of Ethernet, MII and half duplex.
>
> Is this specific to your MAC/PHY combination, or just generally true?
>
> Should this is solved in phylib, because it is true for every MAC/PHY
> combination? phylib returning -EINAL to phy_loopback() would seem like
> the correct thing to do.
>
> Is it specific to your PHY, but independent of the MAC? Then the PHY
> should return -EINVAL in its set_loopback() method.
My idea is to prevent customers from seeing command failures,
so I switched from half-duplex to full-duplex for testing.
But it doesn't seem quite appropriate.
>
>> + hdev->hw.mac.duplex_last = phydev->duplex;
>> +
>> + ret = phy_set_bits(phydev, MII_BMCR, BMCR_FULLDPLX);
> A MAC driver should not be doing this. What if the PHY is C45 only?
> And Marvell PHYs need a soft reset before such an operation take
> effect.
>
> Andrew
Thanks for the reminder.
Thanks,
Jijie Shao
next prev parent reply other threads:[~2025-09-19 6:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 12:29 [PATCH net 0/3] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2025-09-17 12:29 ` [PATCH net 1/3] net: hns3: fix loopback test of serdes and phy is failed if duplex is half Jijie Shao
2025-09-17 16:58 ` Andrew Lunn
2025-09-19 6:36 ` Jijie Shao [this message]
2025-09-17 12:29 ` [PATCH net 2/3] net: hns3: return error code when function fails Jijie Shao
2025-09-17 12:29 ` [PATCH net 3/3] net: hns3: use user configure after hardware reset when using kernel PHY Jijie Shao
2025-09-17 17:11 ` Andrew Lunn
2025-09-19 6:07 ` Jijie Shao
2025-09-19 12:20 ` 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=1e1779f0-def2-4143-8a8c-a11ced956c2a@huawei.com \
--to=shaojijie@huawei.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=huangdengdui@h-partners.com \
--cc=huangdonghua3@h-partners.com \
--cc=jonathan.cameron@huawei.com \
--cc=kuba@kernel.org \
--cc=lantao5@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=salil.mehta@huawei.com \
--cc=shenjian15@huawei.com \
--cc=yangshuaisong@h-partners.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®