Netdev List
 help / color / mirror / Atom feed
From: "Markus Stockhausen" <markus.stockhausen@gmx.de>
To: "'Andrew Lunn'" <andrew@lunn.ch>
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: AW: [PATCH net-next v5 2/8] net: mdio: realtek-rtl9300: Add polling documentation
Date: Thu, 23 Jul 2026 08:23:53 +0200	[thread overview]
Message-ID: <009e01dd1a6b$d9726a80$8c573f80$@gmx.de> (raw)
In-Reply-To: <ef41a5bc-804e-4a5f-863d-7221fc1ef1ac@lunn.ch>

Hi Andrew,

> Von: Andrew Lunn <andrew@lunn.ch> 
> Gesendet: Mittwoch, 22. Juli 2026 21:09
> An: Markus Stockhausen <markus.stockhausen@gmx.de>
>  Betreff: Re: [PATCH net-next v5 2/8] net: mdio: realtek-rtl9300: Add
polling documentation
>
> > + * Each device has a SMI_POLL_CTRL register. A per-port bitmask decides
if the hardware polling of
> > + * the associated bus/address is active or not. The hardware runs a
tight loop over this and for
> > + * each set polling bit it issues a status check for the PHY. Attaching
a logic analyzer to the
> > + * MDIO bus of an RTL8380 and RTL8393 gives the following commands (in
kernel notation):
> ...
> 
> I've not seen anything about what you intend to do with the fact the
> hardware is polling the wrong registers.
>
> The link speed is in register 0x1a, which the polling is not looking
> at. The PHY will indicate the media side is doing 100Mbps, but the MAC
> polling register 10 probably thinks it is 1G. I expect bad things will
> then happen.
>
> I know it is not possible to configure the MAC, but can you at least
> see how it has configured the MAC? You can then make the mac_link_up()
> callback check what the phylib driver says against what the broken
> polling says, and when they are different force the interface down and
> report the hardware design is broken.

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. Assumption is: I only 
took some snippets from the tons of data the logic analyzer produced. 
So either the access to 0x1a runs not every poll cycle or the device 
simply derives the link speed from the default registers. From looking at 
genphy_read_status() I understand that regardless of autonegotiation 
any C22 link speed can be derived from registers 0, 1, 4, 5, 9 & 10. 
Maybe Realtek implemented that part of polling in a generic way.

Regarding hardware designs and page handling: I do not know where 
your information about non-Realteak C22 PHY is from. Maybe some 
noise about the C45 Aquantia PHYs. We have

- C22 access is only enabled for 1G PHYs [1]
- All known devices run RTL8218 (B/D/E) or RTL8214FC on 1G [2]
- RTL839x gives link flapping when deactivating polling for a port [3]
- otto_emdio_notify_phy_attach() errors out for non Realtek PHYs [4]
- RTL838x polling unconditionally resets register 31 to zero [4]

So we look at a Realtek-only ecosystem. The downstream-proven 
driver-only page handling patch without any new MDIO callbacks 
is the lowest common denominator.

Other feedback will be integrated into v6 or I will respond individually.

Best regards.

Markus

[1]
https://elixir.bootlin.com/linux/v7.2-rc4/source/drivers/net/mdio/mdio-realt
ek-rtl9300.c#L531
[2] https://github.com/openwrt/openwrt/tree/main/target/linux/realtek/dts
[3]
https://lore.kernel.org/netdev/20260629152336.2239826-9-markus.stockhausen@g
mx.de/ 
[4]
https://lore.kernel.org/netdev/20260722062356.12291-6-markus.stockhausen@gmx
.de/ 



  reply	other threads:[~2026-07-23  6:24 UTC|newest]

Thread overview: 15+ 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     ` Markus Stockhausen [this message]
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='009e01dd1a6b$d9726a80$8c573f80$@gmx.de' \
    --to=markus.stockhausen@gmx.de \
    --cc=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=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