From: Marek Vasut <marek.vasut@mailbox.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Thanh Quan <thanh.quan.xn@renesas.com>,
Hai Pham <hai.pham.ud@renesas.com>,
"David S. Miller" <davem@davemloft.net>,
Dan Murphy <dmurphy@ti.com>, Eric Dumazet <edumazet@google.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [net,PATCH] net: phy: dp83869: fix STRAP_OPMODE bitmask
Date: Mon, 27 Oct 2025 15:02:11 +0100 [thread overview]
Message-ID: <9bfb4118-088a-40cc-a071-4b12d9bc8015@mailbox.org> (raw)
In-Reply-To: <3b5e2a79-186e-4c92-9bef-51fdd34af351@lunn.ch>
On 10/27/25 12:48 AM, Andrew Lunn wrote:
> On Sat, Oct 25, 2025 at 05:09:17AM +0200, Marek Vasut wrote:
>> On 10/24/25 2:24 AM, Andrew Lunn wrote:
>>
>> Hello Andrew,
>>
>>> On Fri, Oct 24, 2025 at 12:39:45AM +0200, Marek Vasut wrote:
>>>> From: Thanh Quan <thanh.quan.xn@renesas.com>
>>>>
>>>> According to the TI DP83869HM datasheet Revision D (June 2025), section
>>>> 7.6.1.41 STRAP_STS Register, the STRAP_OPMODE bitmask is bit [11:9].
>>>> Fix this.
>>>
>>> It is a good idea to state in the commit message what the bad
>>> behaviour is which the patch fixes. Somebody looking through the
>>> patches can then decide if they need to cherry-pick the patch into
>>> their dead vendor tree, etc.
>>>
>>> Please add to the commit message what issue you where seeing which
>>> made you create this patch.
>>
>> In short, on the hardware I use, the interface to the PHY is SGMII, but the
>> driver is confused into thinking it is RGMII based on the STRAP_STS register
>> content, and misconfigures the PHY for RGMII.
>>
>> I plan to extend the commit message this way. I tried to cover all the bases
>> there, so people can decide whether the are affected or not. Is this
>> understandable or is it maybe too much ?
>>
>> "
>> net: phy: dp83869: fix STRAP_OPMODE bitmask
>>
>> According to the TI DP83869HM datasheet Revision D (June 2025), section
>> 7.6.1.41 STRAP_STS Register, the STRAP_OPMODE bitmask is bit [11:9].
>> Fix this.
>>
>> In case the PHY is auto-detected via PHY ID registers, or not described
>> in DT, or, in case the PHY is described in DT but the optional DT property
>> "ti,op-mode" is not present, then the driver reads out the PHY functional
>> mode (RGMII, SGMII, ...) from hardware straps.
>>
>> Currently, all upstream users of this PHY specify both DT compatible string
>> "ethernet-phy-id2000.a0f1" and ti,op-mode = <DP83869_RGMII_COPPER_ETHERNET>
>> property, therefore it seems no upstream users are affected by this bug.
>>
>> The driver currently interprets bits [2:0] of STRAP_STS register as PHY
>> functional mode. Those bits are controlled by ANEG_DIS, ANEGSEL_0 straps
>> and an always-zero reserved bit. Systems that use RGMII-to-Copper functional
>> mode are unlikely to disable auto-negotiation via ANEG_DIS strap, or change
>> auto-negotiation behavior via ANEGSEL_0 strap. Therefore, even with this bug
>> in place, the STRAP_STS register content is likely going to be interpreted
>> by the driver as RGMII-to-Copper mode.
>>
>> However, for a system with PHY functional mode strapping set to other mode
>> than RGMII-to-Copper, the driver is likely to misinterpret the strapping
>> as RGMII-to-Copper and misconfigure the PHY.
>>
>> For example, on a system with SGMII-to-Copper strapping, the STRAP_STS
>> register reads as 0x0c20, but the PHY ends up being configured for
>> incompatible RGMII-to-Copper mode.
>> "
>
> This is good. It nice to have lots of details, cause and effect, even
> if its a silly topo bug.
>
> Please add my Reviewed-by to the next version.
Will do. Thank you for your help !
prev parent reply other threads:[~2025-10-27 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 22:39 [net,PATCH] net: phy: dp83869: fix STRAP_OPMODE bitmask Marek Vasut
2025-10-24 0:24 ` Andrew Lunn
2025-10-25 3:09 ` Marek Vasut
2025-10-26 23:48 ` Andrew Lunn
2025-10-27 14:02 ` Marek Vasut [this message]
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=9bfb4118-088a-40cc-a071-4b12d9bc8015@mailbox.org \
--to=marek.vasut@mailbox.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dmurphy@ti.com \
--cc=edumazet@google.com \
--cc=hai.pham.ud@renesas.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thanh.quan.xn@renesas.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;
as well as URLs for NNTP newsgroup(s).