From: Andrew Lunn <andrew@lunn.ch>
To: Markus Stockhausen <markus.stockhausen@gmx.de>
Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, chris.packham@alliedtelesis.co.nz,
daniel@makrotopia.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/8] net: mdio: realtek-rtl9300: Add polling documentation
Date: Thu, 23 Jul 2026 16:18:20 +0200 [thread overview]
Message-ID: <420dbb03-6a39-4ef3-9cb3-da78401fd4ce@lunn.ch> (raw)
In-Reply-To: <009e01dd1a6b$d9726a80$8c573f80$@gmx.de>
> Appreciate your feedback. I will sum up the situation and my point of
> View about the C22 PHYs in this single answer.
>
> Regarding speed detection: I ran a quick test and MAC side 100Mbit
> detection works fine. So we have no issues there.
Just to be sure. You have a broken cable, so could trigger downshift?
Maybe some background is needed here. An ethernet cable has 4 twisted
pairs. All four are needed for > 100MBs operation. However, autoneg
can work with a broken cable where some pairs are O.K, and some are
broken. The PHYs negotiate a link, and then tries to actually use
it. They then find the broken pair. A downshift then occurs, they swap
to 100MBs, which only require two working pairs, not four. The phy
driver knows that the BMSR and STAT1000 don't give the true status of
the PHY, so it reads the vendor register 0x1a which is correct. phylib
should notice the difference and print the warning:
phy-core.c: phydev_warn(phydev, "Downshift occurred from negotiated speed %s to actual speed %s, check cabling!\n",
and the MAC is told the true link speed via the adjust_link callback,
or the phylink equivalent.
I wounder what else the hardware polling is getting wrong. One obvious
thing to test is pause. Pause can be negotiated, or it can be
forced. I assume forced pause is broken, since that is configured
directly in the MAC. But it would be good to test negotiated pause as
well. EEE is very similar, negotiated, or forced. At least these you
can work around in the MAC driver, by just reporting EOPNOTSUPP in
ksettings_set. But downshift configuration does not come through the
MAC, the PHY driver defaults to enabled, as far as i remember. So you
are going to have to somehow special case the PHYs in these switches.
> Regarding hardware designs and page handling: I do not know where
> your information about non-Realteak C22 PHY is from.
It was a comment from Chris Packham, to one of the versions of this
patchset.
This hardware polling might be good for a dumb unmanaged switch, where
there is an embedded Z80 or other similar MCU doing the minimum amount
of configuration, and no PHY drivers, just power on reset
defaults. But when Linux is used with proper drivers allowing full use
of the hardware, HW polling makes no sense, it is a broken
design. Yes, you can make the main use cases work, but i expect you
are going to find lots of broken corner cases.
Andrew
next prev parent reply other threads:[~2026-07-23 14:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 6:23 [PATCH net-next v5 0/8] net: mdio: realtek-rtl9300: Add RTL83xx support Markus Stockhausen
2026-07-22 6:23 ` [PATCH net-next v5 1/8] dt-bindings: net: realtek,rtl9301-mdio: Add RTL83xx series Markus Stockhausen
2026-07-22 6:23 ` [PATCH net-next v5 2/8] net: mdio: realtek-rtl9300: Add polling documentation Markus Stockhausen
2026-07-22 19:09 ` Andrew Lunn
2026-07-23 6:23 ` AW: " Markus Stockhausen
2026-07-23 14:18 ` Andrew Lunn [this message]
2026-07-23 19:43 ` Markus Stockhausen
2026-07-22 6:23 ` [PATCH net-next v5 3/8] net: phy: add (*notify_phy_attach/detach)() hooks to struct mii_bus Markus Stockhausen
2026-07-22 18:43 ` Andrew Lunn
2026-07-22 6:23 ` [PATCH net-next v5 4/8] net: mdio: realtek-rtl9300: Configure hardware polling during probing Markus Stockhausen
2026-07-22 18:50 ` Andrew Lunn
2026-07-22 6:23 ` [PATCH net-next v5 5/8] net: mdio: realtek-rtl9300: Add page tracking Markus Stockhausen
2026-07-22 18:55 ` Andrew Lunn
2026-07-22 6:23 ` [PATCH net-next v5 6/8] net: mdio: realtek-rtl9300: Increase MDIO timeout Markus Stockhausen
2026-07-22 18:55 ` Andrew Lunn
2026-07-22 6:23 ` [PATCH net-next v5 7/8] net: mdio: realtek-rtl9300: Add support for RTL838x Markus Stockhausen
2026-07-22 6:23 ` [PATCH net-next v5 8/8] net: mdio: realtek-rtl9300: Add support for RTL839x Markus Stockhausen
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=420dbb03-6a39-4ef3-9cb3-da78401fd4ce@lunn.ch \
--to=andrew@lunn.ch \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=conor+dt@kernel.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=markus.stockhausen@gmx.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@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