Devicetree
 help / color / mirror / Atom feed
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 v15 07/13] net: mdio: realtek-rtl9300: Configure hardware polling during probing
Date: Wed, 2 Sep 2026 02:14:36 +0200	[thread overview]
Message-ID: <78a22d1d-cb7c-4b6f-b821-ec5a5830c4ba@lunn.ch> (raw)
In-Reply-To: <20260831143439.2404484-8-markus.stockhausen@gmx.de>

On Mon, Aug 31, 2026 at 04:34:33PM +0200, Markus Stockhausen wrote:
> During PHY probing and configuration complex configuration sequences
> might be issued and firmware might be loaded. Hardware polling can
> interfere badly with that. E.g. a hardware polling MMD c45 over c22
> request might break an ongoing firmware loading sequence.
> 
> To avoid such issues the polling of the Realtek Otto switches can be
> (de)activated with one or two 32 bit mask registers. Each bit enables
> (=1) or disables (=0) the polling of the corresponding port. Make use
> of this as follows:
> 
> - Disable polling for all ports when the MDIO driver starts.
> - Reenable polling just after the PHY has been attached.
> - Disable polling just before the PHY is being detached.
> 
> This synchronizes the kernel and hardware polling to some extent. It
> gracefully handles deferred probing of PHYs in case the driver is
> loaded asynchronously during boot. Additionally it brings the hardware
> polling into a consistent operation mode for devices where U-Boot does
> not take care.
> 
> Important notes about the implementation:
> 
> Realtek is very inconsistent about its register naming. RTL930x uses
> SMI_POLL_CTRL for polling control while it is SMI_PORT_POLLING_CTRL
> on RTL931x. Keep these vendor names.
> 
> These devices do not support power management for the whole system.
> So mdio_bus_phy_resume() is not used and it is not required to
> disable/enable hardware polling for that usecase.
> 
> These devices have no CPU MAC to PHY design. Thus abort phy_attach()
> in case PHYs are not mapped to valid switch ports. All MDIO bus
> commands will fail afterwards, leaving it in an unusable state.
> 
> Enabling/disabling hardware polling is a simple regmap bit access.
> For this it is enough to rely on the regmap internal lock.
> 
> This polling enabling/disabling does not solve the current inability
> of the driver to handle C45-over-C22 access during normal operation.
> For all existing designs this is not needed.
> 
> [1] https://github.com/openwrt/openwrt/blob/main/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c#L818
> [2] https://lore.kernel.org/netdev/680696024a8648535ce6dee771fe4de67802e0e8.1769053496.git.daniel@makrotopia.org/
> 
> Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  parent reply	other threads:[~2026-09-02  0:14 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 14:34 [PATCH net-next v15 00/13] net: mdio: realtek-rtl9300: Add RTL83xx support Markus Stockhausen
2026-08-31 14:34 ` [PATCH net-next v15 01/13] dt-bindings: net: realtek,rtl9301-mdio: Add RTL83xx series Markus Stockhausen
2026-08-31 14:34 ` [PATCH net-next v15 02/13] net: mdio: realtek-rtl9300: Add polling documentation Markus Stockhausen
2026-08-31 14:34 ` [PATCH net-next v15 03/13] net: mdio: realtek-rtl9300: deny C45 over C22 access Markus Stockhausen
2026-09-02  0:08   ` Andrew Lunn
2026-09-02  5:36   ` [net-next,v15,03/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 04/13] net: phy: add phy_detach_internal() helper Markus Stockhausen
2026-09-01 14:35   ` sashiko-bot
2026-09-02  0:09   ` Andrew Lunn
2026-08-31 14:34 ` [PATCH net-next v15 05/13] net: phy: add (*notify_phy_attach/detach)() hooks to struct mii_bus Markus Stockhausen
2026-09-02  0:10   ` Andrew Lunn
2026-09-02  5:36   ` [net-next,v15,05/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 06/13] net: mdio: realtek-rtl9300: suppress sysfs bind/unbind attributes Markus Stockhausen
2026-09-01 14:35   ` sashiko-bot
2026-09-02  0:12   ` Andrew Lunn
2026-09-02  5:36   ` [net-next,v15,06/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 07/13] net: mdio: realtek-rtl9300: Configure hardware polling during probing Markus Stockhausen
2026-09-01 14:35   ` sashiko-bot
2026-09-02  0:14   ` Andrew Lunn [this message]
2026-09-02  5:36   ` [net-next,v15,07/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 08/13] net: mdio: realtek-rtl9300: Add page tracking Markus Stockhausen
2026-09-02  0:16   ` Andrew Lunn
2026-09-02  5:36   ` [net-next,v15,08/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 09/13] net: mdio: realtek-rtl9300: Increase MDIO timeout Markus Stockhausen
2026-08-31 14:34 ` [PATCH net-next v15 10/13] net: mdio: realtek-rtl9300: Open up C22 and C45 space in parallel Markus Stockhausen
2026-09-01 14:35   ` sashiko-bot
2026-09-02  0:16   ` Andrew Lunn
2026-09-02  5:36   ` [net-next,v15,10/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 11/13] net: mdio: realtek-rtl9300: Add support for RTL838x Markus Stockhausen
2026-09-02  0:17   ` Andrew Lunn
2026-09-02  5:36   ` [net-next,v15,11/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 12/13] net: mdio: realtek-rtl9300: Add support for RTL839x Markus Stockhausen
2026-09-02  0:18   ` Andrew Lunn
2026-09-02  5:32     ` AW: " Markus Stockhausen
2026-09-02  5:36   ` [net-next,v15,12/13] " netdev-bot+sashiko
2026-08-31 14:34 ` [PATCH net-next v15 13/13] net: mdio: realtek-rtl9300: reword Kconfig and module description 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=78a22d1d-cb7c-4b6f-b821-ec5a5830c4ba@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